[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / i386-zrel-zrela.s
blobddba5eb4d98969632a6da729ceec581836317e51
1 # REQUIRES: x86
2 ## The i386 psABI uses Elf64_Rela relocation entries. We produce
3 ## Elf32_Rel dynamic relocations by default, but can use Elf32_Rela with -z rela.
5 # RUN: llvm-mc -filetype=obj -triple=i386 %s -o %t.o
6 # RUN: ld.lld -shared %t.o -o %t.so --noinhibit-exec
7 # RUN: llvm-readobj -d -r -x .data -x .got.plt %t.so | FileCheck --check-prefix=REL %s
8 # RUN: ld.lld -shared -z rel %t.o -o %t1.so
9 # RUN: llvm-readobj -d -r -x .data -x .got.plt %t1.so | FileCheck --check-prefix=REL %s
11 # REL: REL {{.*}}
12 # REL-NEXT: RELSZ 32 (bytes)
13 # REL-NEXT: RELENT 8 (bytes)
14 # REL-NEXT: RELCOUNT 1
15 # REL-NEXT: JMPREL {{.*}}
16 # REL-NEXT: PLTRELSZ 8 (bytes)
17 # REL-NEXT: PLTGOT {{.*}}
18 # REL-NEXT: PLTREL REL{{$}}
19 # REL: .rel.dyn {
20 # REL-NEXT: R_386_RELATIVE -
21 # REL-NEXT: R_386_GLOB_DAT func
22 # REL-NEXT: R_386_TLS_TPOFF tls
23 # REL-NEXT: R_386_32 _start
24 # REL-NEXT: }
25 # REL-NEXT: .rel.plt {
26 # REL-NEXT: R_386_JUMP_SLOT func
27 # REL-NEXT: }
29 # REL-LABEL: Hex dump of section '.data':
30 # REL-NEXT: 0x000042d0 d0420000 2a000000
31 ## ^--- R_386_RELATIVE addend (0x42d0)
32 ## ^--- R_386_32 addend (0x2a)
33 # REL-LABEL: Hex dump of section '.got.plt':
34 # REL-NEXT: 0x000042d8 48320000 00000000 00000000 36120000
35 ## R_386_JUMP_SLOT target (0x1236) ---------------^
37 # RUN: ld.lld -shared -z rel -z rela %t.o -o %t2.so
38 # RUN: llvm-readobj -d -r -x .data -x .got.plt %t2.so | FileCheck --check-prefix=RELA %s
40 # RELA: RELA {{.*}}
41 # RELA-NEXT: RELASZ 48 (bytes)
42 # RELA-NEXT: RELAENT 12 (bytes)
43 # RELA-NEXT: RELACOUNT 1
44 # RELA-NEXT: JMPREL {{.*}}
45 # RELA-NEXT: PLTRELSZ 12 (bytes)
46 # RELA-NEXT: PLTGOT {{.*}}
47 # RELA-NEXT: PLTREL RELA
48 # RELA: .rela.dyn {
49 # RELA-NEXT: R_386_RELATIVE - 0x42F0
50 # RELA-NEXT: R_386_GLOB_DAT func 0x0
51 # RELA-NEXT: R_386_TLS_TPOFF tls 0x0
52 # RELA-NEXT: R_386_32 _start 0x2A
53 # RELA-NEXT: }
54 # RELA-NEXT: .rela.plt {
55 # RELA-NEXT: R_386_JUMP_SLOT func 0x0
56 # RELA-NEXT: }
58 # RELA-LABEL: Hex dump of section '.data':
59 # RELA-NEXT: 0x000042f0 00000000 2a000000
60 ## ^--- R_386_32 addend (0x2a)
61 ## TODO: we should probably clear the R_386_32 addend that was copied from the .o?
62 ## no addend written for R_386_RELATIVE
63 # RELA-LABEL: Hex dump of section '.got.plt':
64 # RELA-NEXT: 0x000042f8 68320000 00000000 00000000 56120000
65 ## R_386_JUMP_SLOT target (0x1256) ----------------^
67 .globl _start
68 _start:
69 call func@PLT
70 movl func@GOT(%eax), %eax
72 .section .text1,"awx"
73 movl tls@GOTNTPOFF(%eax), %eax
75 .data
76 .long .data
77 .long _start+42