Is there an alternative linker to link.exe?

て烟熏妆下的殇ゞ 提交于 2019-12-08 07:54:50

问题


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?

来源:https://stackoverflow.com/questions/20106407/is-there-an-alternative-linker-to-link-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!