blob: a1fe7d00a08c72e92e165f3f4fc2d676baac71a5 [file] [log] [blame]
Make a DLL that exports a few functions, then make a DLL with PDBs that imports
them. Check that the __imp_ pointer and the generated thunks appear in the
publics stream.
RUN: yaml2obj < %p/Inputs/export.yaml > %t1.obj
RUN: lld-link /out:%t1.dll /dll %t1.obj /implib:%t1.lib \
RUN: /export:exportfn1 /export:exportfn2
RUN: yaml2obj < %p/Inputs/import.yaml > %t2.obj
RUN: lld-link /out:%t2.exe /pdb:%t2.pdb /pdbaltpath:test.pdb \
RUN: /debug /entry:main %t2.obj %t1.lib
RUN: llvm-pdbutil dump %t2.pdb -publics -section-contribs | FileCheck %s
CHECK: Public Symbols
CHECK-NEXT: ============================================================
CHECK-NEXT: Records
CHECK-NEXT: 112 | S_PUB32 [size = 20] `main`
CHECK-NEXT: flags = function, addr = 0001:0000
CHECK-NEXT: 64 | S_PUB32 [size = 24] `exportfn1`
CHECK-NEXT: flags = function, addr = 0001:0016
CHECK-NEXT: 88 | S_PUB32 [size = 24] `exportfn2`
CHECK-NEXT: flags = function, addr = 0001:0032
CHECK-NEXT: 32 | S_PUB32 [size = 32] `__imp_exportfn2`
CHECK-NEXT: flags = none, addr = 0002:0136
CHECK-NEXT: 0 | S_PUB32 [size = 32] `__imp_exportfn1`
CHECK-NEXT: flags = none, addr = 0002:0128
CHECK: Section Contributions
CHECK-NEXT: ============================================================
main
CHECK-NEXT: SC[.text] | mod = 0, 0001:0000, size = 8, data crc = 0, reloc crc = 0
CHECK-NEXT: IMAGE_SCN_CNT_CODE | IMAGE_SCN_ALIGN_4BYTES | IMAGE_SCN_MEM_EXECUTE |
CHECK-NEXT: IMAGE_SCN_MEM_READ
exportfn1 thunk
CHECK-NEXT: SC[.text] | mod = 1, 0001:0016, size = 6, data crc = 0, reloc crc = 0
CHECK-NEXT: IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_READ
exportfn2 thunk
CHECK-NEXT: SC[.text] | mod = 1, 0001:0032, size = 6, data crc = 0, reloc crc = 0
CHECK-NEXT: IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_READ
.rdata debug directory data chunks
CHECK-NEXT: SC[.rdata] | mod = 1, 0002:0000, size = 28, data crc = 0, reloc crc = 0
CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ
CHECK-NEXT: SC[.rdata] | mod = 1, 0002:0028, size = 33, data crc = 0, reloc crc = 0
CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ