OSDN Git Service

[ARM] Support constant pools in data when generating execute-only code.
authorAlexandros Lamprineas <alexandros.lamprineas@arm.com>
Tue, 20 Jun 2017 07:20:52 +0000 (07:20 +0000)
committerAlexandros Lamprineas <alexandros.lamprineas@arm.com>
Tue, 20 Jun 2017 07:20:52 +0000 (07:20 +0000)
commit46e03a371d6dce1330c7fd0e3875be0268314d7c
treec678d5818d81040807618c6e5071fcfb92922908
parent73b64dd42f5f4c3700e334e2cfacfeca42c745f3
[ARM] Support constant pools in data when generating execute-only code.

Resubmission of r305387, which was reverted at r305390. The Address
Sanitizer caught a stack-use-after-scope of a Twine variable. This
is now fixed by passing the Twine directly as a function parameter.

The ARM backend asserts against constant pool lowering when it generates
execute-only code in order to prevent the generation of constant pools in
the text section. It appears that target independent optimizations might
generate DAG nodes that represent constant pools. By lowering such nodes
as global addresses we don't violate the semantics of execute-only code
and also it is guaranteed that execute-only behaves correct with the
position-independent addressing modes that support execute-only code.

Differential Revision: https://reviews.llvm.org/D33773

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305776 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMAsmPrinter.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMISelLowering.h
test/CodeGen/ARM/constantfp.ll