aboutsummaryrefslogtreecommitdiffstats
path: root/elf/hello.c
blob: 0ab84de4b48cee6879e72169a8805c26b2bb89c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// A simple Hello World ELF module

// TODO: Define some macros that would put the initialization and termination
// functions in a separate section (suggestion: .init and .fini)

// Undefined symbol
extern int undef_symbol;

// Undefined function
extern void undef_func(int param);

int hello_init() {
	undef_symbol++;
	
	return 0;
}

void hello_exit() {
	undef_func(undef_symbol);
}