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 22// RUN: llvm-mc -filetype=obj -arm-add-build-attributes -triple=armv7a-none-linux-gnueabi %s -o %t
33// RUN: ld.lld --hash-style=sysv %t --shared -o %t2
44// 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
66
77// Check that the relative R_ARM_PREL31 relocation can access a PLT entry
88// for when the personality routine is referenced from a shared library.
Original file line number Diff line number Diff line change 2828# CHECK-NEXT: ]
2929# CHECK-NOT: Primary GOT
3030
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-
4131 .text
4232 .globl __start
4333 .type __start,@function
Original file line number Diff line number Diff line change 66# RUN: llvm-mc -filetype=obj -triple=powerpcle %s -o %t.le.o
77# RUN: ld.lld %t.le.o -o %t
88# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
9+ # RUN: llvm-objdump -s %t | FileCheck %s --check-prefix=HEX
910
1011.section .R_PPC_REL14,"ax" ,@progbits
1112 beq 1f
2324 .long 1f - .
24251:
2526# HEX-LABEL: section .R_PPC_REL32:
26- # HEX-NEXT: 10010008 00000004
27+ # HEX-NEXT: 04000000
2728
2829.section .R_PPC_PLTREL24,"ax" ,@progbits
2930 b 1f@PLT+32768
Original file line number Diff line number Diff line change 7373
7474## DT_PLTGOT points to .plt
7575# SEC: .plt NOBITS 0000000010030168 040168 000028 00 WA 0 0 8
76- # SEC-OG: .plt NOBITS 0000000010030158 040158 000028 00 WA 0 0 8
7776# SEC: 0x0000000000000003 (PLTGOT) 0x10030168
78- # SEC-OG: 0x0000000000000003 (PLTGOT) 0x10030168
7977
8078## DT_PLTGOT points to .plt
8179# SEC-NOP10: .plt NOBITS 0000000010030168 040168 000028 00 WA 0 0 8
8684## Check that we emit 3 R_PPC64_JMP_SLOT in .rela.plt.
8785# REL: .rela.plt {
8886# REL-NEXT: 0x10030178 R_PPC64_JMP_SLOT callee_global_stother0 0x0
89- # REL-NEXT-OG: 0x10030168 R_PPC64_JMP_SLOT callee_global_stother0 0x0
9087# REL-NEXT: 0x10030180 R_PPC64_JMP_SLOT callee_global_stother1 0x0
91- # REL-NEXT-OG: 0x10030170 R_PPC64_JMP_SLOT callee_global_stother1 0x0
9288# REL-NEXT: 0x10030188 R_PPC64_JMP_SLOT callee_global_TOC 0x0
93- # REL-NEXT-OG: 0x10030178 R_PPC64_JMP_SLOT callee_global_TOC 0x0
9489# REL-NEXT: }
9590
9691# REL-NOP10: .rela.plt {
Original file line number Diff line number Diff line change 44# RUN: echo '.globl ifunc; .type ifunc, %gnu_indirect_function; ifunc:' | \
55# RUN: llvm-mc -filetype=obj -triple=powerpc64le - -o %t1.o
66# 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
88# RUN: llvm-readelf -x .toc %t | FileCheck --check-prefix=HEX %s
99# RUN: llvm-objdump -d %t | FileCheck --check-prefix=DIS %s
1010
1313## still perform toc-indirect to toc-relative relaxation because the distance
1414## to the address of the canonical PLT is fixed.
1515
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
1920
2021## .toc[0] stores the address of the canonical PLT.
2122# HEX: section '.toc':
2223# HEX-NEXT: 0x100201f8 e8010110 00000000
2324
24- # REL: .rela.dyn {
25- # REL-NEXT: 0x100301f8 R_PPC64_IRELATIVE - 0x100101e8
26- # REL-NEXT: }
27-
2825# DIS: addi 3, 3,
2926
3027addis 3 , 2 , .toc@toc@ha
Original file line number Diff line number Diff line change 1616# SEC64: [ [[#SDATA:]]] .sdata PROGBITS {{0*}}000032e0
1717# SEC64: {{0*}}00003ae0 0 NOTYPE GLOBAL DEFAULT [[#SDATA]] __global_pointer$
1818
19- ## __global_pointer$ - 0x1000 = 4096*3-2048
20- # DIS: 1000: auipc gp, 3
21- # DIS-NEXT: addi gp, gp, -2048
22-
2319# ERR: error: relocation R_RISCV_PCREL_HI20 cannot be used against symbol '__global_pointer$'; recompile with -fPIC
2420
2521## -r mode does not define __global_pointer$.
You can’t perform that action at this time.
0 commit comments