Fix endianness issues in ELF module.
See
@@ -478,11 +478,13 @@ static const char* str_table_entry(
yr_set_integer(yr_##bo##16toh(elf->type), elf_obj, "type"); \
yr_set_integer(yr_##bo##16toh(elf->machine), elf_obj, "machine"); \
yr_set_integer(yr_##bo##bits##toh(elf->sh_offset), elf_obj, "sh_offset"); \
- yr_set_integer(yr_##bo##16toh(elf->sh_entry_size), elf_obj, "sh_entry_size"); \
+ yr_set_integer( \
+ yr_##bo##16toh(elf->sh_entry_size), elf_obj, "sh_entry_size"); \
yr_set_integer( \
yr_##bo##16toh(elf->sh_entry_count), elf_obj, "number_of_sections"); \
yr_set_integer(yr_##bo##bits##toh(elf->ph_offset), elf_obj, "ph_offset"); \
- yr_set_integer(yr_##bo##16toh(elf->ph_entry_size), elf_obj, "ph_entry_size"); \
+ yr_set_integer( \
+ yr_##bo##16toh(elf->ph_entry_size), elf_obj, "ph_entry_size"); \
yr_set_integer( \
yr_##bo##16toh(elf->ph_entry_count), elf_obj, "number_of_segments"); \
\
@@ -650,8 +652,7 @@ static const char* str_table_entry(
yr_set_integer( \
yr_##bo##bits##toh(sym->size), elf_obj, "symtab[%i].size", j); \
\
- int other = yr_##bo##bits##toh(sym->other); \
- (*symbol)->visibility = other & 0x3; \
+ (*symbol)->visibility = sym->other & 0x3; \
\
symbol = &((*symbol)->next); \
} \
@@ -729,8 +730,7 @@ static const char* str_table_entry(
"dynsym[%i].size", \
m); \
\
- int other = yr_##bo##bits##toh(dynsym->other); \
- (*symbol)->visibility = other & 0x3; \
+ (*symbol)->visibility = dynsym->other & 0x3; \
\
symbol = &((*symbol)->next); \
} \
