[ELF] Make SyntheticSection parameter order match InputSection
[llvm-project.git] / lld / test / ELF / ppc32-reloc-got.s
blob1c7fdfda17c2f1992ddf5d6fe7f249d923dc7b41
1 # REQUIRES: ppc
2 # RUN: llvm-mc -filetype=obj -triple=powerpc %s -o %t.o
3 # RUN: echo '.globl b; b:' | llvm-mc -filetype=obj -triple=powerpc - -o %t1.o
4 # RUN: ld.lld -shared %t1.o -soname=t1.so -o %t1.so
6 # RUN: ld.lld %t.o %t1.so -o %t
7 # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
8 # RUN: llvm-nm %t | FileCheck --check-prefix=NM %s
9 # RUN: llvm-readobj -x .got %t | FileCheck --check-prefix=HEX %s
10 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
12 ## Check we can handle R_PPC_GOT16, which may be generated by -fpic code.
14 # RELOC: .rela.dyn {
15 # RELOC-NEXT: 0x10020218 R_PPC_GLOB_DAT b 0x0
16 # RELOC-NEXT: }
18 # NM: 1002020c d _GLOBAL_OFFSET_TABLE_
19 # NM: 10030220 d a
21 ## The GOT slot of a can be filled at link time.
22 # HEX: section '.got':
23 # HEX: 0x1002020c [[#%x,]] 00000000 00000000 00000000
24 # HEX-NEXT: 0x1002021c 10030220
26 ## a: &.got[4] - _GLOBAL_OFFSET_TABLE_ = 0x1002021c - 0x1002020c = 16
27 ## b: &.got[3] - _GLOBAL_OFFSET_TABLE_ = 0x10020218 - 0x1002020c = 12
28 # CHECK: lwz 3, 16(30)
29 # CHECK: lwz 4, 12(30)
31 lwz 3,a@got(30)
32 lwz 4,b@got(30)
34 .data
36 .long _GLOBAL_OFFSET_TABLE_