aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2026-11-04 18:10:09 +0530
committerSunil Nimmagadda <sunil@nimmagadda.net>2026-11-04 18:10:09 +0530
commit486018285fa286d9b98a36e58859d6f0360d2b36 (patch)
treef4281f86be99382490946585f3bfd29cfe9a58f5
parent9e521e3d92d896478e518e3723c649e652a0ec72 (diff)
Error message instead of a backtrace.
-rwxr-xr-xmkelf3
1 files changed, 2 insertions, 1 deletions
diff --git a/mkelf b/mkelf
index e759875..5c8eb2c 100755
--- a/mkelf
+++ b/mkelf
@@ -107,7 +107,8 @@ local function main()
-- TODO check against headerOptions not normalized header.
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"))
+ local out <close> = io.open(outfn, "wb")
+ if out == nil then die("failed to open %s", outfn) end
out:write(elf.header.pack(header))
for _, segment in ipairs(segments) do
out:write(elf.segment.pack(segment, header.data, header.class))