Skip to content

Instantly share code, notes, and snippets.

@deanmlittle
deanmlittle / fib-so-teardown.md
Last active July 9, 2025 17:50
fib.so teardown

Deconstructing fib.so, a minimal sBPF program

For this deconstruction, we will be researching fib.so, a hand-rolled sBPF assembly program that calculates the fibonacci number based upon a u8 input.

Structure of an sBPF program

The structure of an sBPF program has 4 sections:

1. ELF Header

The starting point of the file, describing the overall file format, target environment, and offsets for program and section headers.

2. Program Headers

Define the memory segments and their attributes (readable, writable, executable) for runtime execution.