aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-12-12 16:33:05 +0000
committerIan Lance Taylor <ian@airs.com>2008-12-12 16:33:05 +0000
commit6894310219af8c9a811814973c3375716d2e3dde (patch)
treec1835c8f2e0a1dad7e4e9dc92c89ce42c37c9811 /gold
parentb0074644c422c28e8be29f9ba5336d80cd05a4b3 (diff)
downloadgdb-6894310219af8c9a811814973c3375716d2e3dde.zip
gdb-6894310219af8c9a811814973c3375716d2e3dde.tar.gz
gdb-6894310219af8c9a811814973c3375716d2e3dde.tar.bz2
* target-reloc.h (Default_scan_relocatable_relocs): Only discard
r_type == 0 for a local symbol with r_sym == 0. (scan_relocatable_relocs): Pass r_sym to local_non_section_strategy. * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add r_sym parameter.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog7
-rw-r--r--gold/reloc.cc2
-rw-r--r--gold/target-reloc.h21
3 files changed, 14 insertions, 16 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 17e3b41..3e1b99f 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,5 +1,12 @@
2008-12-12 Ian Lance Taylor <iant@google.com>
+ * target-reloc.h (Default_scan_relocatable_relocs): Only discard
+ r_type == 0 for a local symbol with r_sym == 0.
+ (scan_relocatable_relocs): Pass r_sym to
+ local_non_section_strategy.
+ * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
+ r_sym parameter.
+
* configure.ac: Update test for TLS descriptors: they are
supported as of glibc 2.9.
* configure: Rebuild.
diff --git a/gold/reloc.cc b/gold/reloc.cc
index 9a444a2..f6bef1d 100644
--- a/gold/reloc.cc
+++ b/gold/reloc.cc
@@ -368,7 +368,7 @@ class Emit_relocs_strategy
public:
// A local non-section symbol.
inline Relocatable_relocs::Reloc_strategy
- local_non_section_strategy(unsigned int, Relobj*)
+ local_non_section_strategy(unsigned int, Relobj*, unsigned int)
{ return Relocatable_relocs::RELOC_COPY; }
// A local section symbol.
diff --git a/gold/target-reloc.h b/gold/target-reloc.h
index 3205e36..b9ecf9f 100644
--- a/gold/target-reloc.h
+++ b/gold/target-reloc.h
@@ -308,11 +308,11 @@ class Default_scan_relocatable_relocs
// Return the strategy to use for a local symbol which is not a
// section symbol, given the relocation type.
inline Relocatable_relocs::Reloc_strategy
- local_non_section_strategy(unsigned int r_type, Relobj*)
+ local_non_section_strategy(unsigned int r_type, Relobj*, unsigned int r_sym)
{
// We assume that relocation type 0 is NONE. Targets which are
// different must override.
- if (r_type == 0)
+ if (r_type == 0 && r_sym == 0)
return Relocatable_relocs::RELOC_DISCARD;
return Relocatable_relocs::RELOC_COPY;
}
@@ -322,10 +322,6 @@ class Default_scan_relocatable_relocs
inline Relocatable_relocs::Reloc_strategy
local_section_strategy(unsigned int r_type, Relobj* object)
{
- // We assume that relocation type 0 is NONE. Targets which are
- // different must override.
- if (r_type == 0)
- return Relocatable_relocs::RELOC_DISCARD;
if (sh_type == elfcpp::SHT_RELA)
return Relocatable_relocs::RELOC_ADJUST_FOR_SECTION_RELA;
else
@@ -352,14 +348,8 @@ class Default_scan_relocatable_relocs
// Return the strategy to use for a global symbol, given the
// relocation type, the object, and the symbol index.
inline Relocatable_relocs::Reloc_strategy
- global_strategy(unsigned int r_type, Relobj*, unsigned int)
- {
- // We assume that relocation type 0 is NONE. Targets which are
- // different must override.
- if (r_type == 0)
- return Relocatable_relocs::RELOC_DISCARD;
- return Relocatable_relocs::RELOC_COPY;
- }
+ global_strategy(unsigned int, Relobj*, unsigned int)
+ { return Relocatable_relocs::RELOC_COPY; }
};
// Scan relocs during a relocatable link. This is a default
@@ -429,7 +419,8 @@ scan_relocatable_relocs(
strategy = Relocatable_relocs::RELOC_DISCARD;
}
else if (lsym.get_st_type() != elfcpp::STT_SECTION)
- strategy = scan.local_non_section_strategy(r_type, object);
+ strategy = scan.local_non_section_strategy(r_type, object,
+ r_sym);
else
{
strategy = scan.local_section_strategy(r_type, object);