diff options
Diffstat (limited to 'elf/header.lua')
| -rw-r--r-- | elf/header.lua | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/elf/header.lua b/elf/header.lua index de939d9..179e3bd 100644 --- a/elf/header.lua +++ b/elf/header.lua @@ -50,20 +50,6 @@ local M = {} ---@param hdropts HeaderOptions ---@return Header function M.normalize(hdropts) - -- TODO drop these error() and return, let callers report. - if not hdropts.class then error("class is required in header", 3) end - if not hdropts.data then error("data is required in header", 3) end - if not hdropts.type then error("type is required in header", 3) end - if not hdropts.machine then error("machine is required in header", 3) end - - -- Can't pack without these values being valid. - if hdropts.class ~= ec.Class.bit32 and hdropts.class ~= ec.Class.bit64 then - error("class must be Class.bit32 or Class.bit64 in header", 3) - end - if hdropts.data ~= ec.Endian.little and hdropts.data ~= ec.Endian.big then - error("data must be Endian.little or Endian.big in header", 3) - end - local phoff, ehsize, phentsize, shentsize if hdropts.class == ec.Class.bit32 then phoff = hdropts.phoff or 0x34 |
