From 1058681fde4d104cf01a804a488b0d94911c1240 Mon Sep 17 00:00:00 2001 From: Sunil Nimmagadda Date: Mon, 9 Nov 2026 16:22:26 +0530 Subject: Consistently collect the parts. --- mkelf.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkelf.lua b/mkelf.lua index fbd7909..d350a8d 100644 --- a/mkelf.lua +++ b/mkelf.lua @@ -143,9 +143,10 @@ end ---@param sections Section[] ---@return string local function elf_pack(header, segments, sections) + local parts = {} local ok, b = pcall(elf.header.pack, header) if not ok then error(("header: %s"):format(b), 0) end - local parts = { b } + parts[#parts + 1] = b for i, sg in ipairs(segments) do local sgok, sgb = pcall(elf.segment.pack, sg, header.data, header.class) if not sgok then error(("segment #%d: %s"):format(i, sgb), 0) end -- cgit v1.3