diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index db87af8823db..0baa2129bedc 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -436,15 +436,11 @@ void LinkerScript::fabricateDefaultCommands() { for (auto &KV : Config->SectionStartMap) StartAddr = std::min(StartAddr, KV.second); + auto Expr = [=] { + return std::min(StartAddr, Config->ImageBase + elf::getHeaderSize()); + }; Opt.Commands.insert(Opt.Commands.begin(), - make(".", - [=] { - return std::min( - StartAddr, - Config->ImageBase + - elf::getHeaderSize()); - }, - "")); + make(".", Expr, "")); } // Add sections that didn't match any sections command.