2 // RUN
: llvm-mc
-filetype
=obj
-triple
=i686
%s
-o
%t.o
3 // RUN
: llvm-mc
-filetype
=obj
-triple
=i686
%p
/Inputs
/shared.s
-o
%t2.o
4 // RUN
: ld.lld
-shared
%t2.o
-soname
=t2.so
-o
%t2.so
5 // RUN
: ld.lld
--hash-style
=sysv
%t.o
%t2.so
-o
%t
6 // RUN
: llvm-readobj
-S
%t | FileCheck
--check-prefix
=ADDR
%s
7 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--no-show-raw-insn
%t | FileCheck
%s
12 .section .R_386_32,"ax",@progbits
15 movl $R_386_32
+ 1, %edx
18 .section .R_386_PC32,"ax",@progbits,unique,1
23 .section .R_386_PC32,"ax",@progbits,unique,2
28 // CHECK
: Disassembly of section
.R_386_32:
30 // CHECK-NEXT
: <R_386_32
>:
31 // CHECK-NEXT
: movl $
4198829, %edx
33 // CHECK
: Disassembly of section
.R_386_PC32:
35 // CHECK-NEXT
: <R_386_PC32
>:
36 // CHECK-NEXT
: calll
0x4011ba
38 // CHECK
: <R_386_PC32_2
>:
45 // ADDR-NEXT
: Type
: SHT_PROGBITS
47 // ADDR-NEXT
: SHF_ALLOC
48 // ADDR-NEXT
: SHF_EXECINSTR
50 // ADDR-NEXT
: Address
: 0x4011E0
51 // ADDR-NEXT
: Offset
: 0x1E0
52 // ADDR-NEXT
: Size
: 32
54 // ADDR
: Name
: .got.plt (
55 // ADDR-NEXT
: Type
: SHT_PROGBITS
57 // ADDR-NEXT
: SHF_ALLOC
58 // ADDR-NEXT
: SHF_WRITE
60 // ADDR-NEXT
: Address
: 0x403280
64 .section .R_386_GOTPC,"ax",@progbits
66 movl $_GLOBAL_OFFSET_TABLE_
, %eax
68 // .got.plt - 0x4011c0 = 0x403280 - 0x4011c0 = 8384
69 // CHECK
: Disassembly of section
.R_386_GOTPC:
71 // CHECK-NEXT
: <R_386_GOTPC
>:
72 // CHECK-NEXT
: 4011c0
: movl $
8384, %eax
74 .section .dynamic_reloc, "ax",@progbits
76 // .plt + 16 - (0x4011c5 + 5) = 0x4011e0 + 16 - 0x4011ca = 38
77 // CHECK
: Disassembly of section
.dynamic_reloc:
79 // CHECK-NEXT
: <.dynamic_reloc>:
80 // CHECK-NEXT
: 4011c5
: calll
0x4011f0 <bar@plt
>
82 .section .R_386_GOT32,"ax",@progbits
90 // &.got[0] - .got.plt = 0x402278 - 0x403280 = 4294963192
91 // &.got[1] - .got.plt = 0x402278 + 4 - 0x403280 = 4294963196
92 // &.got[2] - .got.plt = 0x402278 + 8 - 0x403280 = 4294963200
93 // CHECK
: Disassembly of section
.R_386_GOT32:
95 // CHECK-NEXT
: <R_386_GOT32
>:
96 // CHECK-NEXT
: 4011ca
: movl
4294963192, %eax
97 // CHECK-NEXT
: movl
4294963196, %eax
98 // CHECK-NEXT
: movl
4294963200, %eax
99 // CHECK-NEXT
: movl
4294963200, %eax