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

Unified Diff: src/IceTargetLoweringX8664.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/IceTargetLoweringX8632Traits.h ('k') | src/IceTargetLoweringX8664Traits.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX8664.cpp
diff --git a/src/IceTargetLoweringX8664.cpp b/src/IceTargetLoweringX8664.cpp
index 2008afa3b987fdcda0167a988eb091569cc6d35f..0616ba104690ce1140db45565e3499f1713e3575 100644
--- a/src/IceTargetLoweringX8664.cpp
+++ b/src/IceTargetLoweringX8664.cpp
@@ -32,7 +32,9 @@ createTargetHeaderLowering(::Ice::GlobalContext *Ctx) {
return ::Ice::X8664::TargetHeaderX8664::create(Ctx);
}
-void staticInit() { ::Ice::X8664::TargetX8664::staticInit(); }
+void staticInit(const ::Ice::ClFlags &Flags) {
+ ::Ice::X8664::TargetX8664::staticInit(Flags);
+}
} // end of namespace X8664
namespace Ice {
@@ -112,6 +114,14 @@ template <>
llvm::SmallBitVector
TargetX86Base<X8664::Traits>::ScratchRegs = llvm::SmallBitVector();
+template <>
+FixupKind TargetX86Base<X8664::Traits>::PcRelFixup =
+ TargetX86Base<X8664::Traits>::Traits::FK_PcRel;
+
+template <>
+FixupKind TargetX86Base<X8664::Traits>::AbsFixup =
+ TargetX86Base<X8664::Traits>::Traits::FK_Abs;
+
//------------------------------------------------------------------------------
// __ ______ __ __ ______ ______ __ __ __ ______
// /\ \ /\ __ \/\ \ _ \ \/\ ___\/\ == \/\ \/\ "-.\ \/\ ___\
@@ -348,7 +358,7 @@ void TargetX8664::lowerCall(const InstCall *Instr) {
void TargetX8664::lowerArguments() {
VarList &Args = Func->getArgs();
- // The first eight vetcor typed arguments (as well as fp arguments) are
+ // The first eight vector typed arguments (as well as fp arguments) are
// passed in %xmm0 through %xmm7 regardless of their position in the argument
// list.
unsigned NumXmmArgs = 0;
@@ -890,11 +900,12 @@ void TargetDataX8664::lowerConstants() {
}
void TargetDataX8664::lowerJumpTables() {
+ const bool IsPIC = Ctx->getFlags().getUseNonsfi();
switch (Ctx->getFlags().getOutFileType()) {
case FT_Elf: {
ELFObjectWriter *Writer = Ctx->getObjectWriter();
for (const JumpTableData &JumpTable : Ctx->getJumpTables())
- Writer->writeJumpTable(JumpTable, TargetX8664::Traits::RelFixup);
+ Writer->writeJumpTable(JumpTable, TargetX8664::Traits::FK_Abs, IsPIC);
} break;
case FT_Asm:
// Already emitted from Cfg
@@ -920,11 +931,12 @@ void TargetDataX8664::lowerJumpTables() {
void TargetDataX8664::lowerGlobals(const VariableDeclarationList &Vars,
const IceString &SectionSuffix) {
+ const bool IsPIC = Ctx->getFlags().getUseNonsfi();
switch (Ctx->getFlags().getOutFileType()) {
case FT_Elf: {
ELFObjectWriter *Writer = Ctx->getObjectWriter();
- Writer->writeDataSection(Vars, TargetX8664::Traits::RelFixup,
- SectionSuffix);
+ Writer->writeDataSection(Vars, TargetX8664::Traits::FK_Abs, SectionSuffix,
+ IsPIC);
} break;
case FT_Asm:
case FT_Iasm: {
« no previous file with comments | « src/IceTargetLoweringX8632Traits.h ('k') | src/IceTargetLoweringX8664Traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698