aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2010-06-16 22:40:01 +0800
committerFeng Tang <feng.tang@intel.com>2010-07-20 11:10:03 +0800
commit601b091ac3403817d839e99ab83d399af4e8dbe9 (patch)
treec3507312185276d82b5fd9a69e3f738b9575a911
parent066fc68f184ed163e36d8cefec965f7a8737e2eb (diff)
downloadsyslinux-601b091ac3403817d839e99ab83d399af4e8dbe9.tar.gz
syslinux-601b091ac3403817d839e99ab83d399af4e8dbe9.tar.xz
syslinux-601b091ac3403817d839e99ab83d399af4e8dbe9.zip
elflink: add elf module dump func
-rw-r--r--com32/include/sys/module.h17
-rwxr-xr-xcom32/lib/sys/module/elf_module.c4
2 files changed, 20 insertions, 1 deletions
diff --git a/com32/include/sys/module.h b/com32/include/sys/module.h
index d7b50b8e..055f540e 100644
--- a/com32/include/sys/module.h
+++ b/com32/include/sys/module.h
@@ -134,6 +134,23 @@ struct elf_module {
};
+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("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);
+ /*
+ printf("init: %p", module->init_func);
+ printf("main: %p", module->main_func);
+ printf("exit: %p", module->exit_func);
+ printf("", module->base_addr);
+ printf("", module->base_addr);
+ printf("", module->base_addr);
+ */
+}
+
/**
* struct module_dep - structure encapsulating a module dependency need
*
diff --git a/com32/lib/sys/module/elf_module.c b/com32/lib/sys/module/elf_module.c
index 9a9d1985..187dfee7 100755
--- a/com32/lib/sys/module/elf_module.c
+++ b/com32/lib/sys/module/elf_module.c
@@ -461,6 +461,8 @@ int module_load(struct elf_module *module) {
// Obtain dynamic linking information
CHECKED(res, prepare_dynlinking(module), error);
//printf("check... 4\n");
+ //
+ dump_elf_module(module);
// Check the symbols for duplicates / missing definitions
CHECKED(res, check_symbols(module), error);
@@ -484,12 +486,12 @@ int module_load(struct elf_module *module) {
image_unload(module);
/*
+ */
DBG_PRINT("MODULE %s LOADED SUCCESSFULLY (main@%p, init@%p, exit@%p)\n",
module->name,
(module->main_func == NULL) ? NULL : *(module->main_func),
(module->init_func == NULL) ? NULL : *(module->init_func),
(module->exit_func == NULL) ? NULL : *(module->exit_func));
- */
return 0;