[ELF] Make SyntheticSection parameter order match InputSection
[llvm-project.git] / lld / test / ELF / apply-dynamic-relocs.s
blob3f91b15d79c977ab6787e7b598504d50aaaa8a0d
1 # REQUIRES: x86
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
14 # CHECK: Name: .got
15 # CHECK: Address: 0x[[GOT:.*]]
16 # CHECK: SectionData (
17 # APPLY-NEXT: 0000: 30220000 00000000 |
18 # NOAPPLY-NEXT: 0000: 00000000 00000000 |
19 # CHECK-NEXT: )
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]]
29 # CHECK-NEXT: }
30 # CHECK-NEXT: ]
32 cmpq $0, _DYNAMIC@GOTPCREL(%rip)