2011-11-10 Doug Kwan <dougkwan@google.com>

PR gold/13362
	* arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
	when processing data relocs.
	* reloc.h (Relocate_functions::rel_unaligned): New method.
	(Relocate_functions::pcrel_unaligned): Ditto.
	(Relocate_functions::rel32_unaligned): Ditto.
	(Relocate_functions::pcrel32_unaligned): Ditto.
This commit is contained in:
Doug Kwan
2011-11-10 20:53:36 +00:00
parent 50f182aa66
commit 29ab395d2b
3 changed files with 51 additions and 5 deletions

View File

@@ -9348,7 +9348,7 @@ Target_arm<big_endian>::Relocate::relocate_tls(
// Relocate the field with the PC relative offset of the pair of
// GOT entries.
RelocFuncs::pcrel32(view, got_entry, address);
RelocFuncs::pcrel32_unaligned(view, got_entry, address);
return ArmRelocFuncs::STATUS_OKAY;
}
}
@@ -9367,13 +9367,13 @@ Target_arm<big_endian>::Relocate::relocate_tls(
// Relocate the field with the PC relative offset of the pair of
// GOT entries.
RelocFuncs::pcrel32(view, got_entry, address);
RelocFuncs::pcrel32_unaligned(view, got_entry, address);
return ArmRelocFuncs::STATUS_OKAY;
}
break;
case elfcpp::R_ARM_TLS_LDO32: // Alternate local-dynamic
RelocFuncs::rel32(view, value);
RelocFuncs::rel32_unaligned(view, value);
return ArmRelocFuncs::STATUS_OKAY;
case elfcpp::R_ARM_TLS_IE32: // Initial-exec
@@ -9402,7 +9402,7 @@ Target_arm<big_endian>::Relocate::relocate_tls(
target->got_plt_section()->address() + got_offset;
// Relocate the field with the PC relative offset of the GOT entry.
RelocFuncs::pcrel32(view, got_entry, address);
RelocFuncs::pcrel32_unaligned(view, got_entry, address);
return ArmRelocFuncs::STATUS_OKAY;
}
break;
@@ -9418,7 +9418,7 @@ Target_arm<big_endian>::Relocate::relocate_tls(
// need to add TCB size to the offset.
Arm_address aligned_tcb_size =
align_address(ARM_TCB_SIZE, tls_segment->maximum_alignment());
RelocFuncs::rel32(view, value + aligned_tcb_size);
RelocFuncs::rel32_unaligned(view, value + aligned_tcb_size);
}
return ArmRelocFuncs::STATUS_OKAY;