33 lines · plain
1# REQUIRES: x862 3## On RELA targets, --apply-dynamic-relocs writes addends to the relocated positions.4 5# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o6# RUN: ld.lld %t.o -o %t.so -shared --apply-dynamic-relocs7# RUN: llvm-readobj -S --section-data -l -r %t.so | FileCheck -check-prefixes=CHECK,APPLY %s8 9# RUN: ld.lld %t.o -o %t2.so -shared10# RUN: llvm-readobj -S --section-data -l -r %t2.so | FileCheck -check-prefixes=CHECK,NOAPPLY %s11# RUN: ld.lld %t.o -o %t3.so -shared --no-apply-dynamic-relocs12# RUN: cmp %t2.so %t3.so13 14# CHECK: Name: .got15# CHECK: Address: 0x[[GOT:.*]]16# CHECK: SectionData (17# APPLY-NEXT: 0000: 30220000 00000000 |18# NOAPPLY-NEXT: 0000: 00000000 00000000 |19# CHECK-NEXT: )20 21# CHECK: Type: PT_DYNAMIC22# CHECK-NEXT: Offset: 0x23023# CHECK-NEXT: VirtualAddress: 0x[[DYNAMIC:.*]]24# CHECK-NEXT: PhysicalAddress: 0x[[DYNAMIC]]25 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: ]31 32cmpq $0, _DYNAMIC@GOTPCREL(%rip)33