Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: src/IceTargetLoweringMIPS32.cpp

Issue 2471883005: [SubZero] Generate MIPS.abiflags section (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressed review comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceTargetLoweringMIPS32.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/IceTargetLoweringMIPS32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698