[lld] eabd55b - [lld-link] Enable addrsig table in COFF lto

Zequan Wu via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 30 16:01:55 PDT 2021


Author: Zequan Wu
Date: 2021-03-30T15:47:53-07:00
New Revision: eabd55b1b2c5e322c3b36cb44348f178692890c8

URL: https://github.com/llvm/llvm-project/commit/eabd55b1b2c5e322c3b36cb44348f178692890c8
DIFF: https://github.com/llvm/llvm-project/commit/eabd55b1b2c5e322c3b36cb44348f178692890c8.diff

LOG: [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

Added: 
    

Modified: 
    lld/COFF/LTO.cpp

Removed: 
    


################################################################################
diff  --git a/lld/COFF/LTO.cpp b/lld/COFF/LTO.cpp
index a47f66ec7cf08..d117abf86f79f 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.


        


More information about the llvm-commits mailing list