diff options
author | Chandramouli Narayanan <chandramouli.narayanan@intel.com> | 2012-09-05 07:49:49 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-09-05 07:49:49 +0100 |
commit | a40bb65a4d1351c7c2b414152186f63aa5ea2a07 (patch) | |
tree | 30fa609cd994a98b98aa60843d998175f4488523 | |
parent | 2088016394a3e0cecbddda97ac71a895ae8513ff (diff) | |
download | syslinux-a40bb65a4d1351c7c2b414152186f63aa5ea2a07.tar.gz syslinux-a40bb65a4d1351c7c2b414152186f63aa5ea2a07.tar.xz syslinux-a40bb65a4d1351c7c2b414152186f63aa5ea2a07.zip |
module: Fixed the upper limit in symbol table walk through
Number of entries in symbol table should be sized by the table entry
size. Without this, the loading of modules takes forever due to
walking all over the memory.
Signed-off-by: Chandramouli Narayanan <chandramouli.narayanan@intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r-- | com32/lib/sys/module/common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c index 6e63907d..30c57b4b 100644 --- a/com32/lib/sys/module/common.c +++ b/com32/lib/sys/module/common.c @@ -47,7 +47,7 @@ void print_elf_symbols(struct elf_module *module) { unsigned int i; Elf32_Sym *crt_sym; - for (i = 1; i < module->symtable_size; i++) + for (i = 1; i < module->symtable_size/module->syment_size; i++) { crt_sym = (Elf32_Sym*)(module->sym_table + i*module->syment_size); @@ -315,7 +315,7 @@ int check_symbols(struct elf_module *module) int strong_count; int weak_count; - for(i = 1; i < module->symtable_size; i++) + for (i = 1; i < module->symtable_size/module->syment_size; i++) { crt_sym = symbol_get_entry(module, i); crt_name = module->str_table + crt_sym->st_name; @@ -535,7 +535,7 @@ static Elf32_Sym *module_find_symbol_iterate(const char *name,struct elf_module unsigned int i; Elf32_Sym *crt_sym; - for (i=1; i < module->symtable_size; i++) + for (i = 1; i < module->symtable_size/module->syment_size; i++) { crt_sym = symbol_get_entry(module, i); if (strcmp(name, module->str_table + crt_sym->st_name) == 0) |