diff options
author | Stefan Bucur <stefanb@zytor.com> | 2008-07-01 17:03:46 +0300 |
---|---|---|
committer | Stefan Bucur <stefan@stefan-ubumac.(none)> | 2009-03-15 10:03:13 +0200 |
commit | 096c21fc8d76c3a9dc97f1ed5ba3abc8c51481cd (patch) | |
tree | 9aa0d46c1687856dd4c11170d45a220c5b0e2db0 /com32/elflink/hello_ref.c | |
parent | 7bb46a5400abb256e96ba3b637db8afe7bb321e9 (diff) | |
download | syslinux-elf-096c21fc8d76c3a9dc97f1ed5ba3abc8c51481cd.tar.gz syslinux-elf-096c21fc8d76c3a9dc97f1ed5ba3abc8c51481cd.tar.xz syslinux-elf-096c21fc8d76c3a9dc97f1ed5ba3abc8c51481cd.zip |
Moved the module loading code onto SYSLINUX, as a COM32 module.
The code does nothing for now. It simply compiles the code and ensures
all the dependencies are satisfied.
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); +} |