From fce4f25578506e18de600579fc230d50c5e7b665 Mon Sep 17 00:00:00 2001 From: Sunil Nimmagadda Date: Sat, 24 Oct 2026 20:37:33 +0530 Subject: header: set ehsize to valid value at normalize. --- elf/header.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elf/header.lua b/elf/header.lua index b289f13..3efce7b 100644 --- a/elf/header.lua +++ b/elf/header.lua @@ -35,7 +35,7 @@ function M.normalize(hdr) hdr.phoff = hdr.phoff or 0 hdr.shoff = hdr.shoff or 0 hdr.flags = hdr.flags or 0 - hdr.ehsize = hdr.ehsize or 0 + hdr.ehsize = hdr.ehsize or ((hdr.class == ec.Class.bit32) and 0x34 or 0x40) hdr.phentsize = hdr.phentsize or 0 hdr.phnum = hdr.phnum or 0 hdr.shentsize = hdr.shentsize or 0 -- cgit v1.3