#[link(kind="raw-dylib")]
mis-compiles if cdylib export has the same name
#113050
Labels
A-linkage
Area: linking into static, shared libraries and binaries
C-bug
Category: This is a bug.
F-raw_dylib
`#![feature(raw_dylib)]`
O-windows
Operating system: Windows
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When importing a function via
raw-dylib
, if an exported function has the same name, the compiler will use the exported version in all cases.I would expect my exported
MessageBoxA
function to compile to ajmp
or acall
to the one imported via IAT.Instead, in Debug mode it compiles to a call of my function, and in Release mode, an infinite loop (x64 assembly
eb fe: jmp 0x0
).The DLL does not even have an IAT entry for
user32.dll
.If I name my function
my_MessageBoxA
and then rename it using a.def
file during linking, the behaviour is as expected.Meta
rustc --version --verbose
:Relates to: #58713
The text was updated successfully, but these errors were encountered: