[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
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 666781a..b25dc34 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -471,6 +471,8 @@
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);