diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 666781aa64b3..b25dc34b0faf 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -471,6 +471,8 @@ InputSectionBase *ObjFile::createInputSection(const Elf_Shdr &Sec) { switch (Sec.sh_type) { case SHT_ARM_ATTRIBUTES: { + if (Config->EMachine != EM_ARM) + break; ARMAttributeParser Attributes; ArrayRef Contents = check(this->getObj().getSectionContents(&Sec)); Attributes.Parse(Contents, /*isLittle*/Config->EKind == ELF32LEKind);