[PATCH] D132361: [LLD] [COFF] Fix export directives in object files from -includeoptional
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 22 02:41:56 PDT 2022
mstorsjo created this revision.
mstorsjo added reviewers: rnk, MaskRay, mati865.
Herald added a subscriber: StephenFan.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: LLVM.
When an object file contains an export directive, we normally do some
amount of deferred processing of them in the main linker loop.
When we later pull in objects due to options like -includeoptional
(or -wrap), we previously didn't do any further main loop processing.
If an object file pulled in at this stage contained an export
directive, we wouldn't handle it correctly, leading to crashes
when writing the DLL export tables.
This fixes https://github.com/llvm/llvm-project/issues/57243.
We could also split the whole main loop into a separate method,
but I'm using a lambda to keep the patch simpler (and maybe for
additional readability, to keep the code more in context?), but I'm
open to splitting it out too.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D132361
Files:
lld/COFF/Driver.cpp
lld/test/COFF/includeoptional-export.s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132361.454429.patch
Type: text/x-patch
Size: 3044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220822/79da12d4/attachment.bin>
More information about the llvm-commits
mailing list