summaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/header.lua3
-rw-r--r--elf/section.lua9
-rw-r--r--elf/segment.lua5
3 files changed, 9 insertions, 8 deletions
diff --git a/elf/header.lua b/elf/header.lua
index 2a9ec68..6baf327 100644
--- a/elf/header.lua
+++ b/elf/header.lua
@@ -1,7 +1,5 @@
local fmt = require("elf.fmt")
-local M = {}
-
---@alias Magic [integer, integer, integer, integer]
---@class Header
@@ -24,6 +22,7 @@ local M = {}
---@field shentsize integer
---@field shnum integer
---@field shstrndx integer
+local M = {}
---@param hdr Header
---@return string
diff --git a/elf/section.lua b/elf/section.lua
index 64a91b2..5e185fd 100644
--- a/elf/section.lua
+++ b/elf/section.lua
@@ -1,14 +1,15 @@
local fmt = require("elf.fmt")
-local M = {}
-
---@class Section
----@param section Section
+---@class Sections
+local M = {}
+
+---@param sections Sections
---@param endian Endian
---@return string
---@nodiscard
-function M.pack(section, endian)
+function M.pack(sections, endian)
-- TODO
return string.pack("B", 0x1)
end
diff --git a/elf/segment.lua b/elf/segment.lua
index da8e9c6..662f42e 100644
--- a/elf/segment.lua
+++ b/elf/segment.lua
@@ -1,8 +1,6 @@
local ec = require("elf.constants")
local fmt = require("elf.fmt")
-local M = {}
-
---@class Segment
---@field type SegmentType
---@field flags integer
@@ -13,6 +11,9 @@ local M = {}
---@field memsz integer
---@field align integer
+---@class Segments
+local M = {}
+
---@param phdr Segment
---@param endian Endian
---@return string