[PATCH] D50221: ELF: Enable address-significance tables during LTO.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 2 20:49:20 PDT 2018


pcc created this revision.
pcc added a reviewer: ruiu.
Herald added subscribers: dexonsmith, steven_wu, arichardson, inglorion, emaste.
Herald added a reviewer: espindola.

This allows safe ICF to work when linking with LTO.


Repository:
  rL LLVM

https://reviews.llvm.org/D50221

Files:
  lld/ELF/LTO.cpp
  lld/test/ELF/lto/relocatable.ll


Index: lld/test/ELF/lto/relocatable.ll
===================================================================
--- lld/test/ELF/lto/relocatable.ll
+++ lld/test/ELF/lto/relocatable.ll
@@ -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
Index: lld/ELF/LTO.cpp
===================================================================
--- lld/ELF/LTO.cpp
+++ lld/ELF/LTO.cpp
@@ -67,9 +67,10 @@
 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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50221.158907.patch
Type: text/x-patch
Size: 1173 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180803/50a54574/attachment.bin>


More information about the llvm-commits mailing list