2008-07-16 Pavel Roskin <proski@gnu.org>

* util/i386/efi/grub-mkimage.c (get_target_address): Return a
	pointer, not an integer.  This fixes a warning and prevents
	precision loss on 64-bit systems.
	(relocate_addresses): Remove unneeded cast.
This commit is contained in:
proski 2008-07-16 06:55:42 +00:00
parent 506b2b3e2b
commit 59652a208f
2 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2008-07-16 Pavel Roskin <proski@gnu.org>
* util/i386/efi/grub-mkimage.c (get_target_address): Return a
pointer, not an integer. This fixes a warning and prevents
precision loss on 64-bit systems.
(relocate_addresses): Remove unneeded cast.
2008-07-15 Pavel Roskin <proski@gnu.org> 2008-07-15 Pavel Roskin <proski@gnu.org>
* kern/i386/ieee1275/init.c: Include grub/cache.h. * kern/i386/ieee1275/init.c: Include grub/cache.h.

View file

@ -272,10 +272,10 @@ get_symbol_address (Elf32_Ehdr *e, Elf32_Shdr *s, Elf32_Word i)
} }
/* Return the address of a modified value. */ /* Return the address of a modified value. */
static Elf32_Addr static Elf32_Addr *
get_target_address (Elf32_Ehdr *e, Elf32_Shdr *s, Elf32_Addr offset) get_target_address (Elf32_Ehdr *e, Elf32_Shdr *s, Elf32_Addr offset)
{ {
return (Elf32_Addr) e + grub_le_to_cpu32 (s->sh_offset) + offset; return (Elf32_Addr *) ((char *) e + grub_le_to_cpu32 (s->sh_offset) + offset);
} }
/* Deal with relocation information. This function relocates addresses /* Deal with relocation information. This function relocates addresses
@ -333,8 +333,7 @@ relocate_addresses (Elf32_Ehdr *e, Elf32_Shdr *sections,
Elf32_Addr *target; Elf32_Addr *target;
offset = grub_le_to_cpu32 (r->r_offset); offset = grub_le_to_cpu32 (r->r_offset);
target = (Elf32_Addr *) get_target_address (e, target_section, target = get_target_address (e, target_section, offset);
offset);
info = grub_le_to_cpu32 (r->r_info); info = grub_le_to_cpu32 (r->r_info);
sym_addr = get_symbol_address (e, symtab_section, sym_addr = get_symbol_address (e, symtab_section,
ELF32_R_SYM (info)); ELF32_R_SYM (info));