aboutsummaryrefslogtreecommitdiff
path: root/mkelf.lua
diff options
context:
space:
mode:
Diffstat (limited to 'mkelf.lua')
-rw-r--r--mkelf.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/mkelf.lua b/mkelf.lua
index f078764..518b765 100644
--- a/mkelf.lua
+++ b/mkelf.lua
@@ -30,11 +30,17 @@ local function loadconfig(fn)
ELFVERSION = elf.VERSION,
header = function(t)
+ if type(t) ~= "table" then
+ error("header must be a table", 2)
+ end
header = setmetatable(t, header_mt)
t:normalize()
t:validate()
end,
segments = function(t)
+ if type(t) ~= "table" then
+ error("segments must be a table", 2)
+ end
segments = setmetatable(t, segments_mt)
t:normalize()
t:validate()
@@ -75,8 +81,7 @@ local function main()
local out <close> = assert(io.open(outfn, "wb"))
out:write(header:pack())
out:write(segments:pack(header.data, header.class))
- -- TODO finish section.pack
- out:write(sections:pack(header.data))
+ -- out:write(sections:pack(header.data, header.class))
end
main()