Call InitSections in llc and clang so that the binaries produced by them
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 8 Oct 2010 19:37:38 +0000 (19:37 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 8 Oct 2010 19:37:38 +0000 (19:37 +0000)
are easier to diff with those produced by llvm-mc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116095 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LLVMTargetMachine.cpp
test/MC/ELF/entsize.ll

index 36038027b259436fe5e9ef2225abfba30df5998e..cf46738e2c9dc8ee3803471ecc0cccc9030e7fa8 100644 (file)
@@ -160,6 +160,7 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
     AsmStreamer.reset(getTarget().createObjectStreamer(TargetTriple, *Context,
                                                        *TAB, Out, MCE,
                                                        hasMCRelaxAll()));
+    AsmStreamer.get()->InitSections();
     break;
   }
   case CGFT_Null:
index f8290d122d8b342f2f1462dff6a44a3f2b756c9c..bb289d359d4f4fc1a8dd5367b2f2f845260890b0 100644 (file)
@@ -20,7 +20,7 @@ declare void @foo(i64* nocapture) nounwind
 
 ;;;;;
 
-; 64: (('sh_name', 7) # '.rodata.str1.1'
+; 64: (('sh_name', 18) # '.rodata.str1.1'
 ; 64-NEXT:   ('sh_type', 1)
 ; 64-NEXT:   ('sh_flags', 50)
 ; 64-NEXT:   ('sh_addr',
@@ -31,7 +31,7 @@ declare void @foo(i64* nocapture) nounwind
 ; 64-NEXT:   ('sh_addralign', 1)
 ; 64-NEXT:   ('sh_entsize', 1)
 
-; 64: (('sh_name', 22) # '.rodata.cst8'
+; 64: (('sh_name', 33) # '.rodata.cst8'
 ; 64-NEXT:   ('sh_type', 1)
 ; 64-NEXT:   ('sh_flags', 18)
 ; 64-NEXT:   ('sh_addr',