summaryrefslogtreecommitdiff
path: root/mkelf.lua
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2026-10-24 14:14:33 +0530
committerSunil Nimmagadda <sunil@nimmagadda.net>2026-10-24 14:14:33 +0530
commitfd07227afb68dfc5080427aac5714ba82f9e8b93 (patch)
tree38f9489ac2ad58e061789b189f5372a70e12e043 /mkelf.lua
parent0f9327478c0920aeddde2fbd787da844bad27308 (diff)
Refactor header configuration handling.
- Mark optional fields and normalize them on load. - Validate (work in progress) required fields and their values. - Make sure that errors point to useful location in the config file.
Diffstat (limited to 'mkelf.lua')
-rw-r--r--mkelf.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/mkelf.lua b/mkelf.lua
index 1140be2..af794a0 100644
--- a/mkelf.lua
+++ b/mkelf.lua
@@ -29,7 +29,11 @@ local function loadconfig(fn)
SegmentFlags = elf.SegmentFlags,
ELFVERSION = elf.VERSION,
- header = function(t) header = setmetatable(t, header_mt) end,
+ header = function(t)
+ header = setmetatable(t, header_mt)
+ t:normalize()
+ t:validate()
+ end,
segments = function(t) segments = setmetatable(t, segments_mt) end,
sections = function(t) sections = setmetatable(t, sections_mt) end,
},