From c762640d97a6302e9e2a8a5afcc62a6b1a100e7b Mon Sep 17 00:00:00 2001 From: Brandon Miller Date: Fri, 30 Jan 2026 12:13:53 -0500 Subject: Force ELF view addr size to 4 bytes for x32 and ilp32 These binaries can be ELF64 or ELF32 format, if the user specifies linux-x32 or linux-ilp32 platforms the BinaryView's default address size needs to be 4, even if it's an ELF64 --- view/elf/elfview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'view/elf/elfview.cpp') diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp index f09517d9..1279dead 100644 --- a/view/elf/elfview.cpp +++ b/view/elf/elfview.cpp @@ -66,7 +66,8 @@ ElfView::ElfView(BinaryView* data, bool parseOnly): BinaryView("ELF", data->GetF throw ElfFormatException(errorMsg); m_elf32 = m_ident.fileClass == 1; - m_addressSize = (m_ident.fileClass == 1 || (m_plat && m_plat->GetName() == "linux-32")) ? 4 : 8; + m_addressSize = (m_ident.fileClass == 1 || (m_plat && m_plat->GetName() == "linux-x32") || + (m_plat && m_plat->GetName() == "linux-ilp32")) ? 4 : 8; m_endian = endian; m_relocatable = m_commonHeader.type == ET_DYN || m_commonHeader.type == ET_REL; m_objectFile = m_commonHeader.type == ET_REL; -- cgit v1.3.1