From f45ff5c60b7464dc250671d58c969a6320aad9b6 Mon Sep 17 00:00:00 2001 From: Sunil Nimmagadda Date: Wed, 4 Nov 2026 11:11:32 +0530 Subject: 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. --- types/elf.d.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'types') 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 -- cgit v1.3