Add support for RISC-V attributes (#459)
[pyelftools.git] / elftools / elf / elffile.py
index 59f657b720624337d116c6d57b819d7b25fee05d..0a945c6b6f4cff0f3dd06f211d62dbbc3279c8ce 100644 (file)
@@ -30,7 +30,7 @@ from .structs import ELFStructs
 from .sections import (
         Section, StringTableSection, SymbolTableSection,
         SymbolTableIndexSection, SUNWSyminfoTableSection, NullSection,
-        NoteSection, StabSection, ARMAttributesSection)
+        NoteSection, StabSection, ARMAttributesSection, RISCVAttributesSection)
 from .dynamic import DynamicSection, DynamicSegment
 from .relocation import (RelocationSection, RelocationHandler,
         RelrRelocationSection)
@@ -662,6 +662,8 @@ class ELFFile(object):
             return StabSection(section_header, name, self)
         elif sectype == 'SHT_ARM_ATTRIBUTES':
             return ARMAttributesSection(section_header, name, self)
+        elif sectype == 'SHT_RISCV_ATTRIBUTES':
+            return RISCVAttributesSection(section_header, name, self)
         elif sectype == 'SHT_HASH':
             return self._make_elf_hash_section(section_header, name)
         elif sectype == 'SHT_GNU_HASH':