Before i try this does anybody know if this format will work as this is a structure i have never even
seen before, it is a special type of (eBPF ELF File).... I normally just use format Elf64 executable
but there is a elf dynamic linking from scratch that i can maybe alter to maybe work, just it states its type REL, to get eBPF working i think i need this unknown format ..(EM_BPF ).. - just dont know if
its even possible.
(im just concerned as i know FASM sometimes doesnt generate sections,, need sections definatly)
Any quick responses if anybody knows more on formats,
(LINK)..... (im going to try build this structure as below).
(https://www.ietf.org/archive/id/draft-thaler-bpf-elf-00.html)
(below few quick specs but main link above).... cheers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HEADER
e_ident[EI_CLASS] must be set to ELFCLASS64 (2).
e_type must be set to ET_REL (1) .
e_machine must be set to EM_BPF (247).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Classic Map Definitions
The format of a map definition is as follows, where fields are in the byte order indicated in e_ident[EI_DATA] in the ELF header:
typedef struct {
Elf64_Word type;
Elf64_Word key_size;
Elf64_Word value_size;
Elf64_Word max_entries;
Elf64_Word inner_map_idx;
unsigned char platform_specific_data[];
} Elf64_BpfMapDefinition;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BTF Map Definitions
BTF eBPF map definitions are stored in a DATA section named ".maps". The number of map definitions in a section can be determined by counting the number of symbols in the
".symtab" section that point into the ".maps" section.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_________________ d.bonas
Last edited by duanebonas6822 on 28 Jan 2025, 19:23; edited 1 time in total
|