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

Unified Diff: src/IceFixups.cpp

Issue 1506653002: Subzero: Add Non-SFI support for x86-32. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 4 years, 12 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/IceFixups.h ('k') | src/IceGlobalContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceFixups.cpp
diff --git a/src/IceFixups.cpp b/src/IceFixups.cpp
index 59bd4f32b31a3a5e9b3af0902e3196e48cb79241..ef594acb8ed87837cb39aebde1b630507eed4d47 100644
--- a/src/IceFixups.cpp
+++ b/src/IceFixups.cpp
@@ -29,7 +29,8 @@ RelocOffsetT AssemblerFixup::offset() const {
return 0;
}
-IceString AssemblerFixup::symbol(const GlobalContext *Ctx) const {
+IceString AssemblerFixup::symbol(const GlobalContext *Ctx,
+ const Assembler *Asm) const {
std::string Buffer;
llvm::raw_string_ostream Str(Buffer);
const Constant *C = value_;
@@ -39,6 +40,9 @@ IceString AssemblerFixup::symbol(const GlobalContext *Ctx) const {
Str << CR->getName();
else
Str << Ctx->mangleName(CR->getName());
+ if (Asm && !Asm->fixupIsPCRel(kind()) && Ctx->getFlags().getUseNonsfi()) {
+ Str << "@GOTOFF";
+ }
} else {
// NOTE: currently only float/doubles are put into constant pools. In the
// future we may put integers as well.
@@ -57,7 +61,7 @@ size_t AssemblerFixup::emit(GlobalContext *Ctx, const Assembler &Asm) const {
if (isNullSymbol())
Str << "__Sz_AbsoluteZero";
else
- Str << symbol(Ctx);
+ Str << symbol(Ctx, &Asm);
RelocOffsetT Offset = Asm.load<RelocOffsetT>(position());
if (Offset)
Str << " + " << Offset;
« no previous file with comments | « src/IceFixups.h ('k') | src/IceGlobalContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698