llvm.org GIT mirror llvm / 2b7e17b
If necessary for indirect encodings, emit stubs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207730 91177308-0d34-0410-b5e6-96231b3b80d8 Joerg Sonnenberger 6 years ago
1 changed file(s) with 22 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
544544 // generates code that does this, it is always safe to set.
545545 OutStreamer.EmitAssemblerFlag(MCAF_SubsectionsViaSymbols);
546546 }
547
548 // Emit a .data.rel section containing any stubs that were created.
549 if (Subtarget->isTargetELF()) {
550 const TargetLoweringObjectFileELF &TLOFELF =
551 static_cast(getObjFileLowering());
552
553 MachineModuleInfoELF &MMIELF = MMI->getObjFileInfo();
554
555 // Output stubs for external and common global variables.
556 MachineModuleInfoELF::SymbolListTy Stubs = MMIELF.GetGVStubList();
557 if (!Stubs.empty()) {
558 OutStreamer.SwitchSection(TLOFELF.getDataRelSection());
559 const DataLayout *TD = TM.getDataLayout();
560
561 for (auto &stub: Stubs) {
562 OutStreamer.EmitLabel(stub.first);
563 OutStreamer.EmitSymbolValue(stub.second.getPointer(),
564 TD->getPointerSize(0));
565 }
566 Stubs.clear();
567 }
568 }
547569 }
548570
549571 //===----------------------------------------------------------------------===//