Index: MinGW/Driver.cpp =================================================================== --- MinGW/Driver.cpp +++ MinGW/Driver.cpp @@ -138,6 +138,8 @@ Add("-stack:" + StringRef(A->getValue())); if (auto *A = Args.getLastArg(OPT_output_def)) Add("-output-def:" + StringRef(A->getValue())); + if (auto *A = Args.getLastArg(OPT_image_base)) + Add("-base:" + StringRef(A->getValue())); if (auto *A = Args.getLastArg(OPT_o)) Add("-out:" + StringRef(A->getValue())); Index: MinGW/Options.td =================================================================== --- MinGW/Options.td +++ MinGW/Options.td @@ -11,6 +11,7 @@ HelpText<"Name of entry point symbol">; def export_all_symbols: F<"export-all-symbols">, HelpText<"Export all symbols even if a def file or dllexport attributes are used">; +def image_base: S<"image-base">, HelpText<"Base address of the program">; def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"">, HelpText<"Root name of library to use">; def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">; Index: test/MinGW/driver.test =================================================================== --- test/MinGW/driver.test +++ test/MinGW/driver.test @@ -107,3 +107,6 @@ RUN: ld.lld -### -m i386pep foo.o --tsaware | FileCheck -check-prefix TSAWARE %s TSAWARE: -tsaware - + +RUN: ld.lld -### -m i386pep foo.o --image-base 0x1230000 | FileCheck -check-prefix IMAGE-BASE %s +IMAGE-BASE: -base:0x1230000