Skip to content

Commit

Permalink
RISCV: add support to describe gnu notes
Browse files Browse the repository at this point in the history
Signed-off-by: Jerry Zhang Jian <jerry.zhangjian@sifive.com>
  • Loading branch information
jerryzj committed Dec 20, 2024
1 parent f0383db commit 62cfc3f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions elftools/elf/descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ def describe_note_gnu_properties(properties, machine):
prop_desc = ' <corrupt length: 0x%x>' % sz
else:
prop_desc = describe_note_gnu_property_bitmap_and(_DESCR_NOTE_GNU_PROPERTY_AARCH64_FEATURE_1_AND, 'aarch64 feature', d)
elif t == 'GNU_PROPERTY_AARCH64_FEATURE_1_AND' and machine == 'EM_RISCV':
# RISC-V shares the same bit-mask with AArch64
if sz != 4:
prop_desc = ' <corrupt length: 0x%x>' % sz
else:
prop_desc = describe_note_gnu_property_bitmap_and(_DESCR_NOTE_GNU_PROPERTY_RISCV_FEATURE_1_AND, 'RISC-V AND feature', d)
elif _DESCR_NOTE_GNU_PROPERTY_TYPE_LOPROC <= t <= _DESCR_NOTE_GNU_PROPERTY_TYPE_HIPROC:
prop_desc = '<processor-specific type 0x%x data: %s >' % (t, bytes2hex(d, sep=' '))
elif _DESCR_NOTE_GNU_PROPERTY_TYPE_LOUSER <= t <= _DESCR_NOTE_GNU_PROPERTY_TYPE_HIUSER:
Expand Down

0 comments on commit 62cfc3f

Please sign in to comment.