diff options
author | Matt Fleming <matt.fleming@linux.intel.com> | 2011-04-07 21:02:02 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@linux.intel.com> | 2011-04-26 09:53:24 +0100 |
commit | 990e7e1df3dc6fa456ff7cdaec7d239977557c8d (patch) | |
tree | db0f41f9f1c96e6036a0e2af47ee0b20a9238d27 /com32/elflink/ldlinux | |
parent | c6f10fb1b9b4f56fa6d7b6b73e1fdef96b63d912 (diff) | |
download | syslinux-990e7e1df3dc6fa456ff7cdaec7d239977557c8d.tar.gz syslinux-990e7e1df3dc6fa456ff7cdaec7d239977557c8d.tar.xz syslinux-990e7e1df3dc6fa456ff7cdaec7d239977557c8d.zip |
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>
Diffstat (limited to 'com32/elflink/ldlinux')
-rw-r--r-- | com32/elflink/ldlinux/ldlinux.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c index 839a28a5..5f4b058b 100644 --- a/com32/elflink/ldlinux/ldlinux.c +++ b/com32/elflink/ldlinux/ldlinux.c @@ -97,7 +97,7 @@ static void enter_cmdline(void) } } -static int ldlinux_main(int argc, char **argv) +int main(int argc, char **argv) { openconsole(&dev_rawcon_r, &dev_ansiserial_w); @@ -129,4 +129,3 @@ cmdline: return 0; } -MODULE_MAIN(ldlinux_main); |