diff options
author | Fangrui Song <maskray@google.com> | 2020-05-20 18:31:39 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-05-24 04:47:46 -0700 |
commit | bb68f22c8e648032a0d1c1d17353eec599ff5e6a (patch) | |
tree | 1fc263456d051a8cc7f2913664b4f9e3b8356666 /ld/lexsup.c | |
parent | 309cae1f7bbb6c4de0234e9f592d7dad3d6c61ba (diff) | |
download | gdb-bb68f22c8e648032a0d1c1d17353eec599ff5e6a.zip gdb-bb68f22c8e648032a0d1c1d17353eec599ff5e6a.tar.gz gdb-bb68f22c8e648032a0d1c1d17353eec599ff5e6a.tar.bz2 |
ld: Handle --dynamic-list* before -Bsymbolic -Bsymbolic-functions
--dynamic-list* should work both before and after -Bsymbolic and
-Bsymbolic-functions.
PR ld/26018
* lexsup.c (parse_args): Simplify.
* testsuite/ld-elf/dl4e.out: New.
* testsuite/ld-elf/shared.exp: Updated for PR ld/26018 tests.
Diffstat (limited to 'ld/lexsup.c')
-rw-r--r-- | ld/lexsup.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c index fe9526b..04db2f1 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -1390,22 +1390,16 @@ parse_args (unsigned argc, char **argv) break; case OPTION_DYNAMIC_LIST_DATA: opt_dynamic_list = dynamic_list_data; - if (opt_symbolic == symbolic) - opt_symbolic = symbolic_unset; break; case OPTION_DYNAMIC_LIST_CPP_TYPEINFO: lang_append_dynamic_list_cpp_typeinfo (); if (opt_dynamic_list != dynamic_list_data) opt_dynamic_list = dynamic_list; - if (opt_symbolic == symbolic) - opt_symbolic = symbolic_unset; break; case OPTION_DYNAMIC_LIST_CPP_NEW: lang_append_dynamic_list_cpp_new (); if (opt_dynamic_list != dynamic_list_data) opt_dynamic_list = dynamic_list; - if (opt_symbolic == symbolic) - opt_symbolic = symbolic_unset; break; case OPTION_DYNAMIC_LIST: /* This option indicates a small script that only specifies @@ -1422,8 +1416,6 @@ parse_args (unsigned argc, char **argv) } if (opt_dynamic_list != dynamic_list_data) opt_dynamic_list = dynamic_list; - if (opt_symbolic == symbolic) - opt_symbolic = symbolic_unset; break; case OPTION_WARN_COMMON: config.warn_common = TRUE; @@ -1632,6 +1624,19 @@ parse_args (unsigned argc, char **argv) && command_line.check_section_addresses < 0) command_line.check_section_addresses = 0; + switch (opt_dynamic_list) + { + case dynamic_list_unset: + break; + case dynamic_list_data: + link_info.dynamic_data = TRUE; + /* Fall through. */ + case dynamic_list: + link_info.dynamic = TRUE; + opt_symbolic = symbolic_unset; + break; + } + /* -Bsymbolic and -Bsymbols-functions are for shared library output. */ if (bfd_link_dll (&link_info)) switch (opt_symbolic) @@ -1651,25 +1656,13 @@ parse_args (unsigned argc, char **argv) free (link_info.dynamic_list); link_info.dynamic_list = NULL; } - opt_dynamic_list = dynamic_list_unset; break; case symbolic_functions: - opt_dynamic_list = dynamic_list_data; + link_info.dynamic = TRUE; + link_info.dynamic_data = TRUE; break; } - switch (opt_dynamic_list) - { - case dynamic_list_unset: - break; - case dynamic_list_data: - link_info.dynamic_data = TRUE; - /* Fall through. */ - case dynamic_list: - link_info.dynamic = TRUE; - break; - } - if (!bfd_link_dll (&link_info)) { if (command_line.filter_shlib) |