eliben / pyelftools

Parsing ELF and DWARF in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cortex M85 elf binary error: no decoding mapping for 48 [tag]

Tomal-kuet opened this issue · comments

I am trying to construct CFG using angr for Cortex-m85 binary compiled with ARM LLVM Embedded Toolchain clang 16.0.0. I am getting the following error:

elftools.common.exceptions.ELFParseError: no decoding mapping for 48 [tag]

The angr python code:

proj = angr.Project('my_binary.axf', main_opts={'arch': 'ArchARMCortexM'})

or

arch = archinfo.ArchARM(archinfo.Endness.LE)
proj = angr.Project(file_path, arch=arch)

angr version: 9.2.91
elftools version: 0.30

Can anyone please tell me what I am doing wrong?

Below is the readelf output:

ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x110013b9
  Start of program headers:          52 (bytes into file)
  Start of section headers:          209148 (bytes into file)
  Flags:                             0x5000400, Version5 EABI, hard-float ABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         6
  Size of section headers:           40 (bytes)
  Number of section headers:         28
  Section header string table index: 26

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        11000000 010000 00369c 00 AXMS  0   0  8
  [ 2] .gnu.sgstubs      PROGBITS        110036a0 0136a0 000000 00  AX  0   0 32
  [ 3] .ARM.exidx        ARM_EXIDX       110036a0 0136a0 000010 00  AL  1   0  4
  [ 4] .copy.table       PROGBITS        110036b0 0136b0 000018 00   A  0   0  4
  [ 5] .zero.table       PROGBITS        110036c8 0136c8 000010 00   A  0   0  4
  [ 6] .data             PROGBITS        31000000 020000 000050 00  WA  0   0  4
  [ 7] .bss              NOBITS          31000050 020050 000050 00  WA  0   0  4
  [ 8] .heap             PROGBITS        00000000 0208a0 000000 00   W  0   0  8
  [ 9] .stack            PROGBITS        310000a0 0200a0 0003f8 00  WA  0   0  8
  [10] .msp_stack_seal_r PROGBITS        31000498 020498 000008 00  WA  0   0  1
  [11] .heap             PROGBITS        310004a0 0204a0 000400 00  WA  0   0  8
  [12] .debug_abbrev     PROGBITS        00000000 0208a0 0010e1 00      0   0  1
  [13] .debug_info       PROGBITS        00000000 021981 0044ca 00      0   0  1
  [14] .debug_str        PROGBITS        00000000 025e4b 002af8 01  MS  0   0  1
  [15] .comment          PROGBITS        00000000 028943 000029 01  MS  0   0  1
  [16] .ARM.attributes   ARM_ATTRIBUTES  00000000 02896c 00004c 00      0   0  1
  [17] .debug_frame      PROGBITS        00000000 0289b8 00120c 00      0   0  4
  [18] .debug_line       PROGBITS        00000000 029bc4 003bd9 00      0   0  1
  [19] .debug_aranges    PROGBITS        00000000 02d79d 000020 00      0   0  1
  [20] .debug_line_str   PROGBITS        00000000 02d7bd 00055b 01  MS  0   0  1
  [21] .debug_loclists   PROGBITS        00000000 02dd18 001ef2 00      0   0  1
  [22] .debug_str_offset PROGBITS        00000000 02fc0a 000580 00      0   0  1
  [23] .debug_addr       PROGBITS        00000000 03018a 000118 00      0   0  1
  [24] .debug_rnglists   PROGBITS        00000000 0302a2 0001e3 00      0   0  1
  [25] .symtab           SYMTAB          00000000 030488 001620 10     27 125  4
  [26] .shstrtab         STRTAB          00000000 031aa8 000132 00      0   0  1
  [27] .strtab           STRTAB          00000000 031bda 001522 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  y (purecode), p (processor specific)

There are no section groups in this file.

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x010000 0x11000000 0x11000000 0x036a0 0x036a0 R E 0x10000
  LOAD           0x0136a0 0x110036a0 0x110036a0 0x00038 0x00038 R   0x10000
  LOAD           0x020000 0x31000000 0x110036d8 0x00050 0x00050 RW  0x10000
  LOAD           0x020050 0x31000050 0x31000050 0x00850 0x00850 RW  0x10000
  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0
  EXIDX          0x0136a0 0x110036a0 0x110036a0 0x00010 0x00010 R   0x4

 Section to Segment mapping:
  Segment Sections...
   00     .text 
   01     .gnu.sgstubs .ARM.exidx .copy.table .zero.table 
   02     .data 
   03     .bss .stack .msp_stack_seal_res .heap 
   04     
   05     .gnu.sgstubs .ARM.exidx 

There is no dynamic section in this file.

There are no relocations in this file.

Unwind section '.ARM.exidx' at offset 0x136a0 contains 2 entries:

0x11000240 <main>: 0x1 [cantunwind]

0x1100312c <__udivmoddi4+0x2cc>: 0x1 [cantunwind]


Symbol table '.symtab' contains 354 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 FILE    LOCAL  DEFAULT  ABS main.c
     2: 11000240     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
     3: 31000000    16 OBJECT  LOCAL  DEFAULT    6 __stdio
     4: 00000000     0 FILE    LOCAL  DEFAULT  ABS Driver_USART.c
     5: 1100038c     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
     6: 31000010    48 OBJECT  LOCAL  DEFAULT    6 Driver_USART0_DEV
     7: 11000487    28 FUNC    LOCAL  DEFAULT    1 ARM_USART_GetVersion
     8: 110004a3    12 FUNC    LOCAL  DEFAULT    1 ARM_USART_GetCapabilities
     9: 110004af    26 FUNC    LOCAL  DEFAULT    1 Driver_USART0_Initialize
    10: 110005c7    24 FUNC    LOCAL  DEFAULT    1 ARM_USARTx_Initialize
    11: 110004c9    18 FUNC    LOCAL  DEFAULT    1 Driver_USART0_Uninitializ
    12: 110005df    32 FUNC    LOCAL  DEFAULT    1 ARM_USARTx_Uninitialize
    13: 110004db    26 FUNC    LOCAL  DEFAULT    1 Driver_USART0_PowerContro
    14: 110005ff   226 FUNC    LOCAL  DEFAULT    1 ARM_USARTx_PowerControl
    15: 110004f5    30 FUNC    LOCAL  DEFAULT    1 Driver_USART0_Send
    16: 11000767   122 FUNC    LOCAL  DEFAULT    1 ARM_USARTx_Send
    17: 11000513    30 FUNC    LOCAL  DEFAULT    1 Driver_USART0_Receive
    18: 110007e1   132 FUNC    LOCAL  DEFAULT    1 ARM_USARTx_Receive
    19: 11000531    34 FUNC    LOCAL  DEFAULT    1 Driver_USART0_Transfer
    20: 11000865    60 FUNC    LOCAL  DEFAULT    1 ARM_USARTx_Transfer
    21: 11000553    18 FUNC    LOCAL  DEFAULT    1 Driver_USART0_GetTxCount
    22: 110008a1    12 FUNC    LOCAL  DEFAULT    1 ARM_USARTx_GetTxCount
    23: 11000565    18 FUNC    LOCAL  DEFAULT    1 Driver_USART0_GetRxCount
    24: 110008ad    12 FUNC    LOCAL  DEFAULT    1 ARM_USARTx_GetRxCount
    25: 11000577    30 FUNC    LOCAL  DEFAULT    1 Driver_USART0_Control
    26: 110008b9   346 FUNC    LOCAL  DEFAULT    1 ARM_USARTx_Control
    27: 11000595    26 FUNC    LOCAL  DEFAULT    1 Driver_USART0_GetStatus
    28: 11000a13    54 FUNC    LOCAL  DEFAULT    1 ARM_USARTx_GetStatus
    29: 110005af    12 FUNC    LOCAL  DEFAULT    1 Driver_USART0_SetModemCon
    30: 110005bb    12 FUNC    LOCAL  DEFAULT    1 Driver_USART0_GetModemSta
    31: 110006e1    50 FUNC    LOCAL  DEFAULT    1 __NVIC_DisableIRQ
    32: 11000713    42 FUNC    LOCAL  DEFAULT    1 __NVIC_ClearPendingIRQ
    33: 1100073d    42 FUNC    LOCAL  DEFAULT    1 __NVIC_EnableIRQ
    34: 110008fe     0 NOTYPE  LOCAL  DEFAULT    1 $d.1
    35: 11000918     0 NOTYPE  LOCAL  DEFAULT    1 $t.2
    36: 11003338     4 OBJECT  LOCAL  DEFAULT    1 DriverVersion
    37: 1100333c     4 OBJECT  LOCAL  DEFAULT    1 DriverCapabilities
    38: 00000000     0 FILE    LOCAL  DEFAULT  ABS retarget_io.c
    39: 11000a48     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
    40: 00000000     0 FILE    LOCAL  DEFAULT  ABS stdout.c
    41: 11000ccc     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
    42: 00000000     0 FILE    LOCAL  DEFAULT  ABS uart_cmsdk_drv.c
    43: 11000db4     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
    44: 00000000     0 FILE    LOCAL  DEFAULT  ABS startup_SSE310MPS3.c
    45: 110011d4     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
    46: 00000000     0 FILE    LOCAL  DEFAULT  ABS system_SSE310MPS3.c
    47: 11001480     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
    48: 00000000     0 FILE    LOCAL  DEFAULT  ABS device_definition.c
    49: 11003358     8 OBJECT  LOCAL  DEFAULT    1 UART0_CMSDK_DEV_CFG_S
    50: 31000050    12 OBJECT  LOCAL  DEFAULT    7 UART0_CMSDK_DEV_DATA_S
    51: 00000000     0 FILE    LOCAL  DEFAULT  ABS enolaTrampoline.c
    52: 11001518     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
    53: 00000000     0 FILE    LOCAL  DEFAULT  ABS application.c
    54: 110002ac     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
    55: 11001728     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
    56: 00000000     0 FILE    LOCAL  DEFAULT  ABS printf.c
    57: 1100173c     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
    58: 11001764     0 NOTYPE  LOCAL  DEFAULT    1 $d.1
    59: 00000000     0 FILE    LOCAL  DEFAULT  ABS vfprintf.c
    60: 11001768     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
    61: 110017fa     0 NOTYPE  LOCAL  DEFAULT    1 $d.1
    62: 11001804     0 NOTYPE  LOCAL  DEFAULT    1 $t.2
    63: 11002379   360 FUNC    LOCAL  DEFAULT    1 skip_to_arg
    64: 11001a00     0 NOTYPE  LOCAL  DEFAULT    1 $d.3
    65: 11001a0e     0 NOTYPE  LOCAL  DEFAULT    1 $t.4
    66: 110024e1    84 FUNC    LOCAL  DEFAULT    1 __ultoa_invert
    67: 1100236c     0 NOTYPE  LOCAL  DEFAULT    1 $d.5
    68: 11002378     0 NOTYPE  LOCAL  DEFAULT    1 $t.6
    69: 110024dc     0 NOTYPE  LOCAL  DEFAULT    1 $d.7
    70: 110024e0     0 NOTYPE  LOCAL  DEFAULT    1 $t.8
    71: 00000000     0 FILE    LOCAL  DEFAULT  ABS strnlen.c
    72: 11002534     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
    73: 00000000     0 FILE    LOCAL  DEFAULT  ABS dtoa_ryu.c
    74: 11002550     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
    75: 110029ad   448 FUNC    LOCAL  DEFAULT    1 mulShiftAll64
    76: 1100298d    32 FUNC    LOCAL  DEFAULT    1 umulh
    77: 11002b6d    48 FUNC    LOCAL  DEFAULT    1 decimalLength17
    78: 1100297d    14 FUNC    LOCAL  DEFAULT    1 div10
    79: 11002b9d    16 FUNC    LOCAL  DEFAULT    1 OUTLINED_FUNCTION_0
    80: 1100297c     0 NOTYPE  LOCAL  DEFAULT    1 $t.1
    81: 1100298c     0 NOTYPE  LOCAL  DEFAULT    1 $t.2
    82: 110029a8     0 NOTYPE  LOCAL  DEFAULT    1 $d.3
    83: 110029ac     0 NOTYPE  LOCAL  DEFAULT    1 $t.4
    84: 11002b6c     0 NOTYPE  LOCAL  DEFAULT    1 $t.5
    85: 11002b9c     0 NOTYPE  LOCAL  DEFAULT    1 $t.6
    86: 00000000     0 FILE    LOCAL  DEFAULT  ABS ryu_table.c
    87: 11002bac     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
    88: 11002be0     0 NOTYPE  LOCAL  DEFAULT    1 $d.1
    89: 11002be8     0 NOTYPE  LOCAL  DEFAULT    1 $t.2
    90: 11002daf    16 FUNC    LOCAL  DEFAULT    1 OUTLINED_FUNCTION_3
    91: 11002dbf    10 FUNC    LOCAL  DEFAULT    1 OUTLINED_FUNCTION_4
    92: 11002d9f    16 FUNC    LOCAL  DEFAULT    1 OUTLINED_FUNCTION_2
    93: 11002d8b    20 FUNC    LOCAL  DEFAULT    1 OUTLINED_FUNCTION_1
    94: 11002d79    18 FUNC    LOCAL  DEFAULT    1 OUTLINED_FUNCTION_0
    95: 11002ca0     0 NOTYPE  LOCAL  DEFAULT    1 $d.3
    96: 11003360   208 OBJECT  LOCAL  DEFAULT    1 DOUBLE_POW5_SPLIT2
    97: 11003430   208 OBJECT  LOCAL  DEFAULT    1 DOUBLE_POW5_TABLE
    98: 11003500    84 OBJECT  LOCAL  DEFAULT    1 POW5_OFFSETS
    99: 11002cac     0 NOTYPE  LOCAL  DEFAULT    1 $t.4
   100: 11002d6c     0 NOTYPE  LOCAL  DEFAULT    1 $d.5
   101: 11003558   240 OBJECT  LOCAL  DEFAULT    1 DOUBLE_POW5_INV_SPLIT2
   102: 11003648    84 OBJECT  LOCAL  DEFAULT    1 POW5_INV_OFFSETS
   103: 11002d78     0 NOTYPE  LOCAL  DEFAULT    1 $t.6
   104: 11002d8a     0 NOTYPE  LOCAL  DEFAULT    1 $t.7
   105: 11002d9e     0 NOTYPE  LOCAL  DEFAULT    1 $t.8
   106: 11002dae     0 NOTYPE  LOCAL  DEFAULT    1 $t.9
   107: 11002dbe     0 NOTYPE  LOCAL  DEFAULT    1 $t.10
   108: 00000000     0 FILE    LOCAL  DEFAULT  ABS ryu_log10.c
   109: 11002dc8     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
   110: 11002dd0     0 NOTYPE  LOCAL  DEFAULT    1 $d.1
   111: 11002dd4     0 NOTYPE  LOCAL  DEFAULT    1 $t.2
   112: 11002ddc     0 NOTYPE  LOCAL  DEFAULT    1 $d.3
   113: 00000000     0 FILE    LOCAL  DEFAULT  ABS ryu_pow5bits.c
   114: 11002de0     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
   115: 11002dec     0 NOTYPE  LOCAL  DEFAULT    1 $d.1
   116: 00000000     0 FILE    LOCAL  DEFAULT  ABS ryu_umul128.c
   117: 11002df0     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
   118: 11002e32     0 NOTYPE  LOCAL  DEFAULT    1 $t.1
   119: 11002e4c     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
   120: 11002e4d    20 FUNC    LOCAL  HIDDEN     1 __aeabi_uldivmod
   121: 00000000     0 FILE    LOCAL  DEFAULT  ABS udivmoddi4.c
   122: 11002e60     0 NOTYPE  LOCAL  DEFAULT    1 $t.0
   123: 11002e61   716 FUNC    LOCAL  HIDDEN     1 __udivmoddi4
   124: 00000000     0 NOTYPE  LOCAL  HIDDEN     1 __dso_handle
   125: 11000241   108 FUNC    GLOBAL DEFAULT    1 main
   126: 110016f9    26 FUNC    GLOBAL DEFAULT    1 setup_S_PAC_Keys
   127: 1100171d    10 FUNC    GLOBAL DEFAULT    1 init_registers
   128: 11001713    10 FUNC    GLOBAL DEFAULT    1 enable_PAC
   129: 11000ccd   144 FUNC    GLOBAL DEFAULT    1 stdout_init
   130: 11001519   126 FUNC    GLOBAL DEFAULT    1 init_trampoline
   131: 110002ad    40 FUNC    GLOBAL DEFAULT    1 mod2
   132: 1100173d    44 FUNC    GLOBAL DEFAULT    1 printf
   133: 110002d5    44 FUNC    GLOBAL DEFAULT    1 loopOver
   134: 11000301   138 FUNC    GLOBAL DEFAULT    1 switchcase
   135: 11000d5d    86 FUNC    GLOBAL DEFAULT    1 stdout_putchar
   136: 1100312c     4 OBJECT  GLOBAL DEFAULT    1 stdin
   137: 1100312c     4 OBJECT  GLOBAL DEFAULT    1 stdout
   138: 1100312c     4 OBJECT  GLOBAL DEFAULT    1 stderr
   139: 1100038d   130 FUNC    GLOBAL DEFAULT    1 UARTRX0_Handler
   140: 110010a5    80 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_clear_interrup
   141: 11000f71    52 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_read
   142: 1100040f   120 FUNC    GLOBAL DEFAULT    1 UARTTX0_Handler
   143: 11000fa5    52 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_write
   144: 11000e61    40 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_irq_rx_disable
   145: 11000e89    40 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_irq_tx_disable
   146: 11001185    40 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_rx_disable
   147: 11001129    40 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_tx_disable
   148: 31000044     4 OBJECT  GLOBAL DEFAULT    6 PeripheralClock
   149: 11000db5    98 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_init
   150: 11001041    52 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_irq_rx_enable
   151: 11000fd9    52 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_irq_tx_enable
   152: 11001075    48 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_rx_ready
   153: 110010f5    52 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_tx_enable
   154: 11001151    52 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_rx_enable
   155: 11000eb1    98 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_set_baudrate
   156: 31000048     8 OBJECT  GLOBAL DEFAULT    6 UART0_CMSDK_DEV_S
   157: 11003300    56 OBJECT  GLOBAL DEFAULT    1 Driver_USART0
   158: 11000a49   134 FUNC    WEAK   DEFAULT    1 _sys_open
   159: 11001729    20 FUNC    GLOBAL DEFAULT    1 strcmp
   160: 11000acf    74 FUNC    WEAK   DEFAULT    1 _sys_close
   161: 11000b19   120 FUNC    WEAK   DEFAULT    1 _sys_write
   162: 11000b91    88 FUNC    WEAK   DEFAULT    1 _sys_read
   163: 11000be9    72 FUNC    WEAK   DEFAULT    1 _sys_istty
   164: 11000c31    82 FUNC    WEAK   DEFAULT    1 _sys_seek
   165: 11000c83    72 FUNC    WEAK   DEFAULT    1 _sys_flen
   166: 11003340     7 OBJECT  GLOBAL DEFAULT    1 __stdin_name
   167: 11003347     8 OBJECT  GLOBAL DEFAULT    1 __stdout_name
   168: 1100334f     8 OBJECT  GLOBAL DEFAULT    1 __stderr_name
   169: 11000e17    74 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_uninit
   170: 11000f13    14 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_get_baudrate
   171: 11000f21    80 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_set_clock
   172: 1100100d    52 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_tx_ready
   173: 110011ad    38 FUNC    GLOBAL DEFAULT    1 uart_cmsdk_rx_overrun_cle
   174: 110011d5     4 FUNC    WEAK   DEFAULT    1 NMI_Handler
   175: 110011d9     4 FUNC    WEAK   DEFAULT    1 HardFault_Handler
   176: 110011dd     4 FUNC    WEAK   DEFAULT    1 MemManage_Handler
   177: 110011e1     4 FUNC    WEAK   DEFAULT    1 BusFault_Handler
   178: 110011e5     4 FUNC    WEAK   DEFAULT    1 UsageFault_Handler
   179: 110011e9     4 FUNC    WEAK   DEFAULT    1 SecureFault_Handler
   180: 110011ed     4 FUNC    WEAK   DEFAULT    1 SVC_Handler
   181: 110011f1     4 FUNC    WEAK   DEFAULT    1 DebugMon_Handler
   182: 110011f5     4 FUNC    WEAK   DEFAULT    1 PendSV_Handler
   183: 110011f9     4 FUNC    WEAK   DEFAULT    1 SysTick_Handler
   184: 110011fd     4 FUNC    WEAK   DEFAULT    1 NONSEC_WATCHDOG_RESET_REQ
   185: 11001201     4 FUNC    WEAK   DEFAULT    1 NONSEC_WATCHDOG_Handler
   186: 11001205     4 FUNC    WEAK   DEFAULT    1 SLOWCLK_Timer_Handler
   187: 11001209     4 FUNC    WEAK   DEFAULT    1 TFM_TIMER0_IRQ_Handler
   188: 1100120d     4 FUNC    WEAK   DEFAULT    1 TIMER1_Handler
   189: 11001211     4 FUNC    WEAK   DEFAULT    1 TIMER2_Handler
   190: 11001215     4 FUNC    WEAK   DEFAULT    1 MPC_Handler
   191: 11001219     4 FUNC    WEAK   DEFAULT    1 PPC_Handler
   192: 1100121d     4 FUNC    WEAK   DEFAULT    1 MSC_Handler
   193: 11001221     4 FUNC    WEAK   DEFAULT    1 BRIDGE_ERROR_Handler
   194: 11001225     4 FUNC    WEAK   DEFAULT    1 COMBINED_PPU_Handler
   195: 11001229     4 FUNC    WEAK   DEFAULT    1 DEBUG_PPU_Handler
   196: 1100122d     4 FUNC    WEAK   DEFAULT    1 TIMER3_AON_Handler
   197: 11001231     4 FUNC    WEAK   DEFAULT    1 CPU0_CTI_0_Handler
   198: 11001235     4 FUNC    WEAK   DEFAULT    1 CPU0_CTI_1_Handler
   199: 11001239     4 FUNC    WEAK   DEFAULT    1 System_Timestamp_Counter_
   200: 11001245     4 FUNC    WEAK   DEFAULT    1 UARTRX1_Handler
   201: 11001249     4 FUNC    WEAK   DEFAULT    1 UARTTX1_Handler
   202: 1100124d     4 FUNC    WEAK   DEFAULT    1 UARTRX2_Handler
   203: 11001251     4 FUNC    WEAK   DEFAULT    1 UARTTX2_Handler
   204: 11001255     4 FUNC    WEAK   DEFAULT    1 UARTRX3_Handler
   205: 11001259     4 FUNC    WEAK   DEFAULT    1 UARTTX3_Handler
   206: 1100125d     4 FUNC    WEAK   DEFAULT    1 UARTRX4_Handler
   207: 11001261     4 FUNC    WEAK   DEFAULT    1 UARTTX4_Handler
   208: 11001265     4 FUNC    WEAK   DEFAULT    1 UART0_Combined_Handler
   209: 11001269     4 FUNC    WEAK   DEFAULT    1 UART1_Combined_Handler
   210: 1100126d     4 FUNC    WEAK   DEFAULT    1 UART2_Combined_Handler
   211: 11001271     4 FUNC    WEAK   DEFAULT    1 UART3_Combined_Handler
   212: 11001275     4 FUNC    WEAK   DEFAULT    1 UART4_Combined_Handler
   213: 11001279     4 FUNC    WEAK   DEFAULT    1 UARTOVF_Handler
   214: 1100127d     4 FUNC    WEAK   DEFAULT    1 ETHERNET_Handler
   215: 11001281     4 FUNC    WEAK   DEFAULT    1 I2S_Handler
   216: 11001285     4 FUNC    WEAK   DEFAULT    1 TOUCH_SCREEN_Handler
   217: 11001289     4 FUNC    WEAK   DEFAULT    1 USB_Handler
   218: 1100128d     4 FUNC    WEAK   DEFAULT    1 SPI_ADC_Handler
   219: 11001291     4 FUNC    WEAK   DEFAULT    1 SPI_SHIELD0_Handler
   220: 11001295     4 FUNC    WEAK   DEFAULT    1 SPI_SHIELD1_Handler
   221: 11001299     4 FUNC    WEAK   DEFAULT    1 DMA_Ch_0_Error_Handler
   222: 1100129d     4 FUNC    WEAK   DEFAULT    1 DMA_Ch_0_Terminal_Count_H
   223: 110012a1     4 FUNC    WEAK   DEFAULT    1 DMA_Ch_0_Combined_Handler
   224: 110012a5     4 FUNC    WEAK   DEFAULT    1 DMA_Ch_1_Error_Handler
   225: 110012a9     4 FUNC    WEAK   DEFAULT    1 DMA_Ch_1_Terminal_Count_H
   226: 110012ad     4 FUNC    WEAK   DEFAULT    1 DMA_Ch_1_Combined_Handler
   227: 110012b1     4 FUNC    WEAK   DEFAULT    1 DMA_Ch_2_Error_Handler
   228: 110012b5     4 FUNC    WEAK   DEFAULT    1 DMA_Ch_2_Terminal_Count_H
   229: 110012b9     4 FUNC    WEAK   DEFAULT    1 DMA_Ch_2_Combined_Handler
   230: 110012bd     4 FUNC    WEAK   DEFAULT    1 DMA_Ch_3_Error_Handler
   231: 110012c1     4 FUNC    WEAK   DEFAULT    1 DMA_Ch_3_Terminal_Count_H
   232: 110012c5     4 FUNC    WEAK   DEFAULT    1 DMA_Ch_3_Combined_Handler
   233: 110012c9     4 FUNC    WEAK   DEFAULT    1 ETHOS_U55_Handler
   234: 110012cd     4 FUNC    WEAK   DEFAULT    1 GPIO0_Combined_Handler
   235: 110012d1     4 FUNC    WEAK   DEFAULT    1 GPIO1_Combined_Handler
   236: 110012d5     4 FUNC    WEAK   DEFAULT    1 GPIO2_Combined_Handler
   237: 110012d9     4 FUNC    WEAK   DEFAULT    1 GPIO3_Combined_Handler
   238: 110012dd     4 FUNC    WEAK   DEFAULT    1 GPIO0_0_Handler
   239: 110012e1     4 FUNC    WEAK   DEFAULT    1 GPIO0_1_Handler
   240: 110012e5     4 FUNC    WEAK   DEFAULT    1 GPIO0_2_Handler
   241: 110012e9     4 FUNC    WEAK   DEFAULT    1 GPIO0_3_Handler
   242: 110012ed     4 FUNC    WEAK   DEFAULT    1 GPIO0_4_Handler
   243: 110012f1     4 FUNC    WEAK   DEFAULT    1 GPIO0_5_Handler
   244: 110012f5     4 FUNC    WEAK   DEFAULT    1 GPIO0_6_Handler
   245: 110012f9     4 FUNC    WEAK   DEFAULT    1 GPIO0_7_Handler
   246: 110012fd     4 FUNC    WEAK   DEFAULT    1 GPIO0_8_Handler
   247: 11001301     4 FUNC    WEAK   DEFAULT    1 GPIO0_9_Handler
   248: 11001305     4 FUNC    WEAK   DEFAULT    1 GPIO0_10_Handler
   249: 11001309     4 FUNC    WEAK   DEFAULT    1 GPIO0_11_Handler
   250: 1100130d     4 FUNC    WEAK   DEFAULT    1 GPIO0_12_Handler
   251: 11001311     4 FUNC    WEAK   DEFAULT    1 GPIO0_13_Handler
   252: 11001315     4 FUNC    WEAK   DEFAULT    1 GPIO0_14_Handler
   253: 11001319     4 FUNC    WEAK   DEFAULT    1 GPIO0_15_Handler
   254: 1100131d     4 FUNC    WEAK   DEFAULT    1 GPIO1_0_Handler
   255: 11001321     4 FUNC    WEAK   DEFAULT    1 GPIO1_1_Handler
   256: 11001325     4 FUNC    WEAK   DEFAULT    1 GPIO1_2_Handler
   257: 11001329     4 FUNC    WEAK   DEFAULT    1 GPIO1_3_Handler
   258: 1100132d     4 FUNC    WEAK   DEFAULT    1 GPIO1_4_Handler
   259: 11001331     4 FUNC    WEAK   DEFAULT    1 GPIO1_5_Handler
   260: 11001335     4 FUNC    WEAK   DEFAULT    1 GPIO1_6_Handler
   261: 11001339     4 FUNC    WEAK   DEFAULT    1 GPIO1_7_Handler
   262: 1100133d     4 FUNC    WEAK   DEFAULT    1 GPIO1_8_Handler
   263: 11001341     4 FUNC    WEAK   DEFAULT    1 GPIO1_9_Handler
   264: 11001345     4 FUNC    WEAK   DEFAULT    1 GPIO1_10_Handler
   265: 11001349     4 FUNC    WEAK   DEFAULT    1 GPIO1_11_Handler
   266: 1100134d     4 FUNC    WEAK   DEFAULT    1 GPIO1_12_Handler
   267: 11001351     4 FUNC    WEAK   DEFAULT    1 GPIO1_13_Handler
   268: 11001355     4 FUNC    WEAK   DEFAULT    1 GPIO1_14_Handler
   269: 11001359     4 FUNC    WEAK   DEFAULT    1 GPIO1_15_Handler
   270: 1100135d     4 FUNC    WEAK   DEFAULT    1 GPIO2_0_Handler
   271: 11001361     4 FUNC    WEAK   DEFAULT    1 GPIO2_1_Handler
   272: 11001365     4 FUNC    WEAK   DEFAULT    1 GPIO2_2_Handler
   273: 11001369     4 FUNC    WEAK   DEFAULT    1 GPIO2_3_Handler
   274: 1100136d     4 FUNC    WEAK   DEFAULT    1 GPIO2_4_Handler
   275: 11001371     4 FUNC    WEAK   DEFAULT    1 GPIO2_5_Handler
   276: 11001375     4 FUNC    WEAK   DEFAULT    1 GPIO2_6_Handler
   277: 11001379     4 FUNC    WEAK   DEFAULT    1 GPIO2_7_Handler
   278: 1100137d     4 FUNC    WEAK   DEFAULT    1 GPIO2_8_Handler
   279: 11001381     4 FUNC    WEAK   DEFAULT    1 GPIO2_9_Handler
   280: 11001385     4 FUNC    WEAK   DEFAULT    1 GPIO2_10_Handler
   281: 11001389     4 FUNC    WEAK   DEFAULT    1 GPIO2_11_Handler
   282: 1100138d     4 FUNC    WEAK   DEFAULT    1 GPIO2_12_Handler
   283: 11001391     4 FUNC    WEAK   DEFAULT    1 GPIO2_13_Handler
   284: 11001395     4 FUNC    WEAK   DEFAULT    1 GPIO2_14_Handler
   285: 11001399     4 FUNC    WEAK   DEFAULT    1 GPIO2_15_Handler
   286: 1100139d     4 FUNC    WEAK   DEFAULT    1 GPIO3_0_Handler
   287: 110013a1     4 FUNC    WEAK   DEFAULT    1 GPIO3_1_Handler
   288: 110013a5     4 FUNC    WEAK   DEFAULT    1 GPIO3_2_Handler
   289: 110013a9     4 FUNC    WEAK   DEFAULT    1 GPIO3_3_Handler
   290: 110013ad     4 FUNC    WEAK   DEFAULT    1 UARTRX5_Handler
   291: 110013b1     4 FUNC    WEAK   DEFAULT    1 UARTTX5_Handler
   292: 110013b5     4 FUNC    WEAK   DEFAULT    1 UART5_Combined_Handler
   293: 110013b9   200 FUNC    GLOBAL DEFAULT    1 Reset_Handler
   294: 31000498     0 NOTYPE  GLOBAL DEFAULT    9 __StackTop
   295: 310000a0     0 NOTYPE  GLOBAL DEFAULT    9 __StackLimit
   296: 1100149f   122 FUNC    GLOBAL DEFAULT    1 SystemInit
   297: 110036b0     0 NOTYPE  GLOBAL DEFAULT    4 __copy_table_start__
   298: 110036c8     0 NOTYPE  GLOBAL DEFAULT    4 __copy_table_end__
   299: 110036c8     0 NOTYPE  GLOBAL DEFAULT    5 __zero_table_start__
   300: 110036d8     0 NOTYPE  GLOBAL DEFAULT    5 __zero_table_end__
   301: 11000240     0 NOTYPE  GLOBAL DEFAULT    1 _start
   302: 11000000   576 OBJECT  GLOBAL DEFAULT    1 __Vectors
   303: 11001481    30 FUNC    GLOBAL DEFAULT    1 SystemCoreClockUpdate
   304: 31000040     4 OBJECT  GLOBAL DEFAULT    6 SystemCoreClock
   305: 3100005c    68 OBJECT  GLOBAL DEFAULT    7 To
   306: 11001597   100 FUNC    GLOBAL DEFAULT    1 print_occurence_trace
   307: 110015fb    78 FUNC    GLOBAL DEFAULT    1 get_idx
   308: 11001649   158 FUNC    GLOBAL DEFAULT    1 secure_trace_storage
   309: 110016e7    18 FUNC    GLOBAL DEFAULT    1 indirect_secure_trace_sto
   310: 11002535    26 FUNC    GLOBAL DEFAULT    1 strnlen
   311: 11001769  3088 FUNC    GLOBAL DEFAULT    1 vfprintf
   312: 11002551  1068 FUNC    GLOBAL DEFAULT    1 __dtoa_engine
   313: 11001769  3088 FUNC    GLOBAL DEFAULT    1 __d_vfprintf
   314: 11002dc9    12 FUNC    GLOBAL DEFAULT    1 __log10Pow2
   315: 11002de1    16 FUNC    GLOBAL DEFAULT    1 __pow5bits
   316: 11002cad   204 FUNC    GLOBAL DEFAULT    1 __double_computeInvPow5
   317: 11002bad    60 FUNC    GLOBAL DEFAULT    1 __pow5Factor
   318: 11002dd5    12 FUNC    GLOBAL DEFAULT    1 __log10Pow5
   319: 11002be9   196 FUNC    GLOBAL DEFAULT    1 __double_computePow5
   320: 11002df1    66 FUNC    GLOBAL DEFAULT    1 __umul128
   321: 11002e33    26 FUNC    GLOBAL DEFAULT    1 __shiftright128
   322: 11000000     0 NOTYPE  GLOBAL DEFAULT  ABS S_CODE_START
   323: 00020000     0 NOTYPE  GLOBAL DEFAULT  ABS S_CODE_SIZE
   324: 31000000     0 NOTYPE  GLOBAL DEFAULT  ABS S_DATA_START
   325: 00040000     0 NOTYPE  GLOBAL DEFAULT  ABS S_DATA_SIZE
   326: 00000400     0 NOTYPE  GLOBAL DEFAULT  ABS HEAP_SIZE
   327: 00000400     0 NOTYPE  GLOBAL DEFAULT  ABS STACK_SIZE
   328: 11000240     0 NOTYPE  GLOBAL DEFAULT    1 __Vectors_End
   329: 110036a0     0 NOTYPE  GLOBAL DEFAULT    2 Image$$ER_CODE_CMSE_VENEE
   330: 110036a0     0 NOTYPE  GLOBAL DEFAULT    2 Image$$ER_CODE_CMSE_VENEE
   331: 110036d8     0 NOTYPE  GLOBAL DEFAULT  ABS __etext
   332: 31000000     0 NOTYPE  GLOBAL DEFAULT    6 __data_start__
   333: 31000050     0 NOTYPE  GLOBAL DEFAULT    6 __data_end__
   334: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND __etext2
   335: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND __data2_start__
   336: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND __data2_end__
   337: 31000050     0 NOTYPE  GLOBAL DEFAULT    7 __bss_start__
   338: 310000a0     0 NOTYPE  GLOBAL DEFAULT    7 __bss_end__
   339: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND __bss2_start__
   340: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND __bss2_end__
   341: 310004a0     0 NOTYPE  GLOBAL DEFAULT   11 __end__
   342: 00000400     0 NOTYPE  GLOBAL DEFAULT  ABS __stack_size__
   343: 00000400     0 NOTYPE  GLOBAL DEFAULT  ABS __heap_size__
   344: 00000240     0 NOTYPE  GLOBAL DEFAULT  ABS __Vectors_Size
   345: 00000000     0 NOTYPE  GLOBAL DEFAULT  ABS Image$$ER_CODE_CMSE_VENEE
   346: 110036a0     0 NOTYPE  GLOBAL DEFAULT    2 __exidx_start
   347: 110036b0     0 NOTYPE  GLOBAL DEFAULT    3 __exidx_end
   348: 00000050     0 NOTYPE  GLOBAL DEFAULT  ABS bss_size
   349: 310004a0     0 NOTYPE  GLOBAL DEFAULT   11 __HeapBase
   350: 00000000     0 NOTYPE  GLOBAL DEFAULT    8 end
   351: 310008a0     0 NOTYPE  GLOBAL DEFAULT   11 __HeapLimit
   352: 31000498     0 NOTYPE  GLOBAL DEFAULT   10 __StackSeal
   353: 310008a0     0 NOTYPE  GLOBAL DEFAULT   11 __heap_limit

No version information found in this file.
Attribute Section: aeabi
File Attributes
  Tag_conformance: "2.09"
  Tag_CPU_name: "cortex-m85"
  Tag_CPU_arch: v8.1-M.mainline
  Tag_CPU_arch_profile: Microcontroller
  Tag_ARM_ISA_use: No
  Tag_THUMB_ISA_use: Yes
  Tag_ABI_PCS_R9_use: V6
  Tag_ABI_PCS_GOT_use: direct
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Unused
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_VFP_args: VFP registers
  Tag_ABI_optimization_goals: Aggressive Debug
  Tag_CPU_unaligned_access: None
  Tag_ABI_FP_16bit_format: IEEE 754
  Tag_DSP_extension: Allowed
  Tag_MVE_arch: MVE Integer only
  Tag_unknown_50: 2 (0x2)
  Tag_unknown_52: 2 (0x2)

Can you post a minimal reproducer binary that demonstrates this behavior?

Can you try running pyelftools' own readelf clone on it? It's in the scripts directory

Looks similar to #484, which was addressed by #491. "Tag" in this context stands for ARM attribute tags, not for DWARF tags. Cortex is a flavor of ARM.

ARM tag 48 is TAG_MVE_ARCH (https://github.com/ARM-software/abi-aa/blob/main/addenda32/addenda32.rst), handled as the rest of them. We indeed don't have it. To address by monkeypatching, add a value to ENUM_ATTR_TAG_ARM under elftools/elf/enums.py:

import elftools.elf.enums  
elftools.elf.enums.ENUM_ATTR_TAG_ARM['TAG_MVE_ARCH'] = 48

Thank you very much. I directly added TAG_MVE_ARCH = 48 in the ENUM_ATTR_TAG_ARM of elftools/elf/enums.py python file. It works.

@sevaa should we add it?

I think I will go over the list of tags and add all the missing tag codes (unless the tag value requires nontrivial parsing). "One reindeer is a coincidence, two reindeer constitute a trend", as the joke goes.

There are two more missing tags.

Feel free to look them up in the linked ARM document. I'll do a PR in the meantime.

I fixed those tags, which were for the PACBTI extension in Cortex-m85.