64 lines · plain
1# REQUIRES: x862 3# RUN: llvm-mc -triple=x86_64-windows-gnu %s -filetype=obj -o %t.obj4# RUN: llvm-readobj --symbols %t.obj | FileCheck %s --check-prefix=SYMBOL5 6# RUN: lld-link -lldmingw -entry:main %t.obj -out:%t.exe -lldmap:%t.map -verbose7# RUN: llvm-readobj --sections %t.exe | FileCheck %s8 9# CHECK: Sections [10# CHECK: Section {11# CHECK: Number: 212# CHECK-LABEL: Name: .rdata (2E 72 64 61 74 61 00 00)13# This is the critical check to show that .xdata$foo was14# retained, while .xdata$bar wasn't. This *must* be 0x2415# (0x4 for the .xdata section and 0x20 for the16# .ctors/.dtors headers/ends).17# CHECK-NEXT: VirtualSize: 0x2418 19# Check that the weak symbols still are emitted as it was when the test was20# written, to make sure the test still actually tests what was intended.21 22# SYMBOL: Symbol {23# SYMBOL: Name: foo24# SYMBOL-NEXT: Value: 025# SYMBOL-NEXT: Section: IMAGE_SYM_UNDEFINED (0)26# SYMBOL-NEXT: BaseType: Null (0x0)27# SYMBOL-NEXT: ComplexType: Null (0x0)28# SYMBOL-NEXT: StorageClass: WeakExternal (0x69)29# SYMBOL-NEXT: AuxSymbolCount: 130# SYMBOL-NEXT: AuxWeakExternal {31# SYMBOL-NEXT: Linked: .weak.foo.default.main (19)32# SYMBOL-NEXT: Search: Alias (0x3)33# SYMBOL-NEXT: }34# SYMBOL-NEXT: }35 36 .text37 .globl main38main:39 call foo40 retq41 42# See associative-comdat-mingw.s for the general setup. Here, the leader43# symbols are weak, which causes the functions foo and bar to be undefined44# weak externals, while the actual leader symbols are named like45# .weak.foo.default.main.46 47 .section .xdata$foo,"dr"48 .linkonce discard49 .long 4250 51 .section .xdata$bar,"dr"52 .linkonce discard53 .long 4354 55 .section .text$foo,"xr",discard,foo56 .weak foo57foo:58 ret59 60 .section .text$bar,"xr",discard,bar61 .weak bar62bar:63 ret64