diff options
-rw-r--r-- | lld/MinGW/Driver.cpp | 2 | ||||
-rw-r--r-- | lld/MinGW/Options.td | 2 | ||||
-rw-r--r-- | lld/test/MinGW/driver.test | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp index 71e86f57824..920afd1d6d5 100644 --- a/lld/MinGW/Driver.cpp +++ b/lld/MinGW/Driver.cpp @@ -187,7 +187,7 @@ bool mingw::link(ArrayRef<const char *> ArgsArr, raw_ostream &Diag) { Args.getLastArgValue(OPT_m) != "arm64pe" && !Args.hasArg(OPT_dynamicbase)) Add("-dynamicbase:no"); - if (Args.hasArg(OPT_no_insert_timestamp)) + if (Args.hasFlag(OPT_no_insert_timestamp, OPT_insert_timestamp, false)) Add("-timestamp:0"); if (Args.hasFlag(OPT_gc_sections, OPT_no_gc_sections, false)) diff --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td index d5c17635d60..1eee1caf344 100644 --- a/lld/MinGW/Options.td +++ b/lld/MinGW/Options.td @@ -16,6 +16,8 @@ def export_all_symbols: F<"export-all-symbols">, def gc_sections: F<"gc-sections">, HelpText<"Remove unused sections">; def icf: J<"icf=">, HelpText<"Identical code folding">; def image_base: S<"image-base">, HelpText<"Base address of the program">; +def insert_timestamp: F<"insert-timestamp">, + HelpText<"Include PE header timestamp">; def kill_at: F<"kill-at">, HelpText<"Remove @n from exported symbols">; def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"<libName>">, HelpText<"Root name of library to use">; diff --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test index b853527a087..f944994bb6a 100644 --- a/lld/test/MinGW/driver.test +++ b/lld/test/MinGW/driver.test @@ -153,4 +153,7 @@ RUN: ld.lld -### -m i386pep foo.o -Llibpath | FileCheck -check-prefix LIBPATH %s LIBPATH: -libpath:libpath RUN: ld.lld -### -m i386pep foo.o --no-insert-timestamp | FileCheck -check-prefix NOTIMESTAMP %s +RUN: ld.lld -### -m i386pep foo.o --insert-timestamp --no-insert-timestamp | FileCheck -check-prefix NOTIMESTAMP %s NOTIMESTAMP: -timestamp:0 +RUN: ld.lld -### -m i386pep foo.o --no-insert-timestamp --insert-timestamp | FileCheck -check-prefix TIMESTAMP %s +TIMESTAMP-NOT: -timestamp:0 |