Skip to content

MikhailProg/elf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

ELF loader

A small elf loader. It can load static and dynamically linked ELF EXEC and DYN (pie) binaries. The loader is PIE program that doesn't depend on libc and calls kernel services directly (z_syscall.c).

If the loader needs to load a dynamically linked ELF it places an interpreter (usually ld.so) and a requested binary into a memory and then calls the interpreter entry point.

Build

Default build is for amd64:

$ make

Build for i386:

$ make ARCH=i386

Small build (exclude all messages and printf):

$ make SMALL=1

Load binaries

Run basic hello world test:

$ ./test.sh 
default        : PASS
static         : PASS
pie            : PASS
static pie     : PASS

Run tests if the loader is built for i386:

$ M32= ./test.sh
...

Load ls:

$ ./loader /bin/ls

Load galculator:

$ ./loader /usr/bin/galculator