File tree Expand file tree Collapse file tree 6 files changed +8
-29
lines changed Expand file tree Collapse file tree 6 files changed +8
-29
lines changed Original file line number Diff line number Diff line change 2
2
// RUN: llvm-mc -filetype=obj -arm-add-build-attributes -triple=armv7a-none-linux-gnueabi %s -o %t
3
3
// RUN: ld.lld --hash-style=sysv %t --shared -o %t2
4
4
// RUN: llvm-readobj --relocations %t2 | FileCheck %s
5
- // RUN: llvm-objdump -s --triple=armv7a-none-linux-gnueabi %t2 | FileCheck --check-prefix=CHECK-EXTAB-NEXT %s
5
+ // RUN: llvm-objdump -s --triple=armv7a-none-linux-gnueabi %t2 | FileCheck --check-prefix=CHECK-EXTAB %s
6
6
7
7
// Check that the relative R_ARM_PREL31 relocation can access a PLT entry
8
8
// for when the personality routine is referenced from a shared library.
Original file line number Diff line number Diff line change 28
28
# CHECK-NEXT: ]
29
29
# CHECK-NOT: Primary GOT
30
30
31
- # SO: Relocations [
32
- # SO-NEXT: ]
33
- # SO: Primary GOT {
34
- # SO: Local entries [
35
- # SO-NEXT: ]
36
- # SO-NEXT: Global entries [
37
- # SO-NEXT: ]
38
- # SO-NEXT: Number of TLS and multi-GOT entries: 0
39
- # SO-NEXT: }
40
-
41
31
.text
42
32
.globl __start
43
33
.type __start,@function
Original file line number Diff line number Diff line change 6
6
# RUN: llvm-mc -filetype=obj -triple=powerpcle %s -o %t.le.o
7
7
# RUN: ld.lld %t.le.o -o %t
8
8
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
9
+ # RUN: llvm-objdump -s %t | FileCheck %s --check-prefix=HEX
9
10
10
11
.section .R_PPC_REL14,"ax" ,@progbits
11
12
beq 1f
23
24
.long 1f - .
24
25
1:
25
26
# HEX-LABEL: section .R_PPC_REL32:
26
- # HEX-NEXT: 10010008 00000004
27
+ # HEX-NEXT: 04000000
27
28
28
29
.section .R_PPC_PLTREL24,"ax" ,@progbits
29
30
b 1f@PLT+32768
Original file line number Diff line number Diff line change 73
73
74
74
## DT_PLTGOT points to .plt
75
75
# SEC: .plt NOBITS 0000000010030168 040168 000028 00 WA 0 0 8
76
- # SEC-OG: .plt NOBITS 0000000010030158 040158 000028 00 WA 0 0 8
77
76
# SEC: 0x0000000000000003 (PLTGOT) 0x10030168
78
- # SEC-OG: 0x0000000000000003 (PLTGOT) 0x10030168
79
77
80
78
## DT_PLTGOT points to .plt
81
79
# SEC-NOP10: .plt NOBITS 0000000010030168 040168 000028 00 WA 0 0 8
86
84
## Check that we emit 3 R_PPC64_JMP_SLOT in .rela.plt.
87
85
# REL: .rela.plt {
88
86
# REL-NEXT: 0x10030178 R_PPC64_JMP_SLOT callee_global_stother0 0x0
89
- # REL-NEXT-OG: 0x10030168 R_PPC64_JMP_SLOT callee_global_stother0 0x0
90
87
# REL-NEXT: 0x10030180 R_PPC64_JMP_SLOT callee_global_stother1 0x0
91
- # REL-NEXT-OG: 0x10030170 R_PPC64_JMP_SLOT callee_global_stother1 0x0
92
88
# REL-NEXT: 0x10030188 R_PPC64_JMP_SLOT callee_global_TOC 0x0
93
- # REL-NEXT-OG: 0x10030178 R_PPC64_JMP_SLOT callee_global_TOC 0x0
94
89
# REL-NEXT: }
95
90
96
91
# REL-NOP10: .rela.plt {
Original file line number Diff line number Diff line change 4
4
# RUN: echo '.globl ifunc; .type ifunc, %gnu_indirect_function; ifunc:' | \
5
5
# RUN: llvm-mc -filetype=obj -triple=powerpc64le - -o %t1.o
6
6
# RUN: ld.lld %t.o %t1.o -o %t
7
- # RUN: llvm-readelf -S -s %t | FileCheck --check-prefix=SEC %s
7
+ # RUN: llvm-readelf -Ssr %t | FileCheck --check-prefix=SEC %s
8
8
# RUN: llvm-readelf -x .toc %t | FileCheck --check-prefix=HEX %s
9
9
# RUN: llvm-objdump -d %t | FileCheck --check-prefix=DIS %s
10
10
13
13
## still perform toc-indirect to toc-relative relaxation because the distance
14
14
## to the address of the canonical PLT is fixed.
15
15
16
- # SEC: .text PROGBITS 00000000100101e0
17
- # SEC: .plt NOBITS 0000000010030200
18
- # SEC: 00000000100101e8 0 FUNC GLOBAL DEFAULT 3 ifunc
16
+ # SEC: .text PROGBITS [[#%x,TEXT:]]
17
+ # SEC: .plt NOBITS [[#%x,PLT:]]
18
+ # SEC: {{0*}}[[#PLT]] {{.+}} R_PPC64_IRELATIVE [[#TEXT+8]]
19
+ # SEC: {{0*}}[[#TEXT+8]] 0 FUNC GLOBAL DEFAULT 3 ifunc
19
20
20
21
## .toc[0] stores the address of the canonical PLT.
21
22
# HEX: section '.toc':
22
23
# HEX-NEXT: 0x100201f8 e8010110 00000000
23
24
24
- # REL: .rela.dyn {
25
- # REL-NEXT: 0x100301f8 R_PPC64_IRELATIVE - 0x100101e8
26
- # REL-NEXT: }
27
-
28
25
# DIS: addi 3, 3,
29
26
30
27
addis 3 , 2 , .toc@toc@ha
Original file line number Diff line number Diff line change 16
16
# SEC64: [ [[#SDATA:]]] .sdata PROGBITS {{0*}}000032e0
17
17
# SEC64: {{0*}}00003ae0 0 NOTYPE GLOBAL DEFAULT [[#SDATA]] __global_pointer$
18
18
19
- ## __global_pointer$ - 0x1000 = 4096*3-2048
20
- # DIS: 1000: auipc gp, 3
21
- # DIS-NEXT: addi gp, gp, -2048
22
-
23
19
# ERR: error: relocation R_RISCV_PCREL_HI20 cannot be used against symbol '__global_pointer$'; recompile with -fPIC
24
20
25
21
## -r mode does not define __global_pointer$.
You can’t perform that action at this time.
0 commit comments