Skip to content

Commit

Permalink
[ELF,test] Fix FileCheck prefixes
Browse files Browse the repository at this point in the history
Most violations are stale and should be removed while a few can be
adjusted.

Reported at llvm#92238
  • Loading branch information
MaskRay committed May 15, 2024
1 parent 5ff6c65 commit aa889d7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 29 deletions.
2 changes: 1 addition & 1 deletion lld/test/ELF/arm-exidx-shared.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: llvm-mc -filetype=obj -arm-add-build-attributes -triple=armv7a-none-linux-gnueabi %s -o %t
// RUN: ld.lld --hash-style=sysv %t --shared -o %t2
// RUN: llvm-readobj --relocations %t2 | FileCheck %s
// RUN: llvm-objdump -s --triple=armv7a-none-linux-gnueabi %t2 | FileCheck --check-prefix=CHECK-EXTAB-NEXT %s
// RUN: llvm-objdump -s --triple=armv7a-none-linux-gnueabi %t2 | FileCheck --check-prefix=CHECK-EXTAB %s

// Check that the relative R_ARM_PREL31 relocation can access a PLT entry
// for when the personality routine is referenced from a shared library.
Expand Down
10 changes: 0 additions & 10 deletions lld/test/ELF/mips-tls-hilo.s
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@
# CHECK-NEXT: ]
# CHECK-NOT: Primary GOT

# SO: Relocations [
# SO-NEXT: ]
# SO: Primary GOT {
# SO: Local entries [
# SO-NEXT: ]
# SO-NEXT: Global entries [
# SO-NEXT: ]
# SO-NEXT: Number of TLS and multi-GOT entries: 0
# SO-NEXT: }

.text
.globl __start
.type __start,@function
Expand Down
3 changes: 2 additions & 1 deletion lld/test/ELF/ppc32-reloc-rel.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# RUN: llvm-mc -filetype=obj -triple=powerpcle %s -o %t.le.o
# RUN: ld.lld %t.le.o -o %t
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
# RUN: llvm-objdump -s %t | FileCheck %s --check-prefix=HEX

.section .R_PPC_REL14,"ax",@progbits
beq 1f
Expand All @@ -23,7 +24,7 @@
.long 1f - .
1:
# HEX-LABEL: section .R_PPC_REL32:
# HEX-NEXT: 10010008 00000004
# HEX-NEXT: 04000000

.section .R_PPC_PLTREL24,"ax",@progbits
b 1f@PLT+32768
Expand Down
5 changes: 0 additions & 5 deletions lld/test/ELF/ppc64-pcrel-call-to-extern.s
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@

## DT_PLTGOT points to .plt
# SEC: .plt NOBITS 0000000010030168 040168 000028 00 WA 0 0 8
# SEC-OG: .plt NOBITS 0000000010030158 040158 000028 00 WA 0 0 8
# SEC: 0x0000000000000003 (PLTGOT) 0x10030168
# SEC-OG: 0x0000000000000003 (PLTGOT) 0x10030168

## DT_PLTGOT points to .plt
# SEC-NOP10: .plt NOBITS 0000000010030168 040168 000028 00 WA 0 0 8
Expand All @@ -86,11 +84,8 @@
## Check that we emit 3 R_PPC64_JMP_SLOT in .rela.plt.
# REL: .rela.plt {
# REL-NEXT: 0x10030178 R_PPC64_JMP_SLOT callee_global_stother0 0x0
# REL-NEXT-OG: 0x10030168 R_PPC64_JMP_SLOT callee_global_stother0 0x0
# REL-NEXT: 0x10030180 R_PPC64_JMP_SLOT callee_global_stother1 0x0
# REL-NEXT-OG: 0x10030170 R_PPC64_JMP_SLOT callee_global_stother1 0x0
# REL-NEXT: 0x10030188 R_PPC64_JMP_SLOT callee_global_TOC 0x0
# REL-NEXT-OG: 0x10030178 R_PPC64_JMP_SLOT callee_global_TOC 0x0
# REL-NEXT: }

# REL-NOP10: .rela.plt {
Expand Down
13 changes: 5 additions & 8 deletions lld/test/ELF/ppc64-toc-relax-ifunc.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# RUN: echo '.globl ifunc; .type ifunc, %gnu_indirect_function; ifunc:' | \
# RUN: llvm-mc -filetype=obj -triple=powerpc64le - -o %t1.o
# RUN: ld.lld %t.o %t1.o -o %t
# RUN: llvm-readelf -S -s %t | FileCheck --check-prefix=SEC %s
# RUN: llvm-readelf -Ssr %t | FileCheck --check-prefix=SEC %s
# RUN: llvm-readelf -x .toc %t | FileCheck --check-prefix=HEX %s
# RUN: llvm-objdump -d %t | FileCheck --check-prefix=DIS %s

Expand All @@ -13,18 +13,15 @@
## still perform toc-indirect to toc-relative relaxation because the distance
## to the address of the canonical PLT is fixed.

# SEC: .text PROGBITS 00000000100101e0
# SEC: .plt NOBITS 0000000010030200
# SEC: 00000000100101e8 0 FUNC GLOBAL DEFAULT 3 ifunc
# SEC: .text PROGBITS [[#%x,TEXT:]]
# SEC: .plt NOBITS [[#%x,PLT:]]
# SEC: {{0*}}[[#PLT]] {{.+}} R_PPC64_IRELATIVE [[#TEXT+8]]
# SEC: {{0*}}[[#TEXT+8]] 0 FUNC GLOBAL DEFAULT 3 ifunc

## .toc[0] stores the address of the canonical PLT.
# HEX: section '.toc':
# HEX-NEXT: 0x100201f8 e8010110 00000000

# REL: .rela.dyn {
# REL-NEXT: 0x100301f8 R_PPC64_IRELATIVE - 0x100101e8
# REL-NEXT: }

# DIS: addi 3, 3,

addis 3, 2, .toc@toc@ha
Expand Down
4 changes: 0 additions & 4 deletions lld/test/ELF/riscv-gp.s
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
# SEC64: [ [[#SDATA:]]] .sdata PROGBITS {{0*}}000032e0
# SEC64: {{0*}}00003ae0 0 NOTYPE GLOBAL DEFAULT [[#SDATA]] __global_pointer$

## __global_pointer$ - 0x1000 = 4096*3-2048
# DIS: 1000: auipc gp, 3
# DIS-NEXT: addi gp, gp, -2048

# ERR: error: relocation R_RISCV_PCREL_HI20 cannot be used against symbol '__global_pointer$'; recompile with -fPIC

## -r mode does not define __global_pointer$.
Expand Down

0 comments on commit aa889d7

Please sign in to comment.