diff options
author | Jacek Caban <jacek@codeweavers.com> | 2024-03-26 13:18:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-26 13:18:09 +0100 |
commit | 603db7425ffa96915854f425b027cc8403ab333d (patch) | |
tree | 06875b4a77742eacc1f2b2bc7d6d55d38165b4f3 /lld/COFF | |
parent | 4dc322524871df02578a05b260dacf28ff130c02 (diff) | |
download | llvm-603db7425ffa96915854f425b027cc8403ab333d.zip llvm-603db7425ffa96915854f425b027cc8403ab333d.tar.gz llvm-603db7425ffa96915854f425b027cc8403ab333d.tar.bz2 |
[LLD][COFF] Preserve all attributes from forwarding exports from parsed .def files. (#86564)
It's similar to #86535, but for export specified in .def files.
Diffstat (limited to 'lld/COFF')
-rw-r--r-- | lld/COFF/Driver.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp index 1b07538..1814929 100644 --- a/lld/COFF/Driver.cpp +++ b/lld/COFF/Driver.cpp @@ -1032,19 +1032,18 @@ void LinkerDriver::parseModuleDefs(StringRef path) { for (COFFShortExport e1 : m.Exports) { Export e2; - // In simple cases, only Name is set. Renamed exports are parsed - // and set as "ExtName = Name". If Name has the form "OtherDll.Func", - // it shouldn't be a normal exported function but a forward to another - // DLL instead. This is supported by both MS and GNU linkers. + // Renamed exports are parsed and set as "ExtName = Name". If Name has + // the form "OtherDll.Func", it shouldn't be a normal exported + // function but a forward to another DLL instead. This is supported + // by both MS and GNU linkers. if (!e1.ExtName.empty() && e1.ExtName != e1.Name && StringRef(e1.Name).contains('.')) { e2.name = saver().save(e1.ExtName); e2.forwardTo = saver().save(e1.Name); - ctx.config.exports.push_back(e2); - continue; + } else { + e2.name = saver().save(e1.Name); + e2.extName = saver().save(e1.ExtName); } - e2.name = saver().save(e1.Name); - e2.extName = saver().save(e1.ExtName); e2.aliasTarget = saver().save(e1.AliasTarget); e2.ordinal = e1.Ordinal; e2.noname = e1.Noname; |