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/ldlang.h | |
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/ldlang.h')
-rw-r--r-- | ld/ldlang.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ld/ldlang.h b/ld/ldlang.h index 3018c3e..529ccd1 100644 --- a/ld/ldlang.h +++ b/ld/ldlang.h @@ -513,6 +513,8 @@ extern bfd_boolean entry_from_cmdline; extern lang_statement_list_type file_chain; extern lang_statement_list_type input_file_chain; +extern struct bfd_elf_dynamic_list **current_dynamic_list_p; + extern int lang_statement_iteration; extern struct asneeded_minfo **asneeded_list_tail; @@ -673,7 +675,8 @@ extern struct bfd_elf_version_deps *lang_add_vers_depend (struct bfd_elf_version_deps *, const char *); extern void lang_register_vers_node (const char *, struct bfd_elf_version_tree *, struct bfd_elf_version_deps *); -extern void lang_append_dynamic_list (struct bfd_elf_version_expr *); +extern void lang_append_dynamic_list (struct bfd_elf_dynamic_list **, + struct bfd_elf_version_expr *); extern void lang_append_dynamic_list_cpp_typeinfo (void); extern void lang_append_dynamic_list_cpp_new (void); extern void lang_add_unique |