Binding of References
eld Manual—527255-009
3-21
Processing of Code and Data Sections
The option
-export
is accepted as a synonym for
-exported_symbo
l, and
-export_not
as
a synonym for
-hidden_symbo
l.
Exported symbols are identified in the
.dynsym
and
.dynsym.gblzd
sections by the fact
that they are marked
STB_GLOBAL
and not
SHN_UNDE
F. If a symbol that was
STB_GLOBAL
in its input linkfile is not exported, that fact is indicated by marking it as
STB_LOCAL
rather than
STB_GLOBAL
in the output loadfile.
The linker calculates the export digest based on the names and addresses of exported
symbols in the
.dynsym
section, and on the GP value for the loadfile, and stores it in
the
export_digest
field of the
.tandem_info
section. Globalized symbols are not
included in the calculation of the export digest.
The options described in this section are not allowed if
-r
is specified.
If you are starting with code that had been a single program before, perhaps built from
archives, and now you are changing it to be split up among several DLLs, you might
find it useful to build the program and DLLs with the
-b globalized
and
-export_all
options, to assure that all symbolic references among the program and DLLs keep
referring to a single copy of each symbol.
Processing of Code and Data Sections
A
text section
contains procedures. A
data section
contains data that is allocated at a
certain address in virtual memory when the loadfile is brought into memory, as
opposed to data that is dynamically allocated on the stack or in the heap.
The linker checks that the sizes of all code and data sections are multiples of 16 bytes.
Concatenating Code and Data Sections Found in the Input
Linkfiles
A linkfile may have many text sections, with names beginning either
.text
or
.restex
t.
When the linker is creating a new linkfile with the
-r
option, it concatenates text
sections of the same names in its input files to create text sections of those same
names in its output file. When section names are the same in different input linkfiles,
the linker concatenates them in the same order as the linker saw those linkfiles.
However, when the linker creates a loadfile, it combines all the input sections whose
names begin
.text
into a single output text section named
.tex
t, and similarly for
.restex
t. No guarantee is given as to the order in which different text sections whose
names begin
.text
are combined into a single text section named
.tex
t, and similarly for
.restex
t.
With regard to data sections, again, the linker usually concatenates data sections of
the same names in its input files into data sections of the same names in its output file,
and the linker does this whether creating a linkfile or a loadfile. Except, when an input
linkfile has a section named
.rdat
a, and it contains no relocation sites, the linker
changes the name of that input section to
.rcons
t, and combines all sections named
.rconst
into a section of that name in its output file accordingly.
Summary of Contents for eld
Page 4: ......
Page 8: ...Contents eld Manual 527255 009 iv ...
Page 12: ...What s New in This Manual eld Manual 527255 009 viii Changes to the 527255 005 Manual ...
Page 34: ...Introduction to eld eld Manual 527255 009 1 14 Example of Use ...
Page 54: ...eld Input and Output eld Manual 527255 009 2 20 Using Archives ...
Page 98: ...Other eld Processing eld Manual 527255 009 4 20 Merging Source RTDUs ...
Page 242: ...Output Listings and Error Handling eld Manual 527255 009 6 132 Glossary of Errors ...