[PATCH] D48756: [gold-plugin] Add option for section ordering

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 12 12:17:52 PDT 2018


void updated this revision to Diff 155250.
void added a comment.

Is this the change you were thinking of?

There appears to be two unrelated failures in ToT:

  FAIL: LLVM :: tools/gold/X86/comdat.ll (25489 of 26550)
  ******************** TEST 'LLVM :: tools/gold/X86/comdat.ll' FAILED ********************
  Script:
  --
  : 'RUN: at line 1';   /usr/local/google/home/morbo/llvm/llvm.obj/bin/llvm-as /usr/local/google/home/morbo/llvm/llvm.src/test/tools/gold/X86/comdat.ll -o /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/comdat.ll.tmp1.o
  : 'RUN: at line 2';   /usr/local/google/home/morbo/llvm/llvm.obj/bin/llvm-as /usr/local/google/home/morbo/llvm/llvm.src/test/tools/gold/X86/Inputs/comdat.ll -o /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/comdat.ll.tmp2.o
  : 'RUN: at line 3';   /usr/bin/ld.gold -shared -o /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/comdat.ll.tmp3.o -plugin /usr/local/google/home/morbo/llvm/llvm.obj/./lib/LLVMgold.so /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/comdat.ll.tmp1.o /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/comdat.ll.tmp2.o   -m elf_x86_64   -plugin-opt=save-temps
  : 'RUN: at line 6';   /usr/local/google/home/morbo/llvm/llvm.obj/bin/FileCheck --check-prefix=RES /usr/local/google/home/morbo/llvm/llvm.src/test/tools/gold/X86/comdat.ll < /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/comdat.ll.tmp3.o.resolution.txt
  : 'RUN: at line 7';   /usr/local/google/home/morbo/llvm/llvm.obj/bin/llvm-readobj -t /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/comdat.ll.tmp3.o | /usr/local/google/home/morbo/llvm/llvm.obj/bin/FileCheck --check-prefix=OBJ /usr/local/google/home/morbo/llvm/llvm.src/test/tools/gold/X86/comdat.ll
  --
  Exit Code: 1
  
  Command Output (stderr):
  --
  /usr/local/google/home/morbo/llvm/llvm.src/test/tools/gold/X86/comdat.ll:63:13: error: expected string not found in input
  ; OBJ-NEXT: Other [
              ^
  <stdin>:233:8: note: scanning from here
   Type: Function (0x2)
         ^
  <stdin>:234:2: note: possible intended match here
   Other: 0
   ^
  
  --
  
  ********************
  FAIL: LLVM :: tools/gold/X86/visibility.ll (25549 of 26550)
  ******************** TEST 'LLVM :: tools/gold/X86/visibility.ll' FAILED ********************
  Script:
  --
  : 'RUN: at line 1';   /usr/local/google/home/morbo/llvm/llvm.obj/bin/llvm-as /usr/local/google/home/morbo/llvm/llvm.src/test/tools/gold/X86/visibility.ll -o /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/visibility.ll.tmp.o
  : 'RUN: at line 2';   /usr/local/google/home/morbo/llvm/llvm.obj/bin/llvm-as /usr/local/google/home/morbo/llvm/llvm.src/test/tools/gold/X86/Inputs/visibility.ll -o /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/visibility.ll.tmp2.o
  : 'RUN: at line 4';   /usr/bin/ld.gold -plugin /usr/local/google/home/morbo/llvm/llvm.obj/./lib/LLVMgold.so     -m elf_x86_64     --plugin-opt=save-temps     -shared /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/visibility.ll.tmp.o /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/visibility.ll.tmp2.o -o /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/visibility.ll.tmp.so
  : 'RUN: at line 8';   /usr/local/google/home/morbo/llvm/llvm.obj/bin/llvm-readobj -t /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/visibility.ll.tmp.so | /usr/local/google/home/morbo/llvm/llvm.obj/bin/FileCheck /usr/local/google/home/morbo/llvm/llvm.src/test/tools/gold/X86/visibility.ll
  : 'RUN: at line 9';   /usr/local/google/home/morbo/llvm/llvm.obj/bin/llvm-dis /usr/local/google/home/morbo/llvm/llvm.obj/test/tools/gold/X86/Output/visibility.ll.tmp.so.0.2.internalize.bc -o - | /usr/local/google/home/morbo/llvm/llvm.obj/bin/FileCheck --check-prefix=IR /usr/local/google/home/morbo/llvm/llvm.src/test/tools/gold/X86/visibility.ll
  --
  Exit Code: 1
  
  Command Output (stderr):
  --
  /usr/local/google/home/morbo/llvm/llvm.src/test/tools/gold/X86/visibility.ll:14:15: error: expected string not found in input
  ; CHECK-NEXT: Binding: Global
                ^
  <stdin>:67:8: note: scanning from here
   Size: 1
         ^
  <stdin>:68:2: note: possible intended match here
   Binding: Weak (0x2)
   ^
  
  --


Repository:
  rL LLVM

https://reviews.llvm.org/D48756

Files:
  test/tools/gold/X86/relocatable.ll
  tools/gold/gold-plugin.cpp


Index: tools/gold/gold-plugin.cpp
===================================================================
--- tools/gold/gold-plugin.cpp
+++ tools/gold/gold-plugin.cpp
@@ -115,6 +115,8 @@
 static ld_plugin_set_extra_library_path set_extra_library_path = nullptr;
 static ld_plugin_get_view get_view = nullptr;
 static bool IsExecutable = false;
+static bool FuncSplitSections = true;
+static bool DataSplitSections = true;
 static Optional<Reloc::Model> RelocationModel = None;
 static std::string output_name = "";
 static std::list<claimed_file> Modules;
@@ -324,6 +326,8 @@
       switch (tv->tv_u.tv_val) {
       case LDPO_REL: // .o
         IsExecutable = false;
+        FuncSplitSections = false;
+        DataSplitSections = false;
         break;
       case LDPO_DYN: // .so
         IsExecutable = false;
@@ -834,9 +838,9 @@
   // FIXME: Check the gold version or add a new option to enable them.
   Conf.Options.RelaxELFRelocations = false;
 
-  // Enable function/data sections by default.
-  Conf.Options.FunctionSections = true;
-  Conf.Options.DataSections = true;
+  // Toggle function/data sections.
+  Conf.Options.FunctionSections = FuncSplitSections;
+  Conf.Options.DataSections = DataSplitSections;
 
   Conf.MAttrs = MAttrs;
   Conf.RelocModel = RelocationModel;
Index: test/tools/gold/X86/relocatable.ll
===================================================================
--- test/tools/gold/X86/relocatable.ll
+++ test/tools/gold/X86/relocatable.ll
@@ -10,7 +10,7 @@
 ; CHECK-NEXT:   Binding: Global
 ; CHECK-NEXT:   Type: Function
 ; CHECK-NEXT:   Other: 0
-; CHECK-NEXT:   Section: .text.foo
+; CHECK-NEXT:   Section: .text
 ; CHECK-NEXT: }
 
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48756.155250.patch
Type: text/x-patch
Size: 1730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180712/efe5909b/attachment.bin>


More information about the llvm-commits mailing list