[LLD][MinGW] Add --heap argument support

Noticed in https://github.com/msys2/MINGW-packages/pull/10567.

Differential Revision: https://reviews.llvm.org/D118405
This commit is contained in:
Mateusz Mikuła 2022-01-29 23:36:50 +02:00 committed by Martin Storsjö
parent 067650fd12
commit 460830a9c6
3 changed files with 8 additions and 0 deletions

View File

@ -264,6 +264,8 @@ bool mingw::link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
add("-filealign:" + StringRef(a->getValue()));
if (auto *a = args.getLastArg(OPT_section_alignment))
add("-align:" + StringRef(a->getValue()));
if (auto *a = args.getLastArg(OPT_heap))
add("-heap:" + StringRef(a->getValue()));
if (auto *a = args.getLastArg(OPT_o))
add("-out:" + StringRef(a->getValue()));

View File

@ -66,6 +66,7 @@ defm file_alignment: Eq<"file-alignment", "Set file alignment">;
defm gc_sections: B<"gc-sections",
"Remove unused sections",
"Don't remove unused sections">;
defm heap: Eq<"heap", "Set size of the initial heap">;
def help: F<"help">, HelpText<"Print option help">;
defm high_entropy_va: B_disable<"high-entropy-va",
"Set the 'high entropy VA' flag", "Don't set the 'high entropy VA' flag">;

View File

@ -340,3 +340,8 @@ DISABLE-FIXUP: -stdcall-fixup:no
RUN: ld.lld -### -m i386pep foo.o --disable-stdcall-fixup --enable-stdcall-fixup 2>&1 | FileCheck -check-prefix ENABLE-FIXUP %s
ENABLE-FIXUP: -stdcall-fixup{{ }}
RUN: ld.lld -### foo.o -m i386pep -heap 8388608,16384 2>&1 | FileCheck -check-prefix=HEAP %s
RUN: ld.lld -### foo.o -m i386pep --heap 8388608,16384 2>&1 | FileCheck -check-prefix=HEAP %s
RUN: ld.lld -### foo.o -m i386pep --heap=8388608,16384 2>&1 | FileCheck -check-prefix=HEAP %s
HEAP: -heap:8388608,16384