Binding of References
eld Manual—527255-009
3-19
Using the
-cross_dll_cleanup
option
If two copies of the procedure agree on the
RESIDENT
attributes, the linker prefers the
first one it sees.
The linker prefers one that is
RESIDENT
over one that is not
RESIDENT
. Note that the
linker doesn’t know why someone thought the procedure needed to be
RESIDENT
, but
as long as at least one copy said so, the linker assumes it is necessary.
In all cases, after the linker chooses which copy to use, that determines the contents of
the code for the procedure.
The above rules about duplicate symbols apply both when the linker is creating a
loadfile as well as when the linker is creating a linkfile with the
-r
option.
When there are multiple definitions of a symbol, the one chosen by the linker is the
only one still represented in the ELF symbol table of the output file (if it is a linkfile), or
in the
.dynsym
or
.dynsym.gblzd
section of the output file (if it is a loadfile).
All references to a symbol of this name get fixed up to this copy of the symbol.
Note that the linker never uses DWARF information to decide if multiple definitions are
allowed, or to decide which definition to keep. (The linker never uses DWARF
information to decide things outside of DWARF itself, because the DWARF information
can be stripped from linkfiles.) When the linker fills in addresses of symbols in the
DWARF information, it fills in -1 for the address of an unused copy of a symbol. The
linker does this for both linkfiles and loadfiles.
The information about unused copies of procedures is deleted from the
.procinfo
section of a linkfile, and from the stack unwinding information of a linkfile or loadfile.
The
-show_multiple_defs
option tells the linker to print out information about global
symbols that are multiply defined. The result is similar to giving a
-y
option about each
such symbol, except that it isn’t necessary to know ahead of time which symbols they
are, and the information only comes out about the linkfiles that defined the symbol, not
about other linkfiles that only mentioned it as an external reference.
Using the
-cross_dll_cleanup
option
The
-cross_dll_cleanup
option is used to reduce the total size of a program and
the private DLLs that are used by a process. This option affects the behavior of the
eld
program with regard to symbols
eld
finds in its input linkfiles that have all the
following properties:
•
The symbol is a global symbol.
•
The symbol is a definition (not an external reference).
•
The symbol is a procedure.
•
The symbol is marked STO_MULTIPLE_DEF_OK (implying that it is a multidef or
globalized symbol).
Without the
-cross_dll_cleanup
option, you can store multiple copies of a symbol
that have the above properties, and eld discards the code for all except one copy of
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 ...