[LLD][COFF] Support GNU style == aliases
authorAyke van Laethem <aykevanlaethem@gmail.com>
Sun, 7 Nov 2021 15:46:29 +0000 (16:46 +0100)
committerAyke van Laethem <aykevanlaethem@gmail.com>
Wed, 19 Jan 2022 13:22:13 +0000 (14:22 +0100)
commitd649faff9c0ca87fd5a00a7f1056071fd46432ea
treecfdae96ad0250a45b9f954cdc483e2d18ca40f24
parent579c4921c0105698617cc1e1b86a9ecf3b4717ce
[LLD][COFF] Support GNU style == aliases

D46245 added support for this in llvm-libtool, but while lld-link can
also create .lib files from .def files it didn't support aliases.

I compared the Inputs/library.def test against the output from
llvm-libtool and it matches, except for the fact that lld-link reorders
functions for some reason.

I have also verified that this fixes a bug I was running into while
trying to compile .def files to .lib files in MinGW-w64 (using lld-link
instead of llvm-libtool).

Differential Revision: https://reviews.llvm.org/D113365
lld/COFF/Config.h
lld/COFF/Driver.cpp
lld/test/COFF/Inputs/library.def
lld/test/COFF/lib.test