aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
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/symtab.cc
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/symtab.cc')
-rw-r--r--gold/symtab.cc6
1 files changed, 6 insertions, 0 deletions
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: