Is there an alternative linker to link.exe?

2019-06-08 16:33发布

I'm working on a proxy DLL and would like to export symbols with an "@" character in them. However, it appears that this character has a special meaning to link.exe (actually, to lib.exe, I guess?). Given a C++ file

extern "C" void f() { }

I can create a DLL which exports f as foo by running

cl /LD exports.cpp /link /export:foo=f

but as soon as the alias contains the "@" character, everything after it (including the "@" itself) appears to get stripped, i.e. all of the following export the same foo symbol:

cl /LD exports.cpp /link /export:foo=f
cl /LD exports.cpp /link /export:foo@=f
cl /LD exports.cpp /link /export:foo@foo=f
cl /LD exports.cpp /link /export:foo@@foo=f

I see that somebody else asked about this already; other people confirmed the behaviour, but there was no solution or explanation on what's going on. So I'm wondering:

Is there an alternative (easily accessible) linker for Windows which lets me export symbols with arbitrary names?

0条回答
登录 后发表回答