mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
If necessary for indirect encodings, emit stubs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207730 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b77f8919bc
commit
2b7e17bcbd
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
Reference in New Issue
Block a user