This document is for accumulating basic ELF format related definition and commands.
-
Start container
docker run -it centos:8
-
Install dependencies
# for xxd command yum install vim-common yum install gcc # for better syntax highlight yum install vim
-
Build testing program
// File name: main.c
// Build command: gcc ./main.c -o main
#include <stdio.h>
int main()
{
printf("Hello World!\n");
return 0;
}
-
Display program in hexadecimal:
xxd -l 64 ./main
-
List symbol table:
readelf --symbols ./main
-
Display ELF header in a more readable way:
readelf -h ./main
-
MacOS is using its own object format
Mach-O
-
Understanding the ELF File Format
This fie described the benefits of standardizing binary file format with ELF format.
-
In-depth: ELF - The Extensible & Linkable Format
This video provides a structured introduction of ELF
-
ELF format is first published in the specification for the application binary interface(ABI) of Unix
> This documents more detailed learning about ABI