2 // RUN
: llvm-mc
-filetype
=obj
-triple
=x86_64-pc-linux
%s
-o
%t
3 // RUN
: llvm-mc
-filetype
=obj
-triple
=x86_64-pc-linux
%p
/Inputs
/shared.s
-o
%t2
4 // RUN
: ld.lld
%t2
-soname fixed-length-string.so
-o
%t2.so
-shared
5 // RUN
: ld.lld
--hash-style
=sysv
%t %t2.so
-o
%t3
6 // RUN
: llvm-readobj
-S
%t3 | FileCheck
--check-prefix
=SEC
%s
7 // RUN
: llvm-objdump
-s
-d
%t3 | FileCheck
%s
10 // SEC-NEXT
: Type
: SHT_PROGBITS
12 // SEC-NEXT
: SHF_ALLOC
13 // SEC-NEXT
: SHF_EXECINSTR
15 // SEC-NEXT
: Address
: 0x201340
16 // SEC-NEXT
: Offset
: 0x340
20 // SEC-NEXT
: Type
: SHT_PROGBITS
22 // SEC-NEXT
: SHF_ALLOC
23 // SEC-NEXT
: SHF_WRITE
25 // SEC-NEXT
: Address
: 0x202460
30 // SEC-NEXT
: AddressAlignment
: 8
31 // SEC-NEXT
: EntrySize
: 0
34 // SEC
: Name
: .got.plt
35 // SEC-NEXT
: Type
: SHT_PROGBITS
37 // SEC-NEXT
: SHF_ALLOC
38 // SEC-NEXT
: SHF_WRITE
40 // SEC-NEXT
: Address
: 0x203468
41 // SEC-NEXT
: Offset
: 0x468
45 // SEC-NEXT
: AddressAlignment
: 8
46 // SEC-NEXT
: EntrySize
: 0
49 .section .R_X86_64_64,"a",@progbits
54 // CHECK
: Contents of section
.R_X86_64_64:
55 // CHECK-NEXT
: 2002f8 f8022000
00000000
57 .section .R_X86_64_GOTPCREL,"a",@progbits
58 .global R_X86_64_GOTPCREL
62 // 0x202460(.got) - 0x200300(.R_X86_64_GOTPCREL) = 0x2160
63 // CHECK
: Contents of section
.R_X86_64_GOTPCREL
64 // CHECK-NEXT
: 200300 60210000
66 .section .R_X86_64_GOT32,"a",@progbits
67 .global R_X86_64_GOT32
71 // CHECK
: Contents of section
.R_X86_64_GOT32:
72 // CHECK-NEXT
: f8efffff
75 // CHECK
: Contents of section
.R_X86_64_GOT64:
76 // CHECK-NEXT
: f8efffff ffffffff
77 .section .R_X86_64_GOT64,"a",@progbits
78 .global R_X86_64_GOT64
82 .section .text,"ax",@progbits,unique,1
87 .section .text,"ax",@progbits,unique,2
93 // CHECK
: Disassembly of section
.text:
95 // CHECK-NEXT
: <_start
>:
96 // CHECK-NEXT
: 201310: e8
04 00 00 00 callq
0x201319
97 // CHECK-NEXT
: 201315:
100 // CHECK-NEXT
: 201319: 90 nop
103 .section .text2,"ax",@progbits
106 movl $R_X86_64_32
, %edx
108 // FIXME
: this would
be far more self evident if llvm-objdump printed
110 // CHECK
: Disassembly of section
.text2:
112 // CHECK-NEXT
: <R_X86_64_32
>:
113 // CHECK-NEXT
: 20131a: {{.*}} movl $2102042, %edx
115 .section .R_X86_64_32S,"ax",@progbits
118 movq lulz
- 0x100000, %rdx
120 // CHECK
: Disassembly of section
.R_X86_64_32S:
122 // CHECK-NEXT
: <R_X86_64_32S
>:
123 // CHECK-NEXT
: {{.*}}: {{.*}} movq 1053465, %rdx
125 .section .R_X86_64_PC32,"ax",@progbits
126 .global R_X86_64_PC32
130 //16 is
a size of PLT
[0]
131 // 0x201340 + 16 - (0x201327 + 5) = 36
132 // CHECK
: Disassembly of section
.R_X86_64_PC32:
134 // CHECK-NEXT
: <R_X86_64_PC32
>:
135 // CHECK-NEXT
: 201327: {{.*}} callq 0x201350
136 // CHECK-NEXT
: 20132c
: {{.*}} movl $2102096, %eax
138 .section .R_X86_64_32S_2,"ax",@progbits
139 .global R_X86_64_32S_2
142 // plt is at
0x201340. The second plt entry is at 0x201360 == 2102112
143 // CHECK
: Disassembly of section
.R_X86_64_32S_2:
145 // CHECK-NEXT
: <R_X86_64_32S_2
>:
146 // CHECK-NEXT
: 201331: {{.*}} movl 2102112, %eax