This is an archive of the discontinued LLVM Phabricator instance.

[LLD] [COFF] Always demangle the __imp_ prefix to __declspec(dllimport)
ClosedPublic

Authored by mstorsjo on Sep 25 2019, 3:56 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Sep 25 2019, 3:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2019, 3:56 AM

@ruiu - does this look like what you want? For i386, do you want to keep the leading underscore, e.g. making __imp__foo into __declspec(dllimport) _foo, or have the demangling remove the underscore from _foo as well? This version removes that underscore, but it also changes the output for plain prefixless _foo symbols into foo.

ruiu added a comment.Oct 4 2019, 12:49 AM

I think I prefer not to remove the leading underscore for i386 because as you wrote it makes the output ambiguous.

mstorsjo updated this revision to Diff 223166.Oct 4 2019, 1:23 AM
mstorsjo edited the summary of this revision. (Show Details)

Updated to never remove the extra leading underscore on i386 (except when demangling itanium C++ symbols).

ruiu added a comment.Oct 4 2019, 1:44 AM

LGTM but I'd like to know what rnk thinks about this change.

rnk accepted this revision.Oct 4 2019, 11:18 AM

lgtm

lld/test/COFF/undefined-symbol-itanium-i386.s
27 ↗(On Diff #223166)

Fair enough. It's consistent with how we print the other x86 symbols above. (_main, _f1, etc)

This revision is now accepted and ready to land.Oct 4 2019, 11:18 AM
This revision was automatically updated to reflect the committed changes.