[ELF] Make sure SHT_ARM_ATTRIBUTES is only recognized by Arm Targets

The SHT_ARM_ATTRIBUTES section type is in the processor specific space
adding guard to make sure that it is only recognized when EMachine is
EM_ARM.

llvm-svn: 319304
This commit is contained in:
Peter Smith
2017-11-29 10:20:46 +00:00
parent 9ea2eaeb50
commit 8fca2e12ab

View File

@@ -471,6 +471,8 @@ InputSectionBase *ObjFile<ELFT>::createInputSection(const Elf_Shdr &Sec) {
switch (Sec.sh_type) {
case SHT_ARM_ATTRIBUTES: {
if (Config->EMachine != EM_ARM)
break;
ARMAttributeParser Attributes;
ArrayRef<uint8_t> Contents = check(this->getObj().getSectionContents(&Sec));
Attributes.Parse(Contents, /*isLittle*/Config->EKind == ELF32LEKind);