brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · dc0a230 Raw
53 lines · plain
1// REQUIRES: x862 3// Check that base-relocations for unresolved weak symbols will be omitted.4 5// RUN: rm -rf %t.dir && split-file %s %t.dir && cd %t.dir6// RUN: llvm-mc -filetype=obj -triple=x86_64-mingw main.s -o main.obj7// RUN: llvm-mc -filetype=obj -triple=x86_64-mingw other.s -o other.obj8 9// RUN: lld-link -lldmingw -machine:x64 -dll -out:other.dll other.obj -noentry -export:foo -implib:other.lib10// RUN: lld-link -lldmingw -machine:x64 -out:main.exe main.obj other.lib -entry:entry -wrap:foo -debug:symtab11// RUN: llvm-readobj --sections --symbols --coff-imports --coff-basereloc main.exe | FileCheck %s --implicit-check-not=other.dll12 13// CHECK:      Number: 314// CHECK-NEXT: Name: .data15// CHECK-NEXT: VirtualSize:16// CHECK-NEXT: VirtualAddress: 0x[[#%x,SECTOP:0x3000]]17// CHECK:      Name: ref_foo18// CHECK-NEXT: Value: [[#%d,SYMVAL:]]19// CHECK:      BaseReloc [20// CHECK-NOT:    Address: 0x[[#%x,SECTOP+SYMVAL]]21 22#--- main.s23.global entry24entry:25  movq ref_foo(%rip), %rax26  call *%rax27 28.global __wrap_foo29__wrap_foo:30  ret31 32.data33.global ref_foo34.p2align 335ref_foo:36  .quad __real_foo37 38.globl _pei386_runtime_relocator39_pei386_runtime_relocator:40  movl __RUNTIME_PSEUDO_RELOC_LIST__(%rip), %eax41  movl __RUNTIME_PSEUDO_RELOC_LIST_END__(%rip), %eax42 43.weak __real_foo44.addrsig45.addrsig_sym __real_foo46.addrsig_sym ref_foo47 48#--- other.s49.global foo50 51foo:52  ret53