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

Unified Diff: src/IceAssemblerARM32.cpp

Issue 1773503003: Subzero: Control memory growth from local label fixups. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Attempt to fix -nonsfi -filetype=iasm -target=arm32 Created 4 years, 9 months 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/IceAssemblerARM32.h ('k') | src/IceELFObjectWriter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceAssemblerARM32.cpp
diff --git a/src/IceAssemblerARM32.cpp b/src/IceAssemblerARM32.cpp
index 11175373c63620dc70546d7ee55cb734cf7140fb..613fa7772b78d58ca188bdfdf50a74c32db844c4 100644
--- a/src/IceAssemblerARM32.cpp
+++ b/src/IceAssemblerARM32.cpp
@@ -593,11 +593,16 @@ size_t MoveRelocatableFixup::emit(GlobalContext *Ctx,
IValueT Inst = Asm.load<IValueT>(position());
const bool IsMovw = kind() == llvm::ELF::R_ARM_MOVW_ABS_NC ||
kind() == llvm::ELF::R_ARM_MOVW_PREL_NC;
+ const IceString Symbol = symbol();
+ const bool NeedsPCRelSuffix =
+ (Asm.fixupIsPCRel(kind()) || Symbol == GlobalOffsetTable);
Str << "\t"
"mov" << (IsMovw ? "w" : "t") << "\t"
<< RegARM32::getRegName(RegNumT::fixme((Inst >> kRdShift) & 0xF))
- << ", #:" << (IsMovw ? "lower" : "upper") << "16:" << symbol(&Asm)
- << "\t@ .word " << llvm::format_hex_no_prefix(Inst, 8) << "\n";
+ << ", #:" << (IsMovw ? "lower" : "upper") << "16:" << Symbol
+ << (NeedsPCRelSuffix ? " - ." : "") << "\t@ .word "
+ // TODO(jpp): This is broken, it also needs to add a magic constant.
+ << llvm::format_hex_no_prefix(Inst, 8) << "\n";
return InstARM32::InstSize;
}
@@ -650,7 +655,7 @@ size_t BlRelocatableFixup::emit(GlobalContext *Ctx,
Ostream &Str = Ctx->getStrEmit();
IValueT Inst = Asm.load<IValueT>(position());
Str << "\t"
- "bl\t" << symbol(&Asm) << "\t@ .word "
+ "bl\t" << symbol() << "\t@ .word "
<< llvm::format_hex_no_prefix(Inst, 8) << "\n";
return InstARM32::InstSize;
}
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceELFObjectWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698