aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2011-10-31 22:43:49 +0000
committerCary Coutant <ccoutant@google.com>2011-10-31 22:43:49 +0000
commit9634ed06a66c3693045bb8b3bf86b43942239dd8 (patch)
treedf00f7cc36e32cdb099a1be97c032e84d6cae1c7 /gold
parentde4101c724d90aa753a39e04fd3e1f09c66e2c75 (diff)
downloadgdb-9634ed06a66c3693045bb8b3bf86b43942239dd8.zip
gdb-9634ed06a66c3693045bb8b3bf86b43942239dd8.tar.gz
gdb-9634ed06a66c3693045bb8b3bf86b43942239dd8.tar.bz2
* options.h (class General_options): Add --[no-]gnu-unique options.
* symtab.cc (Symbol_table::sized_write_globals): Convert STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog6
-rw-r--r--gold/options.h4
-rw-r--r--gold/symtab.cc6
3 files changed, 16 insertions, 0 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index fddf7d0..cc8aae0 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,5 +1,11 @@
2011-10-31 Cary Coutant <ccoutant@google.com>
+ * options.h (class General_options): Add --[no-]gnu-unique options.
+ * symtab.cc (Symbol_table::sized_write_globals): Convert
+ STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
+
+2011-10-31 Cary Coutant <ccoutant@google.com>
+
PR gold/13359
* i386.cc (Target_i386::Relocate::relocate_tls): Remove
unnecessary assertion.
diff --git a/gold/options.h b/gold/options.h
index 2837790..9909483 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -787,6 +787,10 @@ class General_options
DEFINE_bool(g, options::EXACTLY_ONE_DASH, '\0', false,
N_("Ignored"), NULL);
+ DEFINE_bool(gnu_unique, options::TWO_DASHES, '\0', true,
+ N_("Enable STB_GNU_UNIQUE symbol binding (default)"),
+ N_("Disable STB_GNU_UNIQUE symbol binding"));
+
DEFINE_string(soname, options::ONE_DASH, 'h', NULL,
N_("Set shared library name"), N_("FILENAME"));
diff --git a/gold/symtab.cc b/gold/symtab.cc
index 3b76adb..f0ba1d5 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -2814,6 +2814,12 @@ Symbol_table::sized_write_globals(const Stringpool* sympool,
typename elfcpp::Elf_types<size>::Elf_Addr sym_value = sym->value();
typename elfcpp::Elf_types<size>::Elf_Addr dynsym_value = sym_value;
elfcpp::STB binding = sym->binding();
+
+ // If --no-gnu-unique is set, change STB_GNU_UNIQUE to STB_GLOBAL.
+ if (binding == elfcpp::STB_GNU_UNIQUE
+ && !parameters->options().gnu_unique())
+ binding = elfcpp::STB_GLOBAL;
+
switch (sym->source())
{
case Symbol::FROM_OBJECT: