Skip to content

Commit 239b5db

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 324b0db commit 239b5db

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
@@ -2868,16 +2868,6 @@ uint64_t ElfViewType::ParseHeaders(BinaryView* data, ElfIdent& ident, ElfCommonH
28682868
commonHeader.arch = reader.Read16();
28692869
commonHeader.version = reader.Read32();
28702870

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

0 commit comments

Comments
 (0)