- // Search through object segment size table to obtain segment sizes
- // for the object that has the required external/global as a local
- // symbol. As each object is interrogated the segment sizes are
- // accumulated to ensure the correct offsets are used in the
- // resulting COF file. This is effectively 'done again' only as we
- // are working with a different object file.
- ssidx = -1;
- tsegoffset = dsegoffset = bsegoffset = 0;
-
- // Search for object filename
- for(j=0; j<(int)obj_index; j++)
- {
- if (!strcmp(hptr->h_ofile->o_name, obj_fname[j]))
- {
- ssidx = j; // Symbol object filename
- break;
- }
-
- // Accumulate segment sizes
- tsegoffset += obj_segsize[j][0];
- dsegoffset += obj_segsize[j][1];
- bsegoffset += obj_segsize[j][2];
- }
-
- if (ssidx == -1)
- {
- printf("DoSymbols(): Object file missing from obj_fname: '%s:%s' symbol: '%s' (%s)\n",
- hptr->h_ofile->o_name, hptr->h_ofile->o_arname,
- symend + index, ofile->o_name);
- return 1;
- }
+ tsegoffset = hptr->h_ofile->segBase[TEXT];
+ dsegoffset = hptr->h_ofile->segBase[DATA];
+ bsegoffset = hptr->h_ofile->segBase[BSS];