From eabd55b1b2c5e322c3b36cb44348f178692890c8 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Tue, 30 Mar 2021 11:02:27 -0700 Subject: [PATCH] [lld-link] Enable addrsig table in COFF lto This allow safe-icf mode to work when linking with LTO. Differential Revision: https://reviews.llvm.org/D99613 --- lld/COFF/LTO.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lld/COFF/LTO.cpp b/lld/COFF/LTO.cpp index a47f66ec7cf0..d117abf86f79 100644 --- a/lld/COFF/LTO.cpp +++ b/lld/COFF/LTO.cpp @@ -62,6 +62,7 @@ static std::string getThinLTOOutputFile(StringRef path) { static lto::Config createConfig() { lto::Config c; c.Options = initTargetOptionsFromCodeGenFlags(); + c.Options.EmitAddrsig = true; // Always emit a section per function/datum with LTO. LLVM LTO should get most // of the benefit of linker GC, but there are still opportunities for ICF.