[lld] r370313 - Merging r369184:
Hans Wennborg via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 29 02:21:39 PDT 2019
Author: hans
Date: Thu Aug 29 02:21:39 2019
New Revision: 370313
URL: http://llvm.org/viewvc/llvm-project?rev=370313&view=rev
Log:
Merging r369184:
------------------------------------------------------------------------
r369184 | maskray | 2019-08-17 08:28:03 +0200 (Sat, 17 Aug 2019) | 9 lines
[ELF][PPC] Fix getRelExpr for R_PPC64_REL16_HI
Fixes https://github.com/ClangBuiltLinux/linux/issues/640
R_PPC64_REL16_HI was incorrectly computed as an R_ABS relocation.
rLLD368964 made it a linker failure. Change it to use R_PC to fix the
failures.
Add ppc64-reloc-rel.s for these R_PPC64_REL* tests.
------------------------------------------------------------------------
Added:
lld/branches/release_90/test/ELF/ppc64-reloc-rel.s
- copied unchanged from r369184, lld/trunk/test/ELF/ppc64-reloc-rel.s
Modified:
lld/branches/release_90/ (props changed)
lld/branches/release_90/ELF/Arch/PPC64.cpp
lld/branches/release_90/test/ELF/ppc64-relocs.s
Propchange: lld/branches/release_90/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug 29 02:21:39 2019
@@ -1 +1 @@
-/lld/trunk:366445,366447,366500,366504,366573,366780,366784,366836,367836-367837,368041,368078,368145,368964,369445,369694
+/lld/trunk:366445,366447,366500,366504,366573,366780,366784,366836,367836-367837,368041,368078,368145,368964,369184,369445,369694
Modified: lld/branches/release_90/ELF/Arch/PPC64.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_90/ELF/Arch/PPC64.cpp?rev=370313&r1=370312&r2=370313&view=diff
==============================================================================
--- lld/branches/release_90/ELF/Arch/PPC64.cpp (original)
+++ lld/branches/release_90/ELF/Arch/PPC64.cpp Thu Aug 29 02:21:39 2019
@@ -569,6 +569,7 @@ RelExpr PPC64::getRelExpr(RelType type,
return R_PPC64_CALL_PLT;
case R_PPC64_REL16_LO:
case R_PPC64_REL16_HA:
+ case R_PPC64_REL16_HI:
case R_PPC64_REL32:
case R_PPC64_REL64:
return R_PC;
Modified: lld/branches/release_90/test/ELF/ppc64-relocs.s
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_90/test/ELF/ppc64-relocs.s?rev=370313&r1=370312&r2=370313&view=diff
==============================================================================
--- lld/branches/release_90/test/ELF/ppc64-relocs.s (original)
+++ lld/branches/release_90/test/ELF/ppc64-relocs.s Thu Aug 29 02:21:39 2019
@@ -18,16 +18,9 @@ _start:
li 3,42
sc
-.section .rodata,"a", at progbits
- .p2align 2
-.LJTI0_0:
- .long .LBB0_2-.LJTI0_0
-
-.section .toc,"aw", at progbits
+.section .toc,"aw", at progbits
.L1:
-.quad 22, 37, 89, 47
-.LC0:
- .tc .LJTI0_0[TC],.LJTI0_0
+ .quad 22, 37, 89, 47
.section .R_PPC64_TOC16_LO_DS,"ax", at progbits
ld 1, .L1 at toc@l(2)
@@ -53,91 +46,47 @@ _start:
# CHECK-LABEL: Disassembly of section .R_PPC64_TOC16_HA:
# CHECK: 10010018: addis 1, 2, 0
-.section .R_PPC64_REL24,"ax", at progbits
- b 1f
-1:
-
-# CHECK-LABEL: Disassembly of section .R_PPC64_REL24:
-# CHECK: 1001001c: b .+4
-
-.section .R_PPC64_REL14,"ax", at progbits
- beq 1f
-1:
-
-# CHECK-LABEL: Disassembly of section .R_PPC64_REL14:
-# CHECK: 10010020: bt 2, .+4
-
.section .R_PPC64_ADDR16_LO,"ax", at progbits
li 1, .Lfoo at l
# CHECK-LABEL: Disassembly of section .R_PPC64_ADDR16_LO:
-# CHECK: 10010024: li 1, 0
+# CHECK: li 1, 0
.section .R_PPC64_ADDR16_HI,"ax", at progbits
li 1, .Lfoo at h
# CHECK-LABEL: Disassembly of section .R_PPC64_ADDR16_HI:
-# CHECK: 10010028: li 1, 4097
+# CHECK: li 1, 4097
.section .R_PPC64_ADDR16_HA,"ax", at progbits
li 1, .Lfoo at ha
# CHECK-LABEL: Disassembly of section .R_PPC64_ADDR16_HA:
-# CHECK: 1001002c: li 1, 4097
+# CHECK: li 1, 4097
.section .R_PPC64_ADDR16_HIGHER,"ax", at progbits
li 1, .Lfoo at higher
# CHECK-LABEL: Disassembly of section .R_PPC64_ADDR16_HIGHER:
-# CHECK: 10010030: li 1, 0
+# CHECK: li 1, 0
.section .R_PPC64_ADDR16_HIGHERA,"ax", at progbits
li 1, .Lfoo at highera
# CHECK-LABEL: Disassembly of section .R_PPC64_ADDR16_HIGHERA:
-# CHECK: 10010034: li 1, 0
+# CHECK: li 1, 0
.section .R_PPC64_ADDR16_HIGHEST,"ax", at progbits
li 1, .Lfoo at highest
# CHECK-LABEL: Disassembly of section .R_PPC64_ADDR16_HIGHEST:
-# CHECK: 10010038: li 1, 0
+# CHECK: li 1, 0
.section .R_PPC64_ADDR16_HIGHESTA,"ax", at progbits
li 1, .Lfoo at highesta
# CHECK-LABEL: Disassembly of section .R_PPC64_ADDR16_HIGHESTA:
-# CHECK: 1001003c: li 1, 0
-
-.section .R_PPC64_REL32, "ax", at progbits
- addis 5, 2, .LC0 at toc@ha
- ld 5, .LC0 at toc@l(5)
-.LBB0_2:
- add 3, 3, 4
-
-# DATALE: '.rodata':
-# DATALE: 0x100001c8 80fe0000
-
-# DATABE: '.rodata':
-# DATABE: 0x100001c8 0000fe80
-
-# Address of rodata + value stored at rodata entry
-# should equal address of LBB0_2.
-# 0x10000190 + 0xfeb4 = 0x10010044
-# CHECK-LABEL: Disassembly of section .R_PPC64_REL32:
-# CHECK: 10010040: addis 5, 2, 0
-# CHECK: 10010044: ld 5, -32736(5)
-# CHECK: 10010048: add 3, 3, 4
-
-.section .R_PPC64_REL64, "ax", at progbits
- .cfi_startproc
- .cfi_personality 148, __foo
- li 0, 1
- li 3, 55
- sc
- .cfi_endproc
-__foo:
- li 3,0
+# CHECK: li 1, 0
.section .R_PPC64_TOC,"a", at progbits
.quad .TOC. at tocbase
@@ -150,15 +99,3 @@ __foo:
# DATABE-LABEL: section '.R_PPC64_TOC':
# DATABE: 00000000 10028000
-
-# Check that the personality (relocated by R_PPC64_REL64) in the .eh_frame
-# equals the address of __foo.
-# 0x100001ea + 0xfe6e = 0x10010058
-# DATALE: section '.eh_frame':
-# DATALE: 0x100001e8 {{....}}6efe
-
-# DATABE: section '.eh_frame':
-# DATABE: 0x100001e8 {{[0-9a-f]+ [0-9a-f]+}} fe6e{{....}}
-
-# CHECK: __foo
-# CHECK-NEXT: 10010058: li 3, 0
More information about the llvm-commits
mailing list