[ld/ChangeLog]

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.

[ld/testsuite/ChangeLog]
2009-04-29  Chris Demetriou  <cgd@google.com>

        * ld-elfvers/vers.exp (vers4b): New test to verify that
        --no-export-dynamic undoes --export-dynamic.
This commit is contained in:
Chris Demetriou 2009-04-29 17:24:27 +00:00
parent 3ea7450594
commit 267e27229e
6 changed files with 36 additions and 6 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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.
@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 this option, the dynamic symbol table will normally
contain only those symbols which are referenced by some dynamic object
mentioned in the link.
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

View File

@ -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);

View File

@ -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.

View File

@ -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