diff options
author | Martin Storsjö <martin@martin.st> | 2022-07-18 23:43:02 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2022-08-11 11:59:47 +0300 |
commit | d1da6469f9ea9b078276ee2e098241f0440468be (patch) | |
tree | 00b4c1f3c25aa8890d65056c7031d602995b008a /lld/MinGW | |
parent | 164067918725d1ee8875e38213b6aee9be13383e (diff) | |
download | llvm-d1da6469f9ea9b078276ee2e098241f0440468be.zip llvm-d1da6469f9ea9b078276ee2e098241f0440468be.tar.gz llvm-d1da6469f9ea9b078276ee2e098241f0440468be.tar.bz2 |
[LLD] [MinGW] Implement the --exclude-symbols option
This adds support for the existing GNU ld command line option, which
allows excluding individual symbols from autoexport (when linking a
DLL and no symbols are marked explicitly as dllexported).
Differential Revision: https://reviews.llvm.org/D130118
Diffstat (limited to 'lld/MinGW')
-rw-r--r-- | lld/MinGW/Driver.cpp | 2 | ||||
-rw-r--r-- | lld/MinGW/Options.td | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp index 5920a50..37d2439 100644 --- a/lld/MinGW/Driver.cpp +++ b/lld/MinGW/Driver.cpp @@ -398,6 +398,8 @@ bool mingw::link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS, add("-delayload:" + StringRef(a->getValue())); for (auto *a : args.filtered(OPT_wrap)) add("-wrap:" + StringRef(a->getValue())); + for (auto *a : args.filtered(OPT_exclude_symbols)) + add("-exclude-symbols:" + StringRef(a->getValue())); std::vector<StringRef> searchPaths; for (auto *a : args.filtered(OPT_L)) { diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td index bfdd4af..cc94b93 100644 --- a/lld/MinGW/Options.td +++ b/lld/MinGW/Options.td @@ -62,6 +62,8 @@ def enable_stdcall_fixup: F<"enable-stdcall-fixup">, defm entry: Eq<"entry", "Name of entry point symbol">, MetaVarName<"<entry>">; def exclude_all_symbols: F<"exclude-all-symbols">, HelpText<"Don't automatically export any symbols">; +defm exclude_symbols: Eq<"exclude-symbols", + "Exclude symbols from automatic export">, MetaVarName<"<symbol[,symbol,...]>">; def export_all_symbols: F<"export-all-symbols">, HelpText<"Export all symbols even if a def file or dllexport attributes are used">; defm fatal_warnings: B<"fatal-warnings", |