[lld] r339050 - ELF: Enable address-significance tables during LTO.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 6 13:12:12 PDT 2018


Author: pcc
Date: Mon Aug  6 13:12:12 2018
New Revision: 339050

URL: http://llvm.org/viewvc/llvm-project?rev=339050&view=rev
Log:
ELF: Enable address-significance tables during LTO.

This allows safe ICF to work when linking with LTO.

Differential Revision: https://reviews.llvm.org/D50221

Modified:
    lld/trunk/ELF/LTO.cpp
    lld/trunk/test/ELF/lto/relocatable.ll

Modified: lld/trunk/ELF/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.cpp?rev=339050&r1=339049&r2=339050&view=diff
==============================================================================
--- lld/trunk/ELF/LTO.cpp (original)
+++ lld/trunk/ELF/LTO.cpp Mon Aug  6 13:12:12 2018
@@ -67,9 +67,10 @@ static std::string getThinLTOOutputFile(
 static lto::Config createConfig() {
   lto::Config C;
 
-  // LLD supports the new relocations.
+  // LLD supports the new relocations and address-significance tables.
   C.Options = InitTargetOptionsFromCodeGenFlags();
   C.Options.RelaxELFRelocations = true;
+  C.Options.EmitAddrsig = true;
 
   // Always emit a section per function/datum with LTO.
   C.Options.FunctionSections = true;

Modified: lld/trunk/test/ELF/lto/relocatable.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/relocatable.ll?rev=339050&r1=339049&r2=339050&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/relocatable.ll (original)
+++ lld/trunk/test/ELF/lto/relocatable.ll Mon Aug  6 13:12:12 2018
@@ -41,6 +41,15 @@
 ; CHECK-NEXT:     Section: .text.foo
 ; CHECK-NEXT:   }
 ; CHECK-NEXT:   Symbol {
+; CHECK-NEXT:     Name:
+; CHECK-NEXT:     Value: 0x0
+; CHECK-NEXT:     Size: 0
+; CHECK-NEXT:     Binding: Local
+; CHECK-NEXT:     Type: Section
+; CHECK-NEXT:     Other: 0
+; CHECK-NEXT:     Section: .llvm_addrsig
+; CHECK-NEXT:   }
+; CHECK-NEXT:   Symbol {
 ; CHECK-NEXT:     Name: foo
 ; CHECK-NEXT:     Value: 0x0
 ; CHECK-NEXT:     Size: 1




More information about the llvm-commits mailing list