elflink: Remove MODULE_MAIN() from executable ELF modules
authorMatt Fleming <matt.fleming@linux.intel.com>
Thu, 7 Apr 2011 20:02:02 +0000 (21:02 +0100)
committerMatt Fleming <matt.fleming@linux.intel.com>
Tue, 26 Apr 2011 08:53:24 +0000 (09:53 +0100)
commit990e7e1df3dc6fa456ff7cdaec7d239977557c8d
treedb0f41f9f1c96e6036a0e2af47ee0b20a9238d27
parentc6f10fb1b9b4f56fa6d7b6b73e1fdef96b63d912
elflink: Remove MODULE_MAIN() from executable ELF modules

To make it easier to move existing COM32 modules over to ELF modules
without having to modify them we need to search for and run their
main() functions when they're loaded instead of requiring their
initial function to be labeled with MODULE_MAIN().

Currently, we require all executable ELF modules to specify their
initial function with the use of the MODULE_MAIN() macro and not via
the traditional method of naming it main(). However, there are weird
restrictions on what functions can be passed to MODULE_MAIN(), for
instance, they must be declared static.

This patch makes life much simpler and allows executable ELF modules
to be loaded without the MODULE_MAIN() wrapper, but rather by naming
their initial function main(). All the modules in com32/modules can
now be run as ELF modules without any modifications.

Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
16 files changed:
com32/elflink/ldlinux/ldlinux.c
com32/elflink/modules/Makefile
com32/elflink/modules/cpuid.c [deleted file]
com32/elflink/modules/cpuidtest.c [deleted file]
com32/elflink/modules/dir.c [deleted file]
com32/elflink/modules/disk.c [deleted file]
com32/elflink/modules/hello.c
com32/elflink/modules/meminfo.c
com32/elflink/modules/menu.c
com32/elflink/modules/mytest.c
com32/elflink/modules/pcitest.c [deleted file]
com32/elflink/modules/test.c
com32/elflink/modules/vesainfo.c
com32/include/sys/module.h
com32/lib/sys/module/elf_module.c
com32/lib/sys/module/exec.c