summaryrefslogtreecommitdiff
path: root/gold/target-reloc.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-12-12 02:41:39 +0000
committerIan Lance Taylor <ian@airs.com>2008-12-12 02:41:39 +0000
commitc25081787282f9acff5b23cf4f0b110857f03286 (patch)
tree1ca200a09273dc7d1b650914d315f55270896776 /gold/target-reloc.h
parent5f3563ea7a07d0c74d23f6c56281fb27dfc514d8 (diff)
PR 7091
* target-reloc.h (Default_scan_relocatable_relocs): For each function, map r_type == 0 to RELOC_DISCARD.
Diffstat (limited to 'gold/target-reloc.h')
-rw-r--r--gold/target-reloc.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/gold/target-reloc.h b/gold/target-reloc.h
index 935d76bc24..3205e3666d 100644
--- a/gold/target-reloc.h
+++ b/gold/target-reloc.h
@@ -308,14 +308,24 @@ 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, Relobj*)
- { return Relocatable_relocs::RELOC_COPY; }
+ local_non_section_strategy(unsigned int r_type, Relobj*)
+ {
+ // 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;
+ }
// Return the strategy to use for a local symbol which is a section
// symbol, given the relocation type.
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
@@ -342,8 +352,14 @@ 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, Relobj*, unsigned int)
- { return Relocatable_relocs::RELOC_COPY; }
+ 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;
+ }
};
// Scan relocs during a relocatable link. This is a default