aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/modules
diff options
context:
space:
mode:
authorStefan Bucur <stefanb@zytor.com>2008-08-11 16:48:30 +0300
committerStefan Bucur <stefan@stefan-ubumac.(none)>2009-03-15 10:10:50 +0200
commitfac2992f2848ce2a630ba03f3a9f43d5928297ae (patch)
tree93ae9e8db310a5bf162e9dc47ba70ffc03283397 /com32/elflink/modules
parenta1eecd49327fadb68988f5132fa288dc99c19113 (diff)
downloadsyslinux-elf-fac2992f2848ce2a630ba03f3a9f43d5928297ae.tar.gz
syslinux-elf-fac2992f2848ce2a630ba03f3a9f43d5928297ae.tar.xz
syslinux-elf-fac2992f2848ce2a630ba03f3a9f43d5928297ae.zip
Reorganized the module system in a consistent API.
Diffstat (limited to 'com32/elflink/modules')
-rw-r--r--com32/elflink/modules/Makefile2
-rw-r--r--com32/elflink/modules/hello.c11
2 files changed, 2 insertions, 11 deletions
diff --git a/com32/elflink/modules/Makefile b/com32/elflink/modules/Makefile
index 35958cf6..fc319b03 100644
--- a/com32/elflink/modules/Makefile
+++ b/com32/elflink/modules/Makefile
@@ -28,7 +28,7 @@ NASM = nasm
NASMOPT = -O9999
RANLIB = ranlib
CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \
- -fomit-frame-pointer -D__COM32__ \
+ -fomit-frame-pointer -D__COM32__ -DDYNAMIC_MODULE \
-nostdinc -iwithprefix include \
-I../../libutil/include -I../../include \
-Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d
diff --git a/com32/elflink/modules/hello.c b/com32/elflink/modules/hello.c
index f396c794..d1054a1f 100644
--- a/com32/elflink/modules/hello.c
+++ b/com32/elflink/modules/hello.c
@@ -4,17 +4,8 @@
*/
#include <stdio.h>
+#include <sys/module.h>
-typedef int (*module_init_t)(void);
-typedef void (*module_exit_t)(void);
-
-#define __used __attribute__((used))
-
-#define MODULE_INIT(fn) static module_init_t __module_init \
- __used __attribute__((section(".ctors_module"))) = fn
-
-#define MODULE_EXIT(fn) static module_exit_t __module_exit \
- __used __attribute__((section(".dtors_module"))) = fn
static int hello_init(void) {
printf("Hello, world, from 0x%08X!\n", (unsigned int)&hello_init);