OSDN Git Service

[COFF] Improve correctness of def parsing for GNU features
authorMartin Storsjo <martin@martin.st>
Wed, 9 May 2018 09:21:53 +0000 (09:21 +0000)
committerMartin Storsjo <martin@martin.st>
Wed, 9 May 2018 09:21:53 +0000 (09:21 +0000)
commitad7a1f939cb241cfaa8c87e61c6f00decb52f24b
treeb8eea9b68a243bbf4e4caec36d660c99cf206b32
parentca76ce5f8aed689c682e2fdc2529290f0f50ee94
[COFF] Improve correctness of def parsing for GNU features

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.)

Differential Revision: https://reviews.llvm.org/D46245

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331859 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/COFFImportFile.h
lib/Object/COFFImportFile.cpp
lib/Object/COFFModuleDefinition.cpp
lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
test/tools/llvm-dlltool/coff-decorated.def
test/tools/llvm-dlltool/coff-weak-exports.def