summaryrefslogtreecommitdiff
path: root/gold/target-reloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'gold/target-reloc.h')
-rw-r--r--gold/target-reloc.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/gold/target-reloc.h b/gold/target-reloc.h
index 6683ddd05fd..935d76bc24e 100644
--- a/gold/target-reloc.h
+++ b/gold/target-reloc.h
@@ -283,6 +283,7 @@ relocate_section(
if (sym != NULL
&& sym->is_undefined()
&& sym->binding() != elfcpp::STB_WEAK
+ && !target->is_defined_by_abi(sym)
&& (!parameters->options().shared() // -shared
|| parameters->options().defs())) // -z defs
gold_undefined_symbol(sym, relinfo, i, offset);
@@ -449,6 +450,7 @@ relocate_for_relocatable(
typedef typename Reloc_types<sh_type, size, big_endian>::Reloc_write
Reltype_write;
const int reloc_size = Reloc_types<sh_type, size, big_endian>::reloc_size;
+ const Address invalid_address = static_cast<Address>(0) - 1;
Sized_relobj<size, big_endian>* const object = relinfo->object;
const unsigned int local_count = object->local_symbol_count();
@@ -523,7 +525,7 @@ relocate_for_relocatable(
Address offset = reloc.get_r_offset();
Address new_offset;
- if (offset_in_output_section != -1U)
+ if (offset_in_output_section != invalid_address)
new_offset = offset + offset_in_output_section;
else
{
@@ -542,7 +544,7 @@ relocate_for_relocatable(
if (!parameters->options().relocatable())
{
new_offset += view_address;
- if (offset_in_output_section != -1U)
+ if (offset_in_output_section != invalid_address)
new_offset -= offset_in_output_section;
}