Binding of References
eld Manual—527255-009
3-20
Specifying Which Symbols to Export, and Creating
the Export Digest
the symbol. When the
-cross_dll_cleanup
option is specified, eld also verifies if a
symbol of the same name is found in a DLL. If it finds a same name, eld deems the
last copy of the procedure as "unused", and its code can be cleaned up. The
references to the symbol are therefore resolved to the copy of the symbol in the DLL.
When the
-cross_dll_cleanup
option is used, it is necessary that all the input
linkfiles be compiled with the
-Wglobalized
option (the same as when eld is
specified to build a globalized DLL, since this new option is a form of preemption).
To get maximum benefit from the
-cross_dll_cleanup
option, list the DLLs that are
directly used (on the eld command line), and also DLLs that previously were only
indirectly used.
Specifying Which Symbols to Export, and
Creating the Export Digest
When creating a loadfile the linker must determine which symbols to export. If no
options related to this are given in the linker’s command stream then its default
behavior is that it exports a symbol if it is a global symbol and the
STO_EXPORT
bit is
set in some ELF symbol table entry for the symbol in the linker’s input files. This is the
way the compiler or assembler tells the linker that certain symbols should be exported.
If the
STO_EXPORT
bit is set in any ELF symbol table entry for a symbol in the linker’s
input linkfiles, and the linker is creating a linkfile, then this bit is set in the linker’s output
file.
If the
-export_all
option is used then the linker exports all defined, global symbols
except for those in the following categories:
•
Procedures whose names begin with the special prefixes that mark them for
inclusion in the
ctor
s,
dtor
s,
init
z, or
termz
arrays.
•
Symbols that are specially known to the linker and have names that are
intended to only be meaningful within the loadfile being created. This includes
all the predefined symbols created by the linker, such as the symbols that are
the names of the
ctor
s,
dtor
s,
init
z, and
termz
arrays. However,
-export_all
does cause
_MCB
to be exported, if the linker has created that symbol.
The above rules can be overridden for specific symbols by name. If the -
exported_symbol option is specified then the symbol of the specified name is
unconditionally exported. If the -hidden_symbol option is specified then the symbol of
the specified name is unconditionally not exported. It is an error if the same symbol is
specified in both of these options. It is an error if the symbol specified in the
-exported_symbol option is not a global symbol that is defined in the loadfile being
created. It is a warning rather than an error if such a symbol is specified in the -
hidden_symbol option.
Note that globalized symbols are not treated specially with regard to these rules. That
means they are exported by default because they have the STO_EXPORT bit set, but
you can avoid exporting them by using the
-hidden_symbol
option.
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 ...