This is an archive of the discontinued LLVM Phabricator instance.

[LLD] [COFF] Fix exporting of functions starting with underscores, etc
ClosedPublic

Authored by mstorsjo on Oct 22 2017, 1:40 PM.

Details

Summary

This fixes exporting functions in the following cases:

  • functions starting with an underscore in def files
  • functions starting with an underscore, via dllexport attributes, for mingw
  • fastcall and vectorcall functions when declared undecorated in def files
  • vectorcall functions when declared decorated in def files
  • stdcall functions when declared decorated in def files for mingw

This still exports the stdcall functions with the wrong name in the normal msvc/link.exe mode, if declared with decoration in the def file though (this is not a regression though). Exporting functions via def files including decoration is not something I believe is routinely done though, but is tested to try to match link.exe's behaviour as far as easily possible.

Diff Detail

Event Timeline

mstorsjo created this revision.Oct 22 2017, 1:40 PM
ruiu added inline comments.Oct 22 2017, 5:53 PM
COFF/Driver.cpp
216

Why is MinGW special?

ruiu accepted this revision.Oct 22 2017, 6:10 PM

LGTM as my question was addressed in a different change.

This revision is now accepted and ready to land.Oct 22 2017, 6:10 PM
This revision was automatically updated to reflect the committed changes.