Specifying Which Symbols To Export, And Creating The Export Digest - HP eld Manual

Table of Contents

Advertisement

Binding of References
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 ctors, dtors, initz, 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 ctors, dtors, initz, 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 opti o ns. 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.
Specifying Which Symbols to Export, and Creating
eld Manual—527255-009
3-20
the Export Digest

Advertisement

Table of Contents
loading

Table of Contents