[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / systemz-reloc-got.s
blob4b9ac16481f4cb78947c2cb402eab8f583c15e4d
1 # REQUIRES: systemz
2 # RUN: llvm-mc -filetype=obj -triple=s390x-unknown-linux %s -o %t.o
3 # RUN: ld.lld -z norelro -shared %t.o -soname=t.so -o %t.so
4 ## Note: Without norelro the distance between .got and .got.plt causes
5 ## R_390_GOTPLT12 relocations to always overflow.
7 # RUN: llvm-readelf -S -x .data %t.so | FileCheck %s
8 # RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s --check-prefix=DISASM
10 # CHECK: Section Headers:
11 # CHECK: .got PROGBITS 0000000000002458
12 # CHECK: .got.plt PROGBITS 0000000000002480
14 ## Note: _GLOBAL_OFFSET_TABLE is at .got
15 ## GOT (foo) is at .got + 24 == 0x2470
16 ## GOT (bar) is at .got + 32 == 0x2478
17 ## GOTPLT (foo) is at .got.plt + 0 == .got + 40 == 0x2480
18 ## GOTPLT (bar) is at .got.plt + 8 == .got + 48 == 0x2488
20 # DISASM: larl %r12, 0x2458
21 # DISASM-NEXT: larl %r1, 0x2470
22 # DISASM-NEXT: larl %r1, 0x2478
23 # DISASM-NEXT: larl %r1, 0x2480
24 # DISASM-NEXT: larl %r1, 0x2488
26 # DISASM-NEXT: l %r1, 24(%r12)
27 # DISASM-NEXT: l %r1, 32(%r12)
28 # DISASM-NEXT: l %r1, 40(%r12)
29 # DISASM-NEXT: l %r1, 48(%r12)
30 # DISASM-NEXT: lg %r1, 24(%r12)
31 # DISASM-NEXT: lg %r1, 32(%r12)
32 # DISASM-NEXT: lg %r1, 40(%r12)
33 # DISASM-NEXT: lg %r1, 48(%r12)
35 # CHECK: Hex dump of section '.data':
36 # CHECK-NEXT: 00180020 00280030 00000018 00000020
37 # CHECK-NEXT: 00000028 00000030 00000000 00000018
38 # CHECK-NEXT: 00000000 00000020 00000000 00000028
39 # CHECK-NEXT: 00000000 00000030
41 .text
42 larl %r12, _GLOBAL_OFFSET_TABLE_
43 .reloc .+2, R_390_GOTENT, foo+2
44 larl %r1, 0
45 .reloc .+2, R_390_GOTENT, bar+2
46 larl %r1, 0
47 .reloc .+2, R_390_GOTPLTENT, foo+2
48 larl %r1, 0
49 .reloc .+2, R_390_GOTPLTENT, bar+2
50 larl %r1, 0
51 .reloc .+2, R_390_GOT12, foo
52 l %r1, 0(%r12)
53 .reloc .+2, R_390_GOT12, bar
54 l %r1, 0(%r12)
55 .reloc .+2, R_390_GOTPLT12, foo
56 l %r1, 0(%r12)
57 .reloc .+2, R_390_GOTPLT12, bar
58 l %r1, 0(%r12)
59 .reloc .+2, R_390_GOT20, foo
60 lg %r1, 0(%r12)
61 .reloc .+2, R_390_GOT20, bar
62 lg %r1, 0(%r12)
63 .reloc .+2, R_390_GOTPLT20, foo
64 lg %r1, 0(%r12)
65 .reloc .+2, R_390_GOTPLT20, bar
66 lg %r1, 0(%r12)
68 .data
69 .reloc ., R_390_GOT16, foo
70 .space 2
71 .reloc ., R_390_GOT16, bar
72 .space 2
73 .reloc ., R_390_GOTPLT16, foo
74 .space 2
75 .reloc ., R_390_GOTPLT16, bar
76 .space 2
77 .reloc ., R_390_GOT32, foo
78 .space 4
79 .reloc ., R_390_GOT32, bar
80 .space 4
81 .reloc ., R_390_GOTPLT32, foo
82 .space 4
83 .reloc ., R_390_GOTPLT32, bar
84 .space 4
85 .reloc ., R_390_GOT64, foo
86 .space 8
87 .reloc ., R_390_GOT64, bar
88 .space 8
89 .reloc ., R_390_GOTPLT64, foo
90 .space 8
91 .reloc ., R_390_GOTPLT64, bar
92 .space 8