[PATCH] D40826: [LLD] Use Rela on PowerPC too

Nicholas Allegra via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 21:50:40 PST 2017


comex created this revision.
Herald added subscribers: nemanjai, emaste.

The spec for ELF on PowerPC:
http://refspecs.linux-foundation.org/elf/elfspec_ppc.pdf
says:
"The PowerPC family uses only the Elf32_Rela relocation entries with explicit addends."

(EM_PPC64 should be covered by Config->Is64 already.)


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D40826

Files:
  ELF/Driver.cpp


Index: ELF/Driver.cpp
===================================================================
--- ELF/Driver.cpp
+++ ELF/Driver.cpp
@@ -793,7 +793,8 @@
   Config->Endianness =
       Config->IsLE ? support::endianness::little : support::endianness::big;
   Config->IsMips64EL = (Kind == ELF64LEKind && Machine == EM_MIPS);
-  Config->IsRela = Config->Is64 || IsX32 || Config->MipsN32Abi;
+  Config->IsRela = Config->Is64 || IsX32 || Config->MipsN32Abi ||
+                   Machine == EM_PPC;
   Config->Pic = Config->Pie || Config->Shared;
   Config->Wordsize = Config->Is64 ? 8 : 4;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40826.125464.patch
Type: text/x-patch
Size: 585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171205/2443d8c8/attachment.bin>


More information about the llvm-commits mailing list