aboutsummaryrefslogtreecommitdiff
path: root/sample_elf.lua
blob: 724a221ec9b3b6647a38d83197e89bde369ee699 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
header {
    class = Class.bit64,
    data = Endian.little,
    type = Type.exec,
    machine = Machine.x86_64,
}

-- segments {
--     { type = SegmentType.dynamic },
--     "x",
-- }
-- sections { 5 }

segments {
    {
        type = SegmentType.dynamic,
    },
    {
        type = SegmentType.dynamic,
        flags = SegmentFlags.r,
        offset = 0xa,
        vaddr = 0xaa,
        paddr = 0xaaa,
        filesz = 0xaaaa,
        memsz = 0xaaaaa,
        align = 1,
    },
}

sections {
    {
        name = ".foo",
        type = SectionType.symtab,
        flags = SectionFlags.alloc,
    },
}

for _, s in ipairs({ ".note.netbsd.ident", ".note.netbsd.pax", }) do
    sections {
        {
            name = s,
            type = SectionType.note,
            flags = SectionFlags.strings,
        },
    }
end