[PATCH] D130120: [2/3] [LLD] [COFF] Add support for a new, mingw specific embedded directive -exclude-symbols:

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 13:22:26 PDT 2022


mstorsjo created this revision.
mstorsjo added reviewers: rnk, mati865, jeremyd2019.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: LLVM.

This is an entirely new embedded directive - extending the GNU ld
command line option --exclude-symbols to be usable in embedded
directives too.

(GNU ld.bfd doesn't support this option as an embedded directive yet,
but when given an object file with such a directive, GNU ld doesn't
error out - contrary to lld - but only warns about it. I'll send a
patch to binutils to add support for the same option there too; this
patch pretty much needs to be coordinated with whatever review feedback
it gets there too.)

This works as an inverse to the regular embedded dllexport directives,
for cases when autoexport of all eligible symbols is performed.

Naming wise, the plural form "exclude-symbols" feels a bit odd here
as it would probably only ever be used with one symbol at a time (I'm
only adding testcases for one symbol per option here), but I'd rather
have it named the same as the command line option, rather than vaguely
different.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130120

Files:
  lld/COFF/Driver.cpp
  lld/COFF/Driver.h
  lld/COFF/DriverUtils.cpp
  lld/COFF/MinGW.cpp
  lld/COFF/MinGW.h
  lld/test/COFF/exclude-symbols-embedded.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130120.445926.patch
Type: text/x-patch
Size: 4118 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220719/e4a6ee79/attachment.bin>


More information about the llvm-commits mailing list