summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorPrakhar Bahuguna <prakhar.bahuguna@arm.com>2016-12-15 07:59:08 +0000
committerPrakhar Bahuguna <prakhar.bahuguna@arm.com>2016-12-15 07:59:08 +0000
commit52a7dd7d7825b269ae569db0e2bcb193c7698666 (patch)
tree7957bd2c8f0c07fbbcfdc331ca848a051dab6613 /llvm/tools
parent342beeb91eb03ce92e598d593325c8475673768e (diff)
downloadbcm5719-llvm-52a7dd7d7825b269ae569db0e2bcb193c7698666.tar.gz
bcm5719-llvm-52a7dd7d7825b269ae569db0e2bcb193c7698666.zip
[ARM] Implement execute-only support in CodeGen
This implements execute-only support for ARM code generation, which prevents the compiler from generating data accesses to code sections. The following changes are involved: * Add the CodeGen option "-arm-execute-only" to the ARM code generator. * Add the clang flag "-mexecute-only" as well as the GCC-compatible alias "-mpure-code" to enable this option. * When enabled, literal pools are replaced with MOVW/MOVT instructions, with VMOV used in addition for floating-point literals. As the MOVT instruction is required, execute-only support is only available in Thumb mode for targets supporting ARMv8-M baseline or Thumb2. * Jump tables are placed in data sections when in execute-only mode. * The execute-only text section is assigned section ID 0, and is marked as unreadable with the SHF_ARM_PURECODE flag with symbol 'y'. This also overrides selection of ELF sections for globals. llvm-svn: 289784
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llvm-readobj/ELFDumper.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index 801bc8eca2a..e939135b612 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -1069,6 +1069,10 @@ static const EnumEntry<unsigned> ElfAMDGPUSectionFlags[] = {
LLVM_READOBJ_ENUM_ENT(ELF, SHF_AMDGPU_HSA_AGENT)
};
+static const EnumEntry<unsigned> ElfARMSectionFlags[] = {
+ LLVM_READOBJ_ENUM_ENT(ELF, SHF_ARM_PURECODE)
+};
+
static const EnumEntry<unsigned> ElfHexagonSectionFlags[] = {
LLVM_READOBJ_ENUM_ENT(ELF, SHF_HEX_GPREL)
};
@@ -3596,6 +3600,10 @@ template <class ELFT> void LLVMStyle<ELFT>::printSections(const ELFO *Obj) {
SectionFlags.insert(SectionFlags.end(), std::begin(ElfAMDGPUSectionFlags),
std::end(ElfAMDGPUSectionFlags));
break;
+ case EM_ARM:
+ SectionFlags.insert(SectionFlags.end(), std::begin(ElfARMSectionFlags),
+ std::end(ElfARMSectionFlags));
+ break;
case EM_HEXAGON:
SectionFlags.insert(SectionFlags.end(),
std::begin(ElfHexagonSectionFlags),
OpenPOWER on IntegriCloud