Mips.abiflags is a new implicitly generated section that will be present on all new modules. The section contains a versioned data structure which represents essentially information to allow a program loader to determine the requirements of the application. This patch implements mips.abiflags section and provides test cases for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212519 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vladimir Medic
2014-07-08 08:59:22 +00:00
parent 25b7d54e7f
commit ffbc2a1325
18 changed files with 804 additions and 68 deletions
+16 -1
View File
@@ -92,6 +92,8 @@ bool MipsAsmPrinter::lowerOperand(const MachineOperand &MO, MCOperand &MCOp) {
#include "MipsGenMCPseudoLowering.inc"
void MipsAsmPrinter::EmitInstruction(const MachineInstr *MI) {
MipsTargetStreamer &TS = getTargetStreamer();
TS.setCanHaveModuleDir(false);
if (MI->isDebugValue()) {
SmallString<128> Str;
raw_svector_ostream OS(Str);
@@ -657,6 +659,19 @@ void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
OutContext.getELFSection(".gcc_compiled_long64", ELF::SHT_PROGBITS, 0,
SectionKind::getDataRel()));
}
getTargetStreamer().updateABIInfo(*Subtarget);
unsigned FpAbiVal;
if (Subtarget->isABI_N32() || Subtarget->isABI_N64())
FpAbiVal = Val_GNU_MIPS_ABI_FP_DOUBLE;
else if(Subtarget->isABI_O32()) {
if (Subtarget->isFP64bit())
FpAbiVal = Val_GNU_MIPS_ABI_FP_64;
else if(Subtarget->isABI_FPXX())
FpAbiVal = Val_GNU_MIPS_ABI_FP_XX;
else
FpAbiVal = Val_GNU_MIPS_ABI_FP_DOUBLE;
}
getTargetStreamer().emitDirectiveModule(FpAbiVal, Subtarget->isABI_O32());
}
void MipsAsmPrinter::EmitJal(MCSymbol *Symbol) {
@@ -852,7 +867,7 @@ void MipsAsmPrinter::EmitFPCallStub(
TS.emitDirectiveSetNoMicroMips();
//
// .ent __call_stub_fp_xxxx
// .type __call_stub_fp_xxxx,@function
// .type __call_stub_fp_xxxx,@function
// __call_stub_fp_xxxx:
//
std::string x = "__call_stub_fp_" + std::string(Symbol);