Config->Force = true;
// Handle /debug
- if (Args.hasArg(OPT_debug)) {
+ if (Args.hasArg(OPT_debug) || Args.hasArg(OPT_debug_dwarf)) {
Config->Debug = true;
if (auto *Arg = Args.getLastArg(OPT_debugtype))
Config->DebugTypes = parseDebugType(Arg->getValue());
}
// Disable PDB generation if the user requested it.
- if (Args.hasArg(OPT_nopdb))
+ if (Args.hasArg(OPT_nopdb) || Args.hasArg(OPT_debug_dwarf))
Config->PDBPath = "";
// Set default image base if /base is not given.
def help_q : Flag<["/?", "-?"], "">, Alias<help>;
// LLD extensions
+def debug_dwarf : F<"debug:dwarf">;
def export_all_symbols : F<"export-all-symbols">;
def nopdb : F<"nopdb">, HelpText<"Disable PDB generation for DWARF users">;
def nosymtab : F<"nosymtab">;
Add("-verbose");
if (Args.hasArg(OPT_export_all_symbols))
Add("-export-all-symbols");
+ if (!Args.hasArg(OPT_strip_all))
+ Add("-debug:dwarf");
if (auto *A = Args.getLastArg(OPT_m)) {
StringRef S = A->getValue();
def shared: F<"shared">, HelpText<"Build a shared object">;
def subs: S<"subsystem">, HelpText<"Specify subsystem">;
def stack: S<"stack">;
+def strip_all: F<"strip-all">,
+ HelpText<"Omit all symbol information from the output binary">;
def whole_archive: F<"whole-archive">,
HelpText<"Include all object files for following archives">;
def verbose: F<"verbose">, HelpText<"Verbose mode">;
// Alias
def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias<entry>;
+def alias_strip_s: Flag<["-"], "s">, Alias<strip_all>;
RUN: ld.lld -### -m i386pep foo.o -Xlink=-lldmap | FileCheck -check-prefix XLINK %s
XLINK: -lldmap
+
+RUN: ld.lld -### -m i386pep foo.o | FileCheck -check-prefix DEBUG %s
+DEBUG: -debug:dwarf
+
+RUN: ld.lld -### -m i386pep foo.o -s | FileCheck -check-prefix STRIP %s
+RUN: ld.lld -### -m i386pep foo.o --strip-all | FileCheck -check-prefix STRIP %s
+STRIP-NOT: -debug:dwarf