3 ## On RELA targets, --apply-dynamic-relocs writes addends to the relocated positions.
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
6 # RUN: ld.lld %t.o -o %t.so -shared --apply-dynamic-relocs
7 # RUN: llvm-readobj -S --section-data -l -r %t.so | FileCheck -check-prefixes=CHECK,APPLY %s
9 # RUN: ld.lld %t.o -o %t2.so -shared
10 # RUN: llvm-readobj -S --section-data -l -r %t2.so | FileCheck -check-prefixes=CHECK,NOAPPLY %s
11 # RUN: ld.lld %t.o -o %t3.so -shared --no-apply-dynamic-relocs
12 # RUN: cmp %t2.so %t3.so
15 # CHECK: Address: 0x[[GOT:.*]]
16 # CHECK: SectionData (
17 # APPLY-NEXT: 0000: 30220000 00000000 |
18 # NOAPPLY-NEXT: 0000: 00000000 00000000 |
21 # CHECK: Type: PT_DYNAMIC
22 # CHECK-NEXT: Offset: 0x230
23 # CHECK-NEXT: VirtualAddress: 0x[[DYNAMIC:.*]]
24 # CHECK-NEXT: PhysicalAddress: 0x[[DYNAMIC]]
26 # CHECK: Relocations [
27 # CHECK-NEXT: Section ({{.*}}) .rela.dyn {
28 # CHECK-NEXT: 0x[[GOT]] R_X86_64_RELATIVE - 0x[[DYNAMIC]]
32 cmpq $
0, _DYNAMIC@GOTPCREL
(%rip
)