aboutsummaryrefslogtreecommitdiff
path: root/types/elf.d.lua
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2026-11-04 11:11:32 +0530
committerSunil Nimmagadda <sunil@nimmagadda.net>2026-11-04 11:11:32 +0530
commitf45ff5c60b7464dc250671d58c969a6320aad9b6 (patch)
tree11c01905bf576df18fee42fc5fe7a97f66bda286 /types/elf.d.lua
parent96e49359ded717d7e3953875a50e59eb06a5233e (diff)
Refactor normalize() to prevent in-place mutation.
We would need to distinguish user configuration options from normalization. Let normalize() return a new table instead of in-place update. Split annotations into xxxOptions and xxx for header, segments and sections, delineating optional vs normalized table. Leave header, segments and sections as just a data table for now and stop trying to make them objects. Leave data alone.
Diffstat (limited to 'types/elf.d.lua')
-rw-r--r--types/elf.d.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/types/elf.d.lua b/types/elf.d.lua
index 4d38707..40f88df 100644
--- a/types/elf.d.lua
+++ b/types/elf.d.lua
@@ -13,24 +13,24 @@ SectionType = ec.SectionType
SectionFlags = ec.SectionFlags
ELFVERSION = ec.VERSION
---[[
-ELF header.
+--[[ ELF header.
+
There can be only one header per configuration file.
class, data, type and machine are mandatory fields while
the remaining fields are assigned defaults or computed after layout.
]]
----@param hdr Header
+---@param hdr HeaderOptions
function header(hdr) end
---[[
-ELF segments.
+--[[ ELF segments.
+
The program headers are derived from these segment entries.
type field is mandatory and rest of fields are assigned defaults
or computed after layout.A segment describes either a range of sections
or a raw mapping. Do not mix the two forms.
]]
----@param xs Segment[]
+---@param xs SegmentOptions[]
function segments(xs) end
----@param xs Section[]
+---@param xs SectionOptions[]
function sections(xs) end