summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LLVMTargetMachine.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-03-20 20:00:01 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-03-20 20:00:01 +0000
commit36a15cb975334403216e6145d4abece3026af17a (patch)
treeee2632cf05c4640e86c4eaec667ad738c041aaff /llvm/lib/CodeGen/LLVMTargetMachine.cpp
parentb933fb2c0b8b0ba40b17765a9336c16498b0adc3 (diff)
downloadbcm5719-llvm-36a15cb975334403216e6145d4abece3026af17a.tar.gz
bcm5719-llvm-36a15cb975334403216e6145d4abece3026af17a.zip
Don't declare all text sections at the start of the .s
The code this patch removes was there to make sure the text sections went before the dwarf sections. That is necessary because MachO uses offsets relative to the start of the file, so adding a section can change relaxations. The dwarf sections were being printed at the start just to produce symbols pointing at the start of those sections. The underlying issue was fixed in r231898. The dwarf sections are now printed when they are about to be used, which is after we printed the text sections. To make sure we don't regress, the patch makes the MachO streamer assert if CodeGen puts anything unexpected after the DWARF sections. llvm-svn: 232842
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index f463f70d3e6..0fb0c46ddb1 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -202,7 +202,8 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
Triple T(getTargetTriple());
AsmStreamer.reset(getTarget().createMCObjectStreamer(
- T, *Context, *MAB, Out, MCE, STI, Options.MCOptions.MCRelaxAll));
+ T, *Context, *MAB, Out, MCE, STI, Options.MCOptions.MCRelaxAll,
+ /*DWARFMustBeAtTheEnd*/ true));
break;
}
case CGFT_Null:
@@ -253,7 +254,8 @@ bool LLVMTargetMachine::addPassesToEmitMC(PassManagerBase &PM,
Triple T(getTargetTriple());
const MCSubtargetInfo &STI = *getMCSubtargetInfo();
std::unique_ptr<MCStreamer> AsmStreamer(getTarget().createMCObjectStreamer(
- T, *Ctx, *MAB, Out, MCE, STI, Options.MCOptions.MCRelaxAll));
+ T, *Ctx, *MAB, Out, MCE, STI, Options.MCOptions.MCRelaxAll,
+ /*DWARFMustBeAtTheEnd*/ true));
// Create the AsmPrinter, which takes ownership of AsmStreamer if successful.
FunctionPass *Printer =
OpenPOWER on IntegriCloud