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-18
Rules for Procedures
•
The linker uses the st_size field in the ELF symbol tables of its input files to
understand the sizes of data items. When there are multiple definitions of a
data item eld reports an error if the sizes are not the same.
It is not an error if some of the definitions have initial values (i.e., in the .data or
.sdata sections) and others don’t (i.e., in the .bss or .sbss sections). However,
eld reports an error if the initial values are not the same in all the copies of the
data that are initialized. Data in the .bss and .sbss sections is considered to
have the initial value zero.
When there are multiple definitions of a data item, and it is not an error, the linker must
choose which copy to use. The linker makes this choice by comparing copies in the
following ways:
•
Choose an instance that is initialized over one that isn’t (i.e., choose .data or
.sdata over .bss or .sbss).
•
If that doesn’t narrow it down to one choice, choose an instance whose
language is C or C++ over one that isn’t. Doing this, after the previous rule, is
convenient for enforcing the rules given above about initialized definitions in C
and C++.
•
If that doesn’t narrow it down to one choice, choose the first instance
encountered.
Note that the linker does not care whether various definitions are short data (namely,
the .sdata, .srdata, and .sbss sections) versus long data (namely, the .data,
.rdata, and .bss sections). If the above rules cause the linker to choose a copy of a
symbol that cannot be reached by 22-bit GP-relative addressing, and 22-bit GP-
relative addressing is used for the symbol, it is an error.
Rules for Procedures
Here are the rules concerning multiple definitions of a procedure:
•
It is an error unless either the STO_MULTIPLE_DEF_OK bit is set in all the
corresponding ELF symbol table entries, or the -allow_duplicate_procs option
is used.
•
It is an error if any copy of the procedure has the CALLABLE or
KERNEL_CALLABLE attribute.
•
It is an error if the various copies do not all agree on the MAIN, SHELL,
EXTENSIBLE, and COMPILED_NONSTOP attributes.
There is no requirement that multiple definitions of the same procedure contain the
same code or have the same size.
When there are multiple definitions of a procedure, and it is not an error, the linker
must choose which copy to use.










