mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
MC-ize the stub printing in ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98018 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6cde3e6e99
commit
becd83e3f4
@ -33,6 +33,7 @@
|
||||
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/MC/MCExpr.h"
|
||||
#include "llvm/MC/MCInst.h"
|
||||
#include "llvm/MC/MCSectionMachO.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
@ -1128,17 +1129,29 @@ void ARMAsmPrinter::EmitEndOfAsmFile(Module &M) {
|
||||
OutStreamer.SwitchSection(TLOFMacho.getNonLazySymbolPointerSection());
|
||||
EmitAlignment(2);
|
||||
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
||||
O << *Stubs[i].first << ":\n\t.indirect_symbol ";
|
||||
O << *Stubs[i].second << "\n\t.long\t0\n";
|
||||
// L_foo$stub:
|
||||
OutStreamer.EmitLabel(Stubs[i].first);
|
||||
// .indirect_symbol _foo
|
||||
OutStreamer.EmitSymbolAttribute(Stubs[i].second, MCSA_IndirectSymbol);
|
||||
OutStreamer.EmitIntValue(0, 4/*size*/, 0/*addrspace*/);
|
||||
}
|
||||
|
||||
Stubs.clear();
|
||||
OutStreamer.AddBlankLine();
|
||||
}
|
||||
|
||||
Stubs = MMIMacho.GetHiddenGVStubList();
|
||||
if (!Stubs.empty()) {
|
||||
OutStreamer.SwitchSection(getObjFileLowering().getDataSection());
|
||||
EmitAlignment(2);
|
||||
for (unsigned i = 0, e = Stubs.size(); i != e; ++i)
|
||||
O << *Stubs[i].first << ":\n\t.long " << *Stubs[i].second << "\n";
|
||||
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
||||
// L_foo$stub:
|
||||
OutStreamer.EmitLabel(Stubs[i].first);
|
||||
// .long _foo
|
||||
OutStreamer.EmitValue(MCSymbolRefExpr::Create(Stubs[i].second,
|
||||
OutContext),
|
||||
4/*size*/, 0/*addrspace*/);
|
||||
}
|
||||
}
|
||||
|
||||
// Funny Darwin hack: This flag tells the linker that no global symbols
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Type.h"
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/MC/MCExpr.h"
|
||||
#include "llvm/MC/MCSectionMachO.h"
|
||||
@ -36,7 +37,6 @@
|
||||
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include "llvm/Support/FormattedStream.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/Target/Mangler.h"
|
||||
#include "llvm/Target/TargetOptions.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user