From fb9303f07290e6d62859b9da05f58f0b5aa2b64e Mon Sep 17 00:00:00 2001 From: Sunil Nimmagadda Date: Thu, 29 Oct 2026 18:47:02 +0530 Subject: Define some section related enums. --- elf/constants.lua | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'elf/constants.lua') diff --git a/elf/constants.lua b/elf/constants.lua index 0a7c735..859440e 100644 --- a/elf/constants.lua +++ b/elf/constants.lua @@ -98,4 +98,47 @@ M.SegmentFlags = { r = 0x4, } +---@enum SectionType +M.SectionType = { + null = 0x0, + progbits = 0x1, + symtab = 0x2, + strtab = 0x3, + rela = 0x4, + hash = 0x5, + dynamic = 0x6, + note = 0x7, + nobits = 0x8, + rel = 0x9, + shlib = 0xa, + dynsym = 0xb, + init_array = 0xe, + fini_array = 0xf, + preinit_array = 0x10, + group = 0x11, + symtab_shndx = 0x12, + num = 0x13, + loos = 0x60000000, + hios = 0x6fffffff, + -- TODO +} + +---@enum SectionFlags +M.SectionFlags = { + write = 0x1, + alloc = 0x2, + execinstr = 0x4, + merge = 0x10, + strings = 0x20, + info_link = 0x40, + link_order = 0x80, + os_nonconforming = 0x100, + group = 0x200, + tls = 0x400, + maskos = 0x0ff00000, + maskproc = 0xf0000000, + ordered = 0x4000000, + exclude = 0x8000000, +} + return M -- cgit v1.3