diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-26 12:44:10 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-06-26 12:44:10 +0000 |
commit | edd5f84419db0228d8379f5287c3ae26426f47d6 (patch) | |
tree | 346e1280851d8da47edf199cb41ceeff0c20357f /llvm/lib | |
parent | 41401e9c803c52af38cf0ad7813c35b5336006a4 (diff) | |
download | bcm5719-llvm-edd5f84419db0228d8379f5287c3ae26426f47d6.tar.gz bcm5719-llvm-edd5f84419db0228d8379f5287c3ae26426f47d6.zip |
Expose getFlags via ELFSectionRef.
llvm-svn: 240779
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp index fdb634e888c..489589ef1f8 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp @@ -266,10 +266,10 @@ computeAllocationSizeForSections(std::vector<uint64_t> &SectionSizes, return TotalSize; } -static bool isRequiredForExecution(const SectionRef &Section) { +static bool isRequiredForExecution(const SectionRef Section) { const ObjectFile *Obj = Section.getObject(); - if (auto *ELFObj = dyn_cast<object::ELFObjectFileBase>(Obj)) - return ELFObj->getSectionFlags(Section) & ELF::SHF_ALLOC; + if (isa<object::ELFObjectFileBase>(Obj)) + return ELFSectionRef(Section).getFlags() & ELF::SHF_ALLOC; if (auto *COFFObj = dyn_cast<object::COFFObjectFile>(Obj)) { const coff_section *CoffSection = COFFObj->getCOFFSection(Section); // Avoid loading zero-sized COFF sections. @@ -286,12 +286,12 @@ static bool isRequiredForExecution(const SectionRef &Section) { assert(isa<MachOObjectFile>(Obj)); return true; - } +} -static bool isReadOnlyData(const SectionRef &Section) { +static bool isReadOnlyData(const SectionRef Section) { const ObjectFile *Obj = Section.getObject(); - if (auto *ELFObj = dyn_cast<object::ELFObjectFileBase>(Obj)) - return !(ELFObj->getSectionFlags(Section) & + if (isa<object::ELFObjectFileBase>(Obj)) + return !(ELFSectionRef(Section).getFlags() & (ELF::SHF_WRITE | ELF::SHF_EXECINSTR)); if (auto *COFFObj = dyn_cast<object::COFFObjectFile>(Obj)) return ((COFFObj->getCOFFSection(Section)->Characteristics & |