eld Manual
Table Of Contents
- eld Manual
- Legal Notices
- Contents
- What’s New in This Manual
- Manual Information
- New and Changed Information
- About This Manual
- Notation Conventions
- 1 Introduction to eld
- 2 eld Input and Output
- 3 Binding of References
- Overview
- Presetting Loadfiles
- To Preset or Not to Preset, and Creation of the LIC
- Handling Unresolved References
- Using User Libraries
- Creating Import Libraries
- Ignoring Optional Libraries
- Merging Symbols Found in Input Linkfiles
- Accepting Multiply-Defined Symbols
- Using the -cross_dll_cleanup option
- Specifying Which Symbols to Export, and Creating the Export Digest
- Public Libraries and DLLs
- The Public Library Registry
- 4 Other eld Processing
- Adjusting Loadfiles: The -alf Option
- Additional rules about -alf
- The -set and -change Options
- eld Functionality for 64-Bit
- Checking the C++ Language Dialect
- Renaming Symbols
- Creating Linker-Defined Symbols
- Updating Or Stripping DWARF Symbol Table Information
- Modifying the Data Sections that Contain Stack Unwinding Information
- Creating the MCB
- Processing of Floating Point Versions and Data Models
- Specification of the Main Entry Point
- Specifying Runtime Search Path Information for DLLs
- Merging Source RTDUs
- 5 Summary of Linker Options
- 6 Output Listings and Error Handling
- A TNS/E Native Object Files
- Glossary
- Index
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










