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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 18:05:37 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rLLD323843: [LLD] Use Rela on PowerPC too (authored by ruiu, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D40826?vs=130799&id=132090#toc

Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D40826

Files:
  ELF/Driver.cpp
  test/ELF/ppc-rela.s


Index: test/ELF/ppc-rela.s
===================================================================
--- test/ELF/ppc-rela.s
+++ test/ELF/ppc-rela.s
@@ -0,0 +1,11 @@
+# REQUIRES: ppc
+# RUN: llvm-mc -filetype=obj -triple=powerpc-unknown-freebsd %s -o %t
+# RUN: ld.lld %t -o %t2 -shared
+# RUN: llvm-readobj -r %t2 | FileCheck %s
+
+.data
+  .long foo
+
+// CHECK:      Section ({{.*}}) .rela.dyn {
+// CHECK-NEXT:   0x1000 R_PPC_ADDR32 foo 0x0
+// CHECK-NEXT: }
Index: ELF/Driver.cpp
===================================================================
--- ELF/Driver.cpp
+++ ELF/Driver.cpp
@@ -806,7 +806,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.132090.patch
Type: text/x-patch
Size: 1029 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180131/2114c213/attachment.bin>


More information about the llvm-commits mailing list