// 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
// 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