diff options
Diffstat (limited to 'com32/elflink/hello_ref.c')
-rw-r--r-- | com32/elflink/hello_ref.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/com32/elflink/hello_ref.c b/com32/elflink/hello_ref.c new file mode 100644 index 00000000..f7b798b4 --- /dev/null +++ b/com32/elflink/hello_ref.c @@ -0,0 +1,26 @@ +// 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; + +int exported_symbol; + +// Undefined function +extern void undef_func(int param); + +int test_func(void) { + return undef_symbol++; +} + +static int hello_init(void) { + undef_symbol++; + + return 0; +} + +static void hello_exit(void) { + undef_func(undef_symbol); +} |