[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
This commit is contained in:
Zequan Wu
2021-03-30 11:02:27 -07:00
parent ee176d2e6e
commit eabd55b1b2

View File

@@ -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.