mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Add support for the R_ARM_TARGET1 relocation, which should be given to relocations applied to all C++ constructors and destructors.
This enables the linker to match concrete relocation types (absolute or relative) with whatever library or C++ support code is being linked against. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149057 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -299,6 +299,22 @@ void ARMAsmPrinter::EmitFunctionEntryLabel() {
|
||||
OutStreamer.EmitLabel(CurrentFnSym);
|
||||
}
|
||||
|
||||
void ARMAsmPrinter::EmitXXStructor(const Constant *CV) {
|
||||
uint64_t Size = TM.getTargetData()->getTypeAllocSize(CV->getType());
|
||||
assert(Size && "C++ constructor pointer had zero size!");
|
||||
|
||||
const GlobalValue *GV = dyn_cast<GlobalValue>(CV);
|
||||
assert(GV && "C++ constructor pointer was not a GlobalValue!");
|
||||
|
||||
const MCExpr *E = MCSymbolRefExpr::Create(Mang->getSymbol(GV),
|
||||
(Subtarget->isTargetDarwin()
|
||||
? MCSymbolRefExpr::VK_None
|
||||
: MCSymbolRefExpr::VK_ARM_TARGET1),
|
||||
OutContext);
|
||||
|
||||
OutStreamer.EmitValue(E, Size);
|
||||
}
|
||||
|
||||
/// runOnMachineFunction - This uses the EmitInstruction()
|
||||
/// method to print assembly for each instruction.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user