Index: ELF/Driver.cpp =================================================================== --- ELF/Driver.cpp +++ ELF/Driver.cpp @@ -349,7 +349,7 @@ Config->SoName = getString(Args, OPT_soname); Config->Sysroot = getString(Args, OPT_sysroot); - Config->Optimize = getInteger(Args, OPT_O, 0); + Config->Optimize = getInteger(Args, OPT_O, 1); Config->LtoO = getInteger(Args, OPT_lto_O, 2); if (Config->LtoO > 3) error("invalid optimization level for LTO: " + getString(Args, OPT_lto_O)); Index: ELF/InputFiles.cpp =================================================================== --- ELF/InputFiles.cpp +++ ELF/InputFiles.cpp @@ -143,6 +143,12 @@ template static bool shouldMerge(const typename ELFT::Shdr &Sec) { typedef typename ELFT::uint uintX_t; + + // We don't merge sections if -O0 (default is -O1). This makes + // the linker about 2x faster, although the output will be bigger. + if (Config->Optimize == 0) + return false; + uintX_t Flags = Sec.sh_flags; if (!(Flags & SHF_MERGE)) return false;