aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/sys/module/common.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-04-02 11:07:56 +0100
committerMatt Fleming <matt.fleming@intel.com>2012-04-17 10:58:33 +0100
commitfdb708671b70182c597bed2fb0ed8d404e9f9b37 (patch)
treea6230c71fc65a5adc299e7f51364acb8a1390ff2 /com32/lib/sys/module/common.c
parentb5529aac6a38f15084f7710018fd24921cb6be54 (diff)
downloadsyslinux-fdb708671b70182c597bed2fb0ed8d404e9f9b37.tar.gz
syslinux-fdb708671b70182c597bed2fb0ed8d404e9f9b37.tar.xz
syslinux-fdb708671b70182c597bed2fb0ed8d404e9f9b37.zip
elflink: Fix build warnings
There's a lot of void * arithmetic going on in the ELF code that the compiler warns about, i.e. sys/module/common.c: In function ‘check_symbols’: sys/module/common.c:325:44: warning: pointer of type ‘void *’ used in arithmetic Cast the void * pointers to char * so that we can do byte arithmetic on them. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/lib/sys/module/common.c')
-rw-r--r--com32/lib/sys/module/common.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c
index e26163f1..eeb26075 100644
--- a/com32/lib/sys/module/common.c
+++ b/com32/lib/sys/module/common.c
@@ -322,7 +322,7 @@ int check_symbols(struct elf_module *module)
for(i = 1; i < module->symtable_size; i++)
{
- crt_sym = (Elf32_Sym*)(module->sym_table + i * module->syment_size);
+ crt_sym = symbol_get_entry(module, i);
crt_name = module->str_table + crt_sym->st_name;
strong_count = 0;
@@ -434,7 +434,7 @@ static Elf32_Sym *module_find_symbol_sysv(const char *name, struct elf_module *m
while (crt_index != STN_UNDEF) {
- crt_sym = (Elf32_Sym*)(module->sym_table + crt_index*module->syment_size);
+ crt_sym = symbol_get_entry(module, crt_index);
if (strcmp(name, module->str_table + crt_sym->st_name) == 0)
return crt_sym;
@@ -489,8 +489,7 @@ static Elf32_Sym *module_find_symbol_gnu(const char *name, struct elf_module *mo
do {
if (((*hasharr ^ h ) >> 1) == 0) {
- Elf32_Sym *crt_sym = (Elf32_Sym*)(module->sym_table +
- (hasharr - gnu_chain_zero) * module->syment_size);
+ Elf32_Sym *crt_sym = symbol_get_entry(module, (hasharr - gnu_chain_zero));
if (strcmp(name, module->str_table + crt_sym->st_name) == 0) {
return crt_sym;
@@ -511,7 +510,7 @@ static Elf32_Sym *module_find_symbol_iterate(const char *name,struct elf_module
for (i=1; i < module->symtable_size; i++)
{
- crt_sym = (Elf32_Sym*)(module->sym_table + i*module->syment_size);
+ crt_sym = symbol_get_entry(module, i);
if (strcmp(name, module->str_table + crt_sym->st_name) == 0)
{
return crt_sym;