summaryrefslogtreecommitdiff
path: root/types/elf.d.lua
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2026-10-23 22:43:44 +0530
committerSunil Nimmagadda <sunil@nimmagadda.net>2026-10-23 22:44:48 +0530
commit79f6b161f892f621a909ce1df99b3c680f3682a2 (patch)
tree7647bed7ccaa977f3cd28dcc8283ceef63265e57 /types/elf.d.lua
parentd46e3e7761a133d58b6c77058473d9edc8a54744 (diff)
Refactor: Move to an elf module.
While here, define a elf.d.lua to help author type check configuration file.
Diffstat (limited to 'types/elf.d.lua')
-rw-r--r--types/elf.d.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/types/elf.d.lua b/types/elf.d.lua
new file mode 100644
index 0000000..a2b774d
--- /dev/null
+++ b/types/elf.d.lua
@@ -0,0 +1,22 @@
+---@meta
+
+local elf = require("elf")
+
+-- TODO keep in sync with mkelf:loadconfig() env.
+Class = elf.Class
+Endian = elf.Endian
+Osabi = elf.Osabi
+Type = elf.Type
+Machine = elf.Machine
+SegmentType = elf.SegmentType
+SegmentFlags = elf.SegmentFlags
+ELFVERSION = elf.VERSION
+
+---@param hdr Header
+function header(hdr) end
+
+---@param xs Section[]
+function sections(xs) end
+
+---@param xs Segment[]
+function segments(xs) end