Processing Of Code And Data Sections; Concatenating Code And Data Sections Found In The Input Linkfiles - HP eld Manual

Table of Contents

Advertisement

Binding of References
The option -export is accepted as a synonym for -exported_symbol, and -export_not as
a synonym for -hidden_symbol.
Exported symbols are identified in the .dynsym and .dynsym.gblzd sections by the fact
that they are marked STB_GLOBAL and not SHN_UNDEF. 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 .restext.
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 .text, and similarly for
.restext. 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 .text, and similarly for
.restext.
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 .rdata, and it contains no relocation sites, the linker
changes the name of that input section to .rconst, and combines all sections named
.rconst into a section of that name in its output file accordingly.
eld Manual—527255-009
3-21
Processing of Code and Data Sections

Advertisement

Table of Contents
loading

Table of Contents