Skip to content

ELF Object Format

Bedrock objects use the 64-bit little-endian ELF format and machine identifier EM_BEDROCK (0xffb0). A producer may emit relocatable objects, executable images, or shared/position-independent images using ET_REL, ET_EXEC, or ET_DYN.

All relocation sections use Elf64_Rela entries with explicit addends and the .rela section-name stem. Ordinary symbol and string tables use .symtab and .strtab. The baseline value of e_flags is zero; a consumer accepts zero as the baseline profile and rejects every unknown nonzero value.

ELF Identification Bytes

ELF e_ident Values

e_ident Field Value
EI_MAG 0x7f ’E’ ’L’ ’F’
EI_CLASS ELFCLASS64
EI_DATA ELFDATA2LSB
EI_VERSION EV_CURRENT
EI_OSABI ELFOSABI_NONE
EI_ABIVERSION 0

ELF Header Sizes

ELF Header Size Values

Header Field Bytes
e_ehsize 64
e_phentsize 56
e_shentsize 64

Entry Point Semantics

ELF Entry Point Rules

File Type e_entry Meaning
ET_REL 0
ET_EXEC absolute pre-segment virtual byte address
ET_DYN (executable) load-bias-relative pre-segment virtual byte address; runtime entry is load base + e entry
ET_DYN (shared object, entry value 0) 0

Program Header Policy

The standard PT_LOAD, PT_DYNAMIC, PT_INTERP, PT_NOTE, and PT_TLS program headers retain their ordinary ELF meanings.

Program permission bits use the standard values PF_X=1, PF_W=2, and PF_R=4. Every PT_LOAD has p_align equal to the selected page size or a larger power-of-two alignment; the minimum supported page alignment is 4096 bytes.

Section and Symbol Policy

Standard ELF section types and the SHF_WRITE, SHF_ALLOC, SHF_EXECINSTR, and SHF_TLS flags retain their generic meanings. Symbol binding and type occupy st_info in the ordinary ELF encoding. Architecture-specific st_other bits are reserved and must be zero.

In an ET_REL object, st_value is a byte offset from the start of the defining section. After final link, it is the symbol’s pre-segment virtual byte address. Ordinary function symbols retain their pre-segment address representation, and ordinary object symbols retain their byte-address representation.