diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index 36038027b259..cf46738e2c9d 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -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: diff --git a/llvm/test/MC/ELF/entsize.ll b/llvm/test/MC/ELF/entsize.ll index f8290d122d8b..bb289d359d4f 100644 --- a/llvm/test/MC/ELF/entsize.ll +++ b/llvm/test/MC/ELF/entsize.ll @@ -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',