diff options
author | Sasa Stankovic <Sasa.Stankovic@imgtec.com> | 2014-02-28 10:00:38 +0000 |
---|---|---|
committer | Sasa Stankovic <Sasa.Stankovic@imgtec.com> | 2014-02-28 10:00:38 +0000 |
commit | 068a8c145ac387e4c3b8754b34b3d685b86cb7c5 (patch) | |
tree | 9f8f78c0c27c43f93375976221e58be6b3ecf068 /lib/Target/Mips/MCTargetDesc/MipsMCNaCl.h | |
parent | 72c42d93416b9aac1750389a862d569948612c53 (diff) | |
download | llvm-068a8c145ac387e4c3b8754b34b3d685b86cb7c5.tar.gz llvm-068a8c145ac387e4c3b8754b34b3d685b86cb7c5.tar.bz2 llvm-068a8c145ac387e4c3b8754b34b3d685b86cb7c5.tar.xz |
[mips] Implement NaCl sandboxing of indirect jumps:
* Align targets of indirect jumps to instruction bundle boundaries (in MI layer).
* Add masking instructions before indirect jumps (in MC layer).
Differential Revision: http://llvm-reviews.chandlerc.com/D2847
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202479 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MCTargetDesc/MipsMCNaCl.h')
-rw-r--r-- | lib/Target/Mips/MCTargetDesc/MipsMCNaCl.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/Target/Mips/MCTargetDesc/MipsMCNaCl.h b/lib/Target/Mips/MCTargetDesc/MipsMCNaCl.h new file mode 100644 index 0000000000..62d67d9f3f --- /dev/null +++ b/lib/Target/Mips/MCTargetDesc/MipsMCNaCl.h @@ -0,0 +1,28 @@ +//===-- MipsMCNaCl.h - NaCl-related declarations --------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef MIPSMCNACL_H +#define MIPSMCNACL_H + +#include "llvm/MC/MCELFStreamer.h" + +namespace llvm { + +// Log2 of the NaCl MIPS sandbox's instruction bundle size. +static const unsigned MIPS_NACL_BUNDLE_ALIGN = 4u; + +// This function creates an MCELFStreamer for Mips NaCl. +MCELFStreamer *createMipsNaClELFStreamer(MCContext &Context, MCAsmBackend &TAB, + raw_ostream &OS, + MCCodeEmitter *Emitter, + bool RelaxAll, bool NoExecStack); + +} + +#endif |