diff options
author | Fangrui Song <maskray@google.com> | 2020-06-03 06:37:39 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-06-03 06:37:39 -0700 |
commit | 37a141bfed4dd3c33d77c15dfde00e4b4f5b24c7 (patch) | |
tree | 05fc3a047c219a7e59357a758472a566e926a570 /ld/ld.texi | |
parent | 433953ffa1a59531a5537327a4e3ce24565e609c (diff) | |
download | gdb-37a141bfed4dd3c33d77c15dfde00e4b4f5b24c7.zip gdb-37a141bfed4dd3c33d77c15dfde00e4b4f5b24c7.tar.gz gdb-37a141bfed4dd3c33d77c15dfde00e4b4f5b24c7.tar.bz2 |
ld: Add --export-dynamic-symbol and --export-dynamic-symbol-list
--export-dynamic-symbol-list is like a dynamic list, but without
the symbolic property for unspecified symbols.
When creating an executable, --export-dynamic-symbol-list is treated
like --dynamic-list.
When creating a shared library, it is treated like --dynamic-list if
-Bsymbolic or --dynamic-list are used, otherwise, it is ignored, so
that references to matched symbols will not be bound to the definitions
within the shared library.
PR ld/25910
* NEWS: Mention --export-dynamic-symbol[-list].
* ld.texi: Document --export-dynamic-symbol[-list].
* ldgram.y: Pass current_dynamic_list_p to
lang_append_dynamic_list.
* ldlang.c (current_dynamic_list_p): New.
(ang_append_dynamic_list): Updated to take a pointer to
struct bfd_elf_dynamic_list * argument instead of using
link_info.dynamic_list.
(lang_append_dynamic_list_cpp_typeinfo): Pass
&link_info.dynamic_list to ang_append_dynamic_list.
(lang_append_dynamic_list_cpp_new): Likewise.
* ldlang.h (current_dynamic_list_p): New.
(lang_append_dynamic_list): Add a pointer to
struct bfd_elf_dynamic_list * argument.
* ldlex.h (option_values): Add OPTION_EXPORT_DYNAMIC_SYMBOL and
OPTION_EXPORT_DYNAMIC_SYMBOL_LIST.
* lexsup.c (ld_options): Add entries for
OPTION_EXPORT_DYNAMIC_SYMBOL and
OPTION_EXPORT_DYNAMIC_SYMBOL_LIST.
(parse_args): Handle --export-dynamic-symbol and
--export-dynamic-symbol-list.
* testsuite/ld-dynamic/export-dynamic-symbol-1.d: New.
* testsuite/ld-dynamic/export-dynamic-symbol-2.d: New.
* testsuite/ld-dynamic/export-dynamic-symbol-glob.d: New.
* testsuite/ld-dynamic/export-dynamic-symbol-list-1.d: New.
* testsuite/ld-dynamic/export-dynamic-symbol-list-2.d: New.
* testsuite/ld-dynamic/export-dynamic-symbol-list-glob.d: New.
* testsuite/ld-dynamic/export-dynamic-symbol.exp: New.
* testsuite/ld-dynamic/export-dynamic-symbol.s: New.
* testsuite/ld-dynamic/foo-bar.list: New.
* testsuite/ld-dynamic/foo.list: New.
* testsuite/ld-dynamic/foo.s: New.
* testsuite/ld-dynamic/fstar.list: New.
* testsuite/ld-elf/dlempty.list: New.
* testsuite/ld-elf/shared.exp: Add tests for
--export-dynamic-symbol and --export-dynamic-symbol-list.
Diffstat (limited to 'ld/ld.texi')
-rw-r--r-- | ld/ld.texi | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -569,6 +569,24 @@ Note that this option is specific to ELF targeted ports. PE targets support a similar function to export all symbols from a DLL or EXE; see the description of @samp{--export-all-symbols} below. +@kindex --export-dynamic-symbol=@var{glob} +@cindex export dynamic symbol +@item --export-dynamic-symbol=@var{glob} +When creating a dynamically linked executable, symbols matching +@var{glob} will be added to the dynamic symbol table. When creating a +shared library, references to symbols matching @var{glob} will not be +bound to the definitions within the shared library. This option is a +no-op when creating a shared library and @samp{-Bsymbolic} or +@samp{--dynamic-list} are not specified. This option is only meaningful +on ELF platforms which support shared libraries. + +@kindex --export-dynamic-symbol-list=@var{file} +@cindex export dynamic symbol list +@item --export-dynamic-symbol-list=@var{file} +Specify a @samp{--export-dynamic-symbol} for each pattern in the file. +The format of the file is the same as the version node without +scope and node name. See @ref{VERSION} for more information. + @ifclear SingleFormat @cindex big-endian objects @cindex endianness |