From 9b0b7813955e618cf57335d5d107300d3cd3be64 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 4 Jan 2013 19:08:13 +0000 Subject: 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. llvm-svn: 171506 --- llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp') diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp index f32e3871b82..efb34df8c56 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp @@ -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(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(Value - FinalAddress + Addend); -- cgit v1.2.3