aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/modules/hello.c
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2010-06-03 11:00:22 +0800
committerFeng Tang <feng.tang@intel.com>2010-07-20 11:10:03 +0800
commit70aa5968a72030aff10fbdb1cb2c1c6c08de5fec (patch)
tree7d1344bd23b7019393156856ccb135847e313ede /com32/elflink/modules/hello.c
parent0cb6490fa96f752c01bbb9add2c9ca6dbf99ece2 (diff)
downloadsyslinux-70aa5968a72030aff10fbdb1cb2c1c6c08de5fec.tar.gz
syslinux-70aa5968a72030aff10fbdb1cb2c1c6c08de5fec.tar.xz
syslinux-70aa5968a72030aff10fbdb1cb2c1c6c08de5fec.zip
elflink: copy some elflink related files over
also make sure the compiling passed
Diffstat (limited to 'com32/elflink/modules/hello.c')
-rw-r--r--com32/elflink/modules/hello.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/com32/elflink/modules/hello.c b/com32/elflink/modules/hello.c
new file mode 100644
index 00000000..3db23536
--- /dev/null
+++ b/com32/elflink/modules/hello.c
@@ -0,0 +1,31 @@
+/*
+ * hello.c - A simple ELF module that sorts a couple of numbers
+ *
+ * Created on: Aug 11, 2008
+ * Author: Stefan Bucur <stefanb@zytor.com>
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/module.h>
+
+#include "sort.h"
+
+#define NUM_COUNT 10
+#define MAX_NUM 100
+
+//static int hello_main(int argc, char **argv)
+int hello_main(int argc, char **argv)
+{
+ int *nums = NULL;
+ int i;
+
+ nums = malloc(NUM_COUNT * sizeof(int));
+ printf("Hello, world, from 0x%08X! malloc return %p\n", (unsigned int)&hello_main), nums;
+
+ free(nums);
+
+ return 0;
+}
+
+MODULE_MAIN(hello_main);