aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2026-10-30 22:32:23 +0530
committerSunil Nimmagadda <sunil@nimmagadda.net>2026-10-30 22:32:23 +0530
commita4c87e8e0c68bc2c68bcca14e5c007c6f07bab53 (patch)
tree6c92466c9f0c93c2efcce0de8a7fb7535d33e0de
parent57cf05f14ef95b3d99fa1c0b33561aff72a65369 (diff)
Make sure a valid header is specified.
-rw-r--r--mkelf.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/mkelf.lua b/mkelf.lua
index 2f811a3..eb4c67b 100644
--- a/mkelf.lua
+++ b/mkelf.lua
@@ -96,6 +96,7 @@ local function main()
i = i + 1
end
local header, segments, sections = loadconfig(infn)
+ if next(header) == nil then die("header missing") end
if header.phnum == 0 then header.phnum = #segments end
if header.shnum == 0 then header.shnum = #sections end
local out <close> = assert(io.open(outfn, "wb"))