mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
PowerPC: Fix eh_frame relocation for PIC
This patch fixes the PPC eh_frame definitions for the personality and frame unwinding for PIC objects. It makes PIC build correctly creates relative relocations in the '.rela.eh_frame' segments and thus avoiding a text relocation that generates a DT_TEXTREL segments in link phase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171506 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -517,6 +517,12 @@ void RuntimeDyldELF::resolvePPC64Relocation(const SectionEntry &Section,
|
||||
uint8_t aalk = *(LocalAddress+3);
|
||||
writeInt16BE(LocalAddress + 2, (aalk & 3) | ((Value + Addend) & 0xfffc));
|
||||
} break;
|
||||
case ELF::R_PPC64_ADDR32 : {
|
||||
int32_t Result = static_cast<int32_t>(Value + Addend);
|
||||
if (SignExtend32<32>(Result) != Result)
|
||||
llvm_unreachable("Relocation R_PPC64_REL32 overflow");
|
||||
writeInt32BE(LocalAddress, Result);
|
||||
} break;
|
||||
case ELF::R_PPC64_REL24 : {
|
||||
uint64_t FinalAddress = (Section.LoadAddress + Offset);
|
||||
int32_t delta = static_cast<int32_t>(Value - FinalAddress + Addend);
|
||||
|
Reference in New Issue
Block a user