From: Chris Demetriou Date: Wed, 29 Apr 2009 17:24:27 +0000 (+0000) Subject: [ld/ChangeLog] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=267e27229efe6d0edd002c87fc02598588503948;p=binutils-gdb.git [ld/ChangeLog] 2009-04-29 Chris Demetriou * lexsup.c (option_values): Add OPTION_NO_EXPORT_DYNAMIC. (ld_options): Likewise. (parse_args): Likewise. * ld.texinfo: Document --no-export-dynamic. * NEWS: Mention --no-export-dynamic. [ld/testsuite/ChangeLog] 2009-04-29 Chris Demetriou * ld-elfvers/vers.exp (vers4b): New test to verify that --no-export-dynamic undoes --export-dynamic. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index bfb91af8102..a5c60ce7ab2 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2009-04-29 Chris Demetriou + + * lexsup.c (option_values): Add OPTION_NO_EXPORT_DYNAMIC. + (ld_options): Likewise. + (parse_args): Likewise. + * ld.texinfo: Document --no-export-dynamic. + * NEWS: Mention --no-export-dynamic. + 2009-04-29 Alan Modra * deffilep.y (STACKSIZE_K): Rename from STACKSIZE. diff --git a/ld/NEWS b/ld/NEWS index 621b489331c..99d5d8543c9 100644 --- a/ld/NEWS +++ b/ld/NEWS @@ -1,5 +1,8 @@ -*- text -*- +* New option --no-export-dynamic to undo the effect of the -E and + --export-dynamic options. + * ELF: --warn-alternate-em option to warn if an object has alternate ELF machine code. diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 5a8824241fd..77846d5a545 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -491,15 +491,19 @@ regardless of this option. @cindex dynamic symbol table @kindex -E @kindex --export-dynamic +@kindex --no-export-dynamic @item -E @itemx --export-dynamic -When creating a dynamically linked executable, add all symbols to the -dynamic symbol table. The dynamic symbol table is the set of symbols -which are visible from dynamic objects at run time. - -If you do not use this option, the dynamic symbol table will normally -contain only those symbols which are referenced by some dynamic object -mentioned in the link. +@itemx --no-export-dynamic +When creating a dynamically linked executable, using the @option{-E} +option or the @option{--export-dynamic} option causes the linker to add +all symbols to the dynamic symbol table. The dynamic symbol table is the +set of symbols which are visible from dynamic objects at run time. + +If you do not use either of these options (or use the +@option{--no-export-dynamic} option to restore the default behavior), the +dynamic symbol table will normally contain only those symbols which are +referenced by some dynamic object mentioned in the link. If you use @code{dlopen} to load a dynamic object which needs to refer back to the symbols defined by the program, rather than some other diff --git a/ld/lexsup.c b/ld/lexsup.c index f1b5b4c0ffe..a9a26890dfa 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -77,6 +77,7 @@ enum option_values OPTION_EL, OPTION_EMBEDDED_RELOCS, OPTION_EXPORT_DYNAMIC, + OPTION_NO_EXPORT_DYNAMIC, OPTION_HELP, OPTION_IGNORE, OPTION_MAP, @@ -222,6 +223,8 @@ static const struct ld_option ld_options[] = 'e', N_("ADDRESS"), N_("Set start address"), TWO_DASHES }, { {"export-dynamic", no_argument, NULL, OPTION_EXPORT_DYNAMIC}, 'E', NULL, N_("Export all dynamic symbols"), TWO_DASHES }, + { {"no-export-dynamic", no_argument, NULL, OPTION_NO_EXPORT_DYNAMIC}, + '\0', NULL, N_("Undo the effect of --export-dynamic"), TWO_DASHES }, { {"EB", no_argument, NULL, OPTION_EB}, '\0', NULL, N_("Link big-endian objects"), ONE_DASH }, { {"EL", no_argument, NULL, OPTION_EL}, @@ -820,6 +823,9 @@ parse_args (unsigned argc, char **argv) case 'E': /* HP/UX compatibility. */ link_info.export_dynamic = TRUE; break; + case OPTION_NO_EXPORT_DYNAMIC: + link_info.export_dynamic = FALSE; + break; case 'e': lang_add_entry (optarg, TRUE); ldlang_add_undef (optarg); diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 929a2172b3b..dec4cbba102 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-04-29 Chris Demetriou + + * ld-elfvers/vers.exp (vers4b): New test to verify that + --no-export-dynamic undoes --export-dynamic. + 2009-04-28 Nathan Sidwell * ld-i386/vxworks1-lib.dd: Adjust expected disassembly. diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp index e2f658dac75..31a5e38ac15 100644 --- a/ld/testsuite/ld-elfvers/vers.exp +++ b/ld/testsuite/ld-elfvers/vers.exp @@ -804,6 +804,10 @@ build_exec "vers4" vers4.c vers4 "" "" "" "" vers4.sym build_exec "vers4a" vers4.c vers4a "-export-dynamic" "" vers4a.ver vers4a.dsym vers4a.sym +# Verify that --no-export-dynamic undoes the effect of --export-dynamic. +setup_xfail "mips*-*-*" +build_exec "vers4b" vers4.c vers4b "-export-dynamic -Wl,--no-export-dynamic" "" "" "" vers4.sym + # # Try multiple definitions foo@BAR and foo@@BAR and make sure the linker