diff options
author | Adrian Prantl <aprantl@apple.com> | 2013-12-23 22:24:47 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2013-12-23 22:24:47 +0000 |
commit | 7ed2b702a209ba9780529adcf87ab8b7047483d4 (patch) | |
tree | 899a564fb642cd185a96d08ec662850d9dff4138 /lib/Target/ARM | |
parent | 8f57233536c0ae7efbe8bb5b800044f6d134db2a (diff) | |
download | llvm-7ed2b702a209ba9780529adcf87ab8b7047483d4.tar.gz llvm-7ed2b702a209ba9780529adcf87ab8b7047483d4.tar.bz2 llvm-7ed2b702a209ba9780529adcf87ab8b7047483d4.tar.xz |
Debug info: On ARM ensure that the data sections come before the
(optional) DWARF sections, so compiling with -g does not result in
different code being generated.
rdar://problem/15623193
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197922 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r-- | lib/Target/ARM/ARMAsmPrinter.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index 0c65ea891d..0d724b0610 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -488,6 +488,19 @@ void ARMAsmPrinter::EmitStartOfAsmFile(Module &M) { SectionKind::getText()); OutStreamer.SwitchSection(StaticInitSect); } + + // Compiling with debug info should not affect the code + // generation! Since some of the data sections are first switched + // to only in ASMPrinter::doFinalization(), the debug info + // sections would come before the data sections in the object + // file. This is problematic, since PC-relative loads have to use + // different instruction sequences in order to reach global data + // in the same object file. + OutStreamer.SwitchSection(getObjFileLowering().getCStringSection()); + OutStreamer.SwitchSection(getObjFileLowering().getDataSection()); + OutStreamer.SwitchSection(getObjFileLowering().getDataCommonSection()); + OutStreamer.SwitchSection(getObjFileLowering().getDataBSSSection()); + OutStreamer.SwitchSection(getObjFileLowering().getNonLazySymbolPointerSection()); } // Use unified assembler syntax. |