From 2c3f9a53205e8a44a4b58f68e3cce2732225d05f Mon Sep 17 00:00:00 2001 From: Feng Tang Date: Thu, 17 Jun 2010 11:57:39 +0800 Subject: elflink: change the main func of hello.c to static Otherwise it will be global and can't be searched, still don't know the real reason --- com32/elflink/modules/hello.c | 3 +-- com32/include/sys/module.h | 19 +------------------ 2 files changed, 2 insertions(+), 20 deletions(-) (limited to 'com32') diff --git a/com32/elflink/modules/hello.c b/com32/elflink/modules/hello.c index 3db23536..cba63e2e 100644 --- a/com32/elflink/modules/hello.c +++ b/com32/elflink/modules/hello.c @@ -14,8 +14,7 @@ #define NUM_COUNT 10 #define MAX_NUM 100 -//static int hello_main(int argc, char **argv) -int hello_main(int argc, char **argv) +static int hello_main(int argc, char **argv) { int *nums = NULL; int i; diff --git a/com32/include/sys/module.h b/com32/include/sys/module.h index 055f540e..783c8419 100644 --- a/com32/include/sys/module.h +++ b/com32/include/sys/module.h @@ -15,8 +15,6 @@ #include #include - - /* * The maximum length of the module file name (including path), stored * in the struct module descriptor. @@ -138,7 +136,7 @@ static inline dump_elf_module(struct elf_module *module) { mp("module name = %s", module->name); printf("base_addr = 0x%p, module_size = %d\n", module->base_addr, module->module_size); - //printf("hash tlb = 0x%p, ghash tbl = 0x%p\n", module->hash_table, module->ghash_table); + printf("hash tlb = 0x%p, ghash tbl = 0x%p\n", module->hash_table, module->ghash_table); printf("str tbl = 0x%p, size = %d\n", module->str_table, module->strtable_size); printf("sym tbl = 0x%p, entry = %d, size = %d\n", module->sym_table, module->syment_size, module->symtable_size); /* @@ -171,7 +169,6 @@ struct module_dep { * This portion is included by dynamic (ELF) module source files. */ -#if 1 #define MODULE_INIT(fn) static module_init_t __module_init \ __used __attribute__((section(".ctors_modinit"))) = fn @@ -181,20 +178,6 @@ struct module_dep { #define MODULE_MAIN(fn) static module_main_t __module_main \ __used __attribute__((section(".ctors_modmain"))) = fn -#else - -#define MODULE_INIT(fn) static module_init_t __module_init \ - __attribute__((section(".ctors_modinit"))) = fn - -#define MODULE_EXIT(fn) static module_exit_t __module_exit \ - __attribute__((section(".dtors_modexit"))) = fn - -#define MODULE_MAIN(fn) static module_main_t __module_main \ - __attribute__((section(".ctors_modmain"))) = fn - -#endif - - #else /* -- cgit