diff options
author | Martin Storsjö <martin@martin.st> | 2023-12-15 20:12:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-15 20:12:03 +0200 |
commit | 7dcd8ef135147de1576c2863b963ec929a15e8cb (patch) | |
tree | dcc7851adb507db45b2d8b9cea28cd217b9affda /lld/MinGW | |
parent | e36535d4bebadfbcfea34aa369743aafc43dcf6c (diff) | |
download | llvm-7dcd8ef135147de1576c2863b963ec929a15e8cb.zip llvm-7dcd8ef135147de1576c2863b963ec929a15e8cb.tar.gz llvm-7dcd8ef135147de1576c2863b963ec929a15e8cb.tar.bz2 |
[LLD] [MinGW] Respect the -S/-s options when writing PDB files (#75181)
This allows avoiding including some stray DWARF sections (e.g. from
toolchain provided files), when writing a PDB file.
While that probably could be considered reasonable default behaviour,
PDB writing and including DWARF sections are two entirely orthogonal
concepts, and GNU ld (which can generate PDB files these days) does
include DWARF unless -S/-s is passed, when creating a PDB.
Diffstat (limited to 'lld/MinGW')
-rw-r--r-- | lld/MinGW/Driver.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp index d22b617..94f0ae7 100644 --- a/lld/MinGW/Driver.cpp +++ b/lld/MinGW/Driver.cpp @@ -297,6 +297,11 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS, StringRef v = a->getValue(); if (!v.empty()) add("-pdb:" + v); + if (args.hasArg(OPT_strip_all)) { + add("-debug:nodwarf,nosymtab"); + } else if (args.hasArg(OPT_strip_debug)) { + add("-debug:nodwarf,symtab"); + } } else if (args.hasArg(OPT_strip_debug)) { add("-debug:symtab"); } else if (!args.hasArg(OPT_strip_all)) { |