aboutsummaryrefslogtreecommitdiff
path: root/lib/MC/MCObjectFileInfo.cpp
diff options
context:
space:
mode:
authorPetar Jovanovic <petarj@mips.com>2012-10-23 14:24:03 -0700
committerDerek Schuff <dschuff@chromium.org>2012-10-23 14:24:03 -0700
commit56f8ef8fa45d5f444766f52cdeb956982578f1b5 (patch)
treee5d6a231a1db37cbdc86c3c7a8ad9cfcdd0dce38 /lib/MC/MCObjectFileInfo.cpp
parent4ce160aa277821da7b43fb457672a625facbad12 (diff)
[MIPS] Update sandboxing changes for LLVM on MIPS.
This change - resolves conflicts from previous merges; - prevents delay slot filler to use instructions that could be masked; - generates calls to __nacl_read_tp to access thread pointer; - removes previous (now obsolete) sandboxing code of unaligned loads and stores; - propagates relocation model to MipsELFObjectWriter, so that it can set flag ELF::EF_MIPS_PIC (small hack). BUG= http://code.google.com/p/nativeclient/issues/detail?id=2275 TEST= pnacl/build.sh all Review URL: https://codereview.chromium.org/11115013 Patch from Petar Jovanovic <petarj@mips.com>.
Diffstat (limited to 'lib/MC/MCObjectFileInfo.cpp')
-rw-r--r--lib/MC/MCObjectFileInfo.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/MC/MCObjectFileInfo.cpp b/lib/MC/MCObjectFileInfo.cpp
index 2e1604d6b5..3338a17e5c 100644
--- a/lib/MC/MCObjectFileInfo.cpp
+++ b/lib/MC/MCObjectFileInfo.cpp
@@ -543,9 +543,16 @@ void MCObjectFileInfo::InitCOFFMCObjectFileInfo(Triple T) {
SectionKind::getDataRel());
}
+// @LOCALMOD-START
+// TODO(petarj): HACK! Find a better way to set ELF::EF_MIPS_PIC flag.
+// See also file lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp.
+Reloc::Model RelocModelOption = Reloc::Default;
+// @LOCALMOD-END
+
void MCObjectFileInfo::InitMCObjectFileInfo(StringRef TT, Reloc::Model relocm,
CodeModel::Model cm,
MCContext &ctx) {
+ RelocModelOption = relocm; // @LOCALMOD
RelocM = relocm;
CMModel = cm;
Ctx = &ctx;