[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / ppc32-relocatable-got2.s
blob85a0764ffe5afcb77ab07198e0b04bbb21d05b99
1 # REQUIRES: ppc
2 ## Test addend adjustment of R_PPC_PLTREL24 when copying relocations.
3 ## If r_addend indicates .got2, adjust it by the local .got2's output section offset.
5 # RUN: llvm-mc -filetype=obj -triple=powerpc %s -o %t.o
6 # RUN: echo 'bl f+0x8000@plt' | llvm-mc -filetype=obj -triple=powerpc - -o %t2.o
7 # RUN: ld.lld -r %t.o %t.o %t2.o -o %t
8 # RUN: llvm-readobj -r %t | FileCheck %s
10 # RUN: ld.lld -shared --emit-relocs %t.o %t.o %t2.o -o %t.so
11 # RUN: llvm-readobj -r %t.so | FileCheck %s
13 # CHECK: .rela.adjust {
14 # CHECK-NEXT: R_PPC_REL16_HA .got2 0x8002
15 # CHECK-NEXT: R_PPC_REL16_LO .got2 0x8006
16 # CHECK-NEXT: R_PPC_PLTREL24 foo 0x8000
17 # CHECK-NEXT: R_PPC_PLTREL24 bar 0x8000
18 # CHECK-NEXT: R_PPC_REL16_HA .got2 0x8006
19 # CHECK-NEXT: R_PPC_REL16_LO .got2 0x800A
20 # CHECK-NEXT: R_PPC_PLTREL24 foo 0x8004
21 # CHECK-NEXT: R_PPC_PLTREL24 bar 0x8004
22 # CHECK-NEXT: }
23 # CHECK-NEXT: .rela.no_adjust {
24 # CHECK-NEXT: R_PPC_PLTREL24 foo 0x0
25 # CHECK-NEXT: R_PPC_PLTREL24 foo 0x0
26 # CHECK-NEXT: }
27 ## %t2.o has an invalid relocation with r_addend=0x8000. Test we don't crash.
28 ## The addend doesn't matter.
29 # CHECK-NEXT: .rela.text {
30 # CHECK-NEXT: R_PPC_PLTREL24 f 0x8000
31 # CHECK-NEXT: }
32 .section .got2,"aw"
33 .long 0
35 .section .adjust,"ax"
36 bcl 20,30,.L0
37 .L0:
38 addis 30,30,.got2+0x8000-.L0@ha
39 addi 30,30,.got2+0x8000-.L0@l
41 ## Refers to .got2+addend, adjust.
42 bl foo+0x8000@plt
43 bl bar+0x8000@plt
45 .section .no_adjust,"ax"
46 ## Refers to .got, no adjustment.
47 bl foo@plt