Index: src/IceTargetLoweringMIPS32.cpp |
diff --git a/src/IceTargetLoweringMIPS32.cpp b/src/IceTargetLoweringMIPS32.cpp |
index 995711298a6e669acd79690dce819fab1deff371..c3b52e5dd676d15072d069278b946f8d93de4a50 100644 |
--- a/src/IceTargetLoweringMIPS32.cpp |
+++ b/src/IceTargetLoweringMIPS32.cpp |
@@ -4982,6 +4982,22 @@ void ConstantUndef::emit(GlobalContext *) const { |
TargetDataMIPS32::TargetDataMIPS32(GlobalContext *Ctx) |
: TargetDataLowering(Ctx) {} |
+// Generate .MIPS.abiflags section. This section contains a versioned data |
+// structure with essential information required for loader to determine the |
+// requirements of the application. |
+void TargetDataMIPS32::emitTargetRODataSections() { |
+ struct MipsABIFlagsSection Flags; |
+ ELFObjectWriter *Writer = Ctx->getObjectWriter(); |
+ const std::string Name = ".MIPS.abiflags"; |
+ const llvm::ELF::Elf64_Word ShType = llvm::ELF::SHT_MIPS_ABIFLAGS; |
+ const llvm::ELF::Elf64_Xword ShFlags = llvm::ELF::SHF_ALLOC; |
+ const llvm::ELF::Elf64_Xword ShAddralign = 8; |
+ const llvm::ELF::Elf64_Xword ShEntsize = sizeof(Flags); |
+ Writer->writeTargetRODataSection( |
+ Name, ShType, ShFlags, ShAddralign, ShEntsize, |
+ llvm::StringRef(reinterpret_cast<const char *>(&Flags), sizeof(Flags))); |
+} |
+ |
void TargetDataMIPS32::lowerGlobals(const VariableDeclarationList &Vars, |
const std::string &SectionSuffix) { |
const bool IsPIC = getFlags().getUseNonsfi(); |