2017-07-28 02:25:59 +08:00
|
|
|
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 /debug /entry:main %t2.obj %t1.lib
|
2017-08-04 05:15:09 +08:00
|
|
|
RUN: llvm-pdbutil dump %t2.pdb -publics -section-contribs | FileCheck %s
|
2017-07-28 02:25:59 +08:00
|
|
|
|
|
|
|
CHECK: Public Symbols
|
|
|
|
CHECK-NEXT: ============================================================
|
2017-08-09 12:23:59 +08:00
|
|
|
CHECK-NEXT: Records
|
2017-07-28 02:25:59 +08:00
|
|
|
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 = 0003:0072
|
|
|
|
CHECK-NEXT: 0 | S_PUB32 [size = 32] `__imp_exportfn1`
|
|
|
|
CHECK-NEXT: flags = none, addr = 0003:0064
|
2017-08-04 05:15:09 +08:00
|
|
|
|
|
|
|
CHECK: Section Contributions
|
|
|
|
CHECK-NEXT: ============================================================
|
|
|
|
main
|
2017-08-05 05:18:17 +08:00
|
|
|
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
|
2017-08-04 05:15:09 +08:00
|
|
|
exportfn1 thunk
|
2017-08-05 05:18:17 +08:00
|
|
|
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
|
2017-08-04 05:15:09 +08:00
|
|
|
exportfn2 thunk
|
2017-08-05 05:18:17 +08:00
|
|
|
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
|
2017-08-04 05:15:09 +08:00
|
|
|
.rdata debug directory data chunks
|
2017-08-05 05:18:17 +08:00
|
|
|
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 = {{.*}}, data crc = 0, reloc crc = 0
|
|
|
|
CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ
|