This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
GOLD:PATCH: Treat STB_GNU_UNIQUE as STB_GLOBAL
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Fri, 4 Dec 2009 18:23:56 -0800
- Subject: GOLD:PATCH: Treat STB_GNU_UNIQUE as STB_GLOBAL
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
This patch treats STB_GNU_UNIQUE as STB_GLOBAL. OK to install?
Thanks.
H.J.
---
2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
* resolve.cc: Fix typo in comment.
(symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
(Symbol_table::override_with_special): Likewise.
(Symbol_table::add_from_object): Likewise.
diff --git a/gold/resolve.cc b/gold/resolve.cc
index 2f0479a..3d05215 100644
--- a/gold/resolve.cc
+++ b/gold/resolve.cc
@@ -151,7 +151,7 @@ Symbol_table::override(Sized_symbol<size>* tosym,
// Bit 0: 0 for global, 1 for weak.
// Bit 1: 0 for regular object, 1 for shared object
// Bits 2-3: 0 for normal, 1 for undefined, 2 for common
-// This gives us values from 0 to 11.
+// This gives us values from 0 to 15.
static const int global_or_weak_shift = 0;
static const unsigned int global_flag = 0 << global_or_weak_shift;
@@ -178,6 +178,7 @@ symbol_to_bits(elfcpp::STB binding, bool is_dynamic,
switch (binding)
{
case elfcpp::STB_GLOBAL:
+ case elfcpp::STB_GNU_UNIQUE:
bits = global_flag;
break;
@@ -883,6 +884,7 @@ Symbol_table::override_with_special(Sized_symbol<size>* tosym,
|| ((tosym->visibility() == elfcpp::STV_HIDDEN
|| tosym->visibility() == elfcpp::STV_INTERNAL)
&& (tosym->binding() == elfcpp::STB_GLOBAL
+ || tosym->binding() == elfcpp::STB_GNU_UNIQUE
|| tosym->binding() == elfcpp::STB_WEAK)
&& !parameters->options().relocatable()))
this->force_local(tosym);
diff --git a/gold/symtab.cc b/gold/symtab.cc
index 9a374f1..7e8a890 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -1010,6 +1010,7 @@ Symbol_table::add_from_object(Object* object,
if ((ret->visibility() == elfcpp::STV_HIDDEN
|| ret->visibility() == elfcpp::STV_INTERNAL)
&& (ret->binding() == elfcpp::STB_GLOBAL
+ || ret->binding() == elfcpp::STB_GNU_UNIQUE
|| ret->binding() == elfcpp::STB_WEAK)
&& !parameters->options().relocatable())
this->force_local(ret);