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
Other eld Processing
eld Manual—527255-009
4-17
Specification of the Main Entry Point
Checks are only performed against DLLs that the linker actually saw. For example, the
linker is not required to search for indirect DLLs if it is not presetting and not checking
for unresolved symbols, so in that case it is not required to perform floating point
consistency checking against such indirect DLLs.
Whenever the linker builds a new linkfile or loadfile it checks for the consistency of the
data model among its input linkfiles, because the two data models cannot be
intermixed in the same loadfile, and the data model of the input linkfiles determines the
data model for the output file. More specifically, at the present time, the linker does not
allow the 64-bit data model at all, but in the future that will be relaxed. There is no
checking for consistency against DLLs, because loadfiles with different data models
are allowed in the same process.
Specification of the Main Entry Point
There are two ways to specify the main entry point of a loadfile. One is to use the -e
option, specifying the name of a procedure. The other way is for a procedure to have
the MAIN attribute.
In a program, the e_entry field is filled in with the address of the real code for the main
entry point. In a DLL, if it has a main entry point, then that procedure must have an
official function descriptor, and the e_entry field contains the address of that official
function descriptor.
When the -e option is specified the linker checks that it is the name of a procedure
that is defined in this object file (otherwise it is an error). eld reports an error if this
procedure has the CALLABLE or KERNEL_CALLABLE attribute. Additional rules
depend on the type of file that the linker is building:
•
If the linker is building a program then eld reports an error if no main entry
point has been specified by either of the above methods. The linker will put out
a warning if the -e option is used and the program has a procedure with the
MAIN attribute, unless the same procedure is indicated in both cases. The
linker uses the -e option to determine the main entry point, overriding the fact
that a procedure had the MAIN attribute.
•
If the linker is building a DLL then eld reports an error if any procedure has the
MAIN attribute. However, the -e option is allowed. If the -e option is not
provided then the e_entry field contains zero.
•
If the linker is building a linkfile then the -e option has a different purpose.
Namely, it turns on the MAIN attribute in the .procinfo entry for the specified
name. The e_entry field of the ELF header in a linkfile always contains zero.
When the linker is building a loadfile
eld reports an error if more than one procedure
has the MAIN attribute, unless the -allow_multiple_mains option is used. When
there are multiple procedures with the MAIN attribute, and this is not an error, the linker
pays attention to the MAIN attribute on the first procedure that it sees with it. This
ordering is implied by the order in which the linker finds linkfiles from the command
stream and the ordering of the entries in the .procinfo sections of the linkfiles.










