+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.
-*- 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.
@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
OPTION_EL,
OPTION_EMBEDDED_RELOCS,
OPTION_EXPORT_DYNAMIC,
+ OPTION_NO_EXPORT_DYNAMIC,
OPTION_HELP,
OPTION_IGNORE,
OPTION_MAP,
'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},
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);
+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.
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