diff options
-rw-r--r-- | ld/ChangeLog | 8 | ||||
-rw-r--r-- | ld/NEWS | 3 | ||||
-rw-r--r-- | ld/ld.texinfo | 18 | ||||
-rw-r--r-- | ld/lexsup.c | 6 | ||||
-rw-r--r-- | ld/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-elfvers/vers.exp | 4 |
6 files changed, 37 insertions, 7 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index bfb91af..a5c60ce 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2009-04-29 Chris Demetriou <cgd@google.com> + + * 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 <amodra@bigpond.net.au> * deffilep.y (STACKSIZE_K): Rename from STACKSIZE. @@ -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 5a88242..77846d5 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 f1b5b4c..a9a2689 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 929a217..dec4cbb 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-04-29 Chris Demetriou <cgd@google.com> + + * ld-elfvers/vers.exp (vers4b): New test to verify that + --no-export-dynamic undoes --export-dynamic. + 2009-04-28 Nathan Sidwell <nathan@codesourcery.com> * 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 e2f658d..31a5e38 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 |