Skip to content

Commit

Permalink
Missed some CPU specific section types (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
sevaa authored Apr 29, 2024
1 parent 75f0f98 commit 433da27
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions elftools/elf/descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,12 @@ def describe_note_gnu_properties(properties, machine):
SHT_GNU_verneed='VERNEED',
SHT_GNU_versym='VERSYM',
SHT_GNU_LIBLIST='GNU_LIBLIST',
SHT_AMD64_UNWIND='X86_64_UNWIND',
SHT_ARM_EXIDX='ARM_EXIDX',
SHT_ARM_PREEMPTMAP='ARM_PREEMPTMAP',
SHT_ARM_ATTRIBUTES='ARM_ATTRIBUTES',
SHT_ARM_DEBUGOVERLAY='ARM_DEBUGOVERLAY',
SHT_AARCH64_ATTRIBUTES='AARCH64_ATTRIBUTES',
SHT_RISCV_ATTRIBUTES='RISCV_ATTRIBUTES',
SHT_MIPS_LIBLIST='MIPS_LIBLIST',
SHT_MIPS_DEBUG='MIPS_DEBUG',
Expand Down
4 changes: 4 additions & 0 deletions elftools/elf/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@
SHT_ARM_ATTRIBUTES=0x70000003,
SHT_ARM_DEBUGOVERLAY=0x70000004))

ENUM_SH_TYPE_AARCH64 = merge_dicts(
ENUM_SH_TYPE_BASE,
dict(SHT_AARCH64_ATTRIBUTES=0x70000003))

ENUM_SH_TYPE_RISCV = merge_dicts(
ENUM_SH_TYPE_BASE,
dict(SHT_RISCV_ATTRIBUTES=0x70000003))
Expand Down
2 changes: 2 additions & 0 deletions elftools/elf/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ def _create_shdr(self):
sh_type_dict = ENUM_SH_TYPE_BASE
if self.e_machine == 'EM_ARM':
sh_type_dict = ENUM_SH_TYPE_ARM
elif self.e_machine == 'EM_AARCH64':
sh_type_dict = ENUM_SH_TYPE_AARCH64
elif self.e_machine == 'EM_X86_64':
sh_type_dict = ENUM_SH_TYPE_AMD64
elif self.e_machine == 'EM_MIPS':
Expand Down

0 comments on commit 433da27

Please sign in to comment.