Skip to content

Commit a87c73d

Browse files
committed
Remove check preventing ELF32 with 64-bit code
x32, MIPS64 n32, AArch64 ILP32, and many other ABIs leverage 64-bit instructions, but 32-bit pointers and use ELF32 format
1 parent 9f5bb02 commit a87c73d

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

view/elf/elfview.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2870,16 +2870,6 @@ uint64_t ElfViewType::ParseHeaders(BinaryView* data, ElfIdent& ident, ElfCommonH
28702870
commonHeader.arch = reader.Read16();
28712871
commonHeader.version = reader.Read32();
28722872

2873-
// Promote the file class to 64-bit
2874-
// TODO potentially add a setting to allow the user to override header interpretation
2875-
if ((commonHeader.type == ET_EXEC) && (commonHeader.arch == EM_X86_64) && (ident.fileClass == 1))
2876-
{
2877-
ident.fileClass = 2;
2878-
m_logger->LogWarn(
2879-
"Executable file claims to be 32-bit but specifies a 64-bit architecture. It is likely malformed or "
2880-
"malicious. Treating it as 64-bit.");
2881-
}
2882-
28832873
// parse Elf64Header
28842874
if (ident.fileClass == 1) // 32-bit ELF
28852875
{

0 commit comments

Comments
 (0)