The current logic assumes that the import file is pulled by object
files, and the loop for import files only needs to handle cases where
the `__imp_` symbol is implicitly pulled by an import thunk. This is
fragile, as the symbol may also be pulled through other means, such as
the -export argument in tests. Additionally, this logic is insufficient
for ARM64EC, which exposes multiple symbols through an import file, and
referencing any one of them causes all of them to be defined.
With this change, import symbols are added to `syms` more often, but we
ensure that output symbols remain unique later in the process
12 lines
351 B
Plaintext
12 lines
351 B
Plaintext
; REQUIRES: x86
|
|
|
|
; RUN: llvm-lib -machine:amd64 -out:%t.imp.lib -def:%s
|
|
; RUN: lld-link -machine:amd64 -out:%t.dll %t.imp.lib -dll -noentry -export:__imp_func,DATA -map
|
|
|
|
; FileCheck %s < %t.imp.map
|
|
; CHECK: 0001:00000098 __imp_func 0000000180001098 export-imp-thunk.test.tmp.imp:imp.dll
|
|
|
|
LIBRARY imp.dll
|
|
EXPORTS
|
|
func
|