Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cle/backends/elf/elf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from typing import cast

import archinfo
from elf_tools.elf.constans.E_FLAGS import EF_ARM_BE8
from elftools.common.exceptions import DWARFError, ELFError, ELFParseError
from elftools.dwarf import callframe
from elftools.dwarf.compileunit import CompileUnit
Expand Down Expand Up @@ -339,6 +340,8 @@ def extract_arch(reader):
return archinfo.ArchARMEL("Iend_LE" if reader.little_endian else "Iend_BE")
elif reader.header.e_flags & 0x400:
return archinfo.ArchARMHF("Iend_LE" if reader.little_endian else "Iend_BE")
elif reader.header.e_flags & EF_ARM_BE8: # ARM-BE8 has big endian data and little endian instructions
return archinfo.ArchARMEL("Iend_LE")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARM-BE8 has big endian data and little endian instructions

This change doesn't set memory endness?


try:
return archinfo.arch_from_id(arch_str, "le" if reader.little_endian else "be", reader.elfclass)
Expand Down