[PATCH] D46245: [COFF] Improve correctness of def parsing for GNU features

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 30 00:50:09 PDT 2018


mstorsjo created this revision.
mstorsjo added reviewers: ruiu, rnk, martell.
Herald added subscribers: hiraditya, mehdi_amini.

The operator == used for exporting a function with a different name in the DLL compared to the name in the import library (which is useful for adding linker level aliases for function in the import library) is a feature distinct and different from the operator = used for exporting a function with a different name (both in import library and DLL) than in the implementation producing the DLL.

When creating an import library using dlltool, from a def file that contains forwards (Func = OtherDll.Func), this shouldn't affect the produced import library, which should still behave just as if it was a normal exported function.

This clears a lot of confusion and subtle misunderstandings, and avoids a parameter that was used to avoid creating weak aliases when invoked from lld. (This parameter was added previously due to the existing conflation of the two features.)


https://reviews.llvm.org/D46245

Files:
  lld/COFF/Driver.cpp
  llvm/include/llvm/Object/COFFImportFile.h
  llvm/lib/Object/COFFImportFile.cpp
  llvm/lib/Object/COFFModuleDefinition.cpp
  llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
  llvm/test/tools/llvm-dlltool/coff-decorated.def
  llvm/test/tools/llvm-dlltool/coff-weak-exports.def

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46245.144508.patch
Type: text/x-patch
Size: 7362 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180430/748fbc33/attachment.bin>


More information about the llvm-commits mailing list