[syslinux:elflink] elflink: add elf module dump func

syslinux-bot for Feng Tang feng.tang at intel.com
Thu Aug 12 21:03:14 PDT 2010


Commit-ID:  601b091ac3403817d839e99ab83d399af4e8dbe9
Gitweb:     http://syslinux.zytor.com/commit/601b091ac3403817d839e99ab83d399af4e8dbe9
Author:     Feng Tang <feng.tang at intel.com>
AuthorDate: Wed, 16 Jun 2010 22:40:01 +0800
Committer:  Feng Tang <feng.tang at intel.com>
CommitDate: Tue, 20 Jul 2010 11:10:03 +0800

elflink: add elf module dump func



---
 com32/include/sys/module.h        |   17 +++++++++++++++++
 com32/lib/sys/module/elf_module.c |    4 +++-
 2 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/com32/include/sys/module.h b/com32/include/sys/module.h
index d7b50b8..055f540 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 9a9d198..187dfee 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;
 



More information about the Syslinux-commits mailing list