diff options
author | Eric Christopher <echristo@gmail.com> | 2018-09-06 22:09:31 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2018-09-06 22:09:31 +0000 |
commit | fe83270ee9ad66548326625a170ac062079556d0 (patch) | |
tree | b600d892a0905f2039d7a59dd3fdb93639664f11 /llvm/lib/MC/MCSection.cpp | |
parent | 950a1a393675c806e24f803a33e6ece7652c4160 (diff) | |
download | bcm5719-llvm-fe83270ee9ad66548326625a170ac062079556d0.tar.gz bcm5719-llvm-fe83270ee9ad66548326625a170ac062079556d0.zip |
The initial .text section generated in object files was missing the
SHF_ARM_PURECODE flag when being built with the -mexecute-only flag.
All code sections of an ELF must have the flag set for the final .text
section to be execute-only, otherwise the flag gets removed.
A HasData flag is added to MCSection to aid in the determination that
the section is empty. A virtual setTargetSectionFlags is added to
MCELFObjectTargetWriter to allow subclasses to set target specific
section flags to be added to sections which we then use in the ARM
backend to set SHF_ARM_PURECODE.
Patch by Ivan Lozano!
Reviewed By: echristo
Differential Revision: https://reviews.llvm.org/D48792
llvm-svn: 341593
Diffstat (limited to 'llvm/lib/MC/MCSection.cpp')
-rw-r--r-- | llvm/lib/MC/MCSection.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCSection.cpp b/llvm/lib/MC/MCSection.cpp index 97bc65387dd..d4f11d10136 100644 --- a/llvm/lib/MC/MCSection.cpp +++ b/llvm/lib/MC/MCSection.cpp @@ -23,7 +23,8 @@ using namespace llvm; MCSection::MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin) : Begin(Begin), BundleGroupBeforeFirstInst(false), HasInstructions(false), - IsRegistered(false), DummyFragment(this), Variant(V), Kind(K) {} + HasData(false), IsRegistered(false), DummyFragment(this), Variant(V), + Kind(K) {} MCSymbol *MCSection::getEndSymbol(MCContext &Ctx) { if (!End) |