[PATCH] D46766: [ELF][PPC64] Fix getRelExpr for R_PPC64_REL64

Zaara Syeda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 14 09:43:31 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL332259: [ELF][PPC64] Fix getRelExpr for R_PPC64_REL64 (authored by syzaara, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D46766?vs=146378&id=146634#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D46766

Files:
  lld/trunk/ELF/Arch/PPC64.cpp
  lld/trunk/test/ELF/ppc64-relocs.s


Index: lld/trunk/ELF/Arch/PPC64.cpp
===================================================================
--- lld/trunk/ELF/Arch/PPC64.cpp
+++ lld/trunk/ELF/Arch/PPC64.cpp
@@ -164,6 +164,7 @@
   case R_PPC64_REL16_LO:
   case R_PPC64_REL16_HA:
   case R_PPC64_REL32:
+  case R_PPC64_REL64:
     return R_PC;
   default:
     return R_ABS;
Index: lld/trunk/test/ELF/ppc64-relocs.s
===================================================================
--- lld/trunk/test/ELF/ppc64-relocs.s
+++ lld/trunk/test/ELF/ppc64-relocs.s
@@ -2,12 +2,12 @@
 
 # RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t
 # RUN: ld.lld %t -o %t2
-# RUN: llvm-objdump -D %t2 | FileCheck %s --check-prefix=rodataLE
+# RUN: llvm-objdump -D %t2 | FileCheck %s --check-prefix=DATALE
 # RUN: llvm-objdump -D %t2 | FileCheck %s
 
 # RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t
 # RUN: ld.lld %t -o %t2
-# RUN: llvm-objdump -D %t2 | FileCheck %s --check-prefix=rodataBE
+# RUN: llvm-objdump -D %t2 | FileCheck %s --check-prefix=DATABE
 # RUN: llvm-objdump -D %t2 | FileCheck %s
 
 .text
@@ -147,13 +147,13 @@
 .LBB0_2:
   add 3, 3, 4
 
-# rodataLE: Disassembly of section .rodata:
-# rodataLE: .rodata:
-# rodataLE: 10000190: b4 fe 00 00
-
-# rodataBE: Disassembly of section .rodata:
-# rodataBE: .rodata:
-# rodataBE: 10000190: 00 00 fe b4
+# DATALE: Disassembly of section .rodata:
+# DATALE: .rodata:
+# DATALE: 10000190: b4 fe 00 00
+
+# DATABE: Disassembly of section .rodata:
+# DATABE: .rodata:
+# DATABE: 10000190: 00 00 fe b4
 
 # Address of rodata + value stored at rodata entry
 # should equal address of LBB0_2.
@@ -163,3 +163,31 @@
 # CHECK: 1001003c: {{.*}} addis 5, 2, -1
 # CHECK: 10010040: {{.*}} ld 5, -32736(5)
 # CHECK: 10010044: {{.*}} add 3, 3, 4
+
+.section .R_PPC64_REL64, "ax", at progbits
+.globl  .FR_PPC64_REL64
+.FR_PPC64_REL64:
+        .cfi_startproc
+        .cfi_personality 148, __foo
+        li 0, 1
+        li 3, 55
+        sc
+        .cfi_endproc
+__foo:
+  li 3,0
+
+# Check that address of eh_frame entry + value stored
+# should equal the address of foo. Since it is not aligned,
+# the entry is not stored exactly at 100001a8. It starts at
+# address 0x100001aa and has the value 0xfeaa.
+# 0x100001aa + 0xfeaa = 0x10010054
+# DATALE: Disassembly of section .eh_frame:
+# DATALE: .eh_frame:
+# DATALE: 100001a8: {{.*}} aa fe
+
+# DATABE: Disassembly of section .eh_frame:
+# DATABE: .eh_frame:
+# DATABE: 100001b0: fe aa {{.*}}
+
+# CHECK: __foo
+# CHECK-NEXT: 10010054: {{.*}} li 3, 0


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46766.146634.patch
Type: text/x-patch
Size: 2539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180514/721a5480/attachment.bin>


More information about the llvm-commits mailing list