[ELF] Make section member orders consistent
[llvm-project.git] / lld / test / ELF / ppc64-reloc-got-pcrel34.s
blob24265aacb4426dc49aa88e2dccdb81eb3fffb572
1 # REQUIRES: ppc
2 # RUN: echo 'SECTIONS { \
3 # RUN: .text_low 0x10010000: { *(.text_low) } \
4 # RUN: .text_high 0x10080000 : { *(.text_high) } \
5 # RUN: }' > %t.script
7 # RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t.o
8 # RUN: ld.lld -T %t.script --shared %t.o -o %t
9 # RUN: llvm-readelf -s %t | FileCheck %s --check-prefix=SYMBOL
10 # RUN: llvm-readelf -r %t | FileCheck %s --check-prefix=RELA
11 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
13 # RUN: llvm-mc -filetype=obj -triple=powerpc64 %s -o %t.o
14 # RUN: ld.lld -T %t.script --shared %t.o -o %t
15 # RUN: llvm-readelf -s %t | FileCheck %s --check-prefix=SYMBOL
16 # RUN: llvm-readelf -r %t | FileCheck %s --check-prefix=RELA
17 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
19 .text
20 .section .text_low, "ax", %progbits
21 # CHECK-LABEL: <GlobIntPCRel>:
22 # CHECK-NEXT: pld 3, 458952(0), 1
23 # CHECK-NEXT: lwa 3, 0(3)
25 # SYMBOL: Symbol table '.dynsym' contains 4 entries:
26 # SYMBOL: 00000000 0 NOTYPE GLOBAL DEFAULT UND glob_int
27 # RELA: 100800c8 0000000100000014 R_PPC64_GLOB_DAT 0000000000000000 glob_int + 0
28 GlobIntPCRel:
29 pld 3, glob_int@got@PCREL(0), 1
30 lwa 3, 0(3)
31 blr
33 # CHECK-LABEL: <GlobIntPCRelOffset>:
34 # CHECK-NEXT: pld 3, 458944(0), 1
35 # CHECK-NEXT: lwa 3, 8(3)
36 # SYMBOL: 00000000 0 NOTYPE GLOBAL DEFAULT UND glob_int8
37 # RELA: 100800d0 0000000200000014 R_PPC64_GLOB_DAT 0000000000000000 glob_int8 + 0
38 GlobIntPCRelOffset:
39 pld 3, glob_int8@got@PCREL(0), 1
40 lwa 3, 8(3)
41 blr
43 # CHECK-LABEL: <GlobIntPCRelBigOffset>:
44 # CHECK-NEXT: pld 3, 216(0), 1
45 # CHECK-NEXT: lwa 3, 64(3)
46 # SYMBOL: 00000000 0 NOTYPE GLOBAL DEFAULT UND glob_int8_big
47 # RELA: 100800d8 0000000300000014 R_PPC64_GLOB_DAT 0000000000000000 glob_int8_big + 0
49 ## Note that the first entry of the .got[0] should always be .TOC.
50 # SYMBOL: Symbol table '.symtab' contains 8 entries:
51 # SYMBOL: 1: 0000000010010000 0 NOTYPE LOCAL DEFAULT 6 GlobIntPCRel
52 # SYMBOL: 2: 0000000010010010 0 NOTYPE LOCAL DEFAULT 6 GlobIntPCRelOffset
53 # SYMBOL: 3: 0000000010080000 0 NOTYPE LOCAL DEFAULT 7 GlobIntPCRelBigOffset
54 .section .text_high, "ax", %progbits
55 GlobIntPCRelBigOffset:
56 pld 3, glob_int8_big@got@PCREL(0), 1
57 lwa 3, 64(3)
58 blr