summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2014-05-01 00:25:15 +0000
committerJoerg Sonnenberger <joerg@bec.de>2014-05-01 00:25:15 +0000
commit0f90c95ccf43c1f2b17d7d80b56ae79a09cf69a8 (patch)
treee9d9c0c2b06032470ef858e827dca1349eeade4f
parente1452c22e5e372fad64384f18085680845723d55 (diff)
downloadbcm5719-llvm-0f90c95ccf43c1f2b17d7d80b56ae79a09cf69a8.tar.gz
bcm5719-llvm-0f90c95ccf43c1f2b17d7d80b56ae79a09cf69a8.zip
If necessary for indirect encodings, emit stubs.
llvm-svn: 207730
-rw-r--r--llvm/lib/Target/ARM/ARMAsmPrinter.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
index 9d3ef7a71ef..2b97e015bf4 100644
--- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -545,6 +545,28 @@ void ARMAsmPrinter::EmitEndOfAsmFile(Module &M) {
// generates code that does this, it is always safe to set.
OutStreamer.EmitAssemblerFlag(MCAF_SubsectionsViaSymbols);
}
+
+ // Emit a .data.rel section containing any stubs that were created.
+ if (Subtarget->isTargetELF()) {
+ const TargetLoweringObjectFileELF &TLOFELF =
+ static_cast<const TargetLoweringObjectFileELF &>(getObjFileLowering());
+
+ MachineModuleInfoELF &MMIELF = MMI->getObjFileInfo<MachineModuleInfoELF>();
+
+ // Output stubs for external and common global variables.
+ MachineModuleInfoELF::SymbolListTy Stubs = MMIELF.GetGVStubList();
+ if (!Stubs.empty()) {
+ OutStreamer.SwitchSection(TLOFELF.getDataRelSection());
+ const DataLayout *TD = TM.getDataLayout();
+
+ for (auto &stub: Stubs) {
+ OutStreamer.EmitLabel(stub.first);
+ OutStreamer.EmitSymbolValue(stub.second.getPointer(),
+ TD->getPointerSize(0));
+ }
+ Stubs.clear();
+ }
+ }
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud