aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mkelf.lua3
1 files changed, 2 insertions, 1 deletions
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