Fix 2 incorrect vaddr_offsets

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-05-08 14:33:30 +02:00
parent ad6e5cf25f
commit a988e7aa63

View file

@ -446,8 +446,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections,
grub_uint64_t noff; grub_uint64_t noff;
make_trampoline (tr, addend + sym_addr); make_trampoline (tr, addend + sym_addr);
noff = ((char *) tr - (char *) pe_target noff = ((char *) tr - (char *) pe_target
- target_section_addr - (offset & ~3) - target_section_addr - (offset & ~3)) >> 4;
- image_target->vaddr_offset) >> 4;
tr++; tr++;
if (noff & ~MASK19) if (noff & ~MASK19)
grub_util_error ("trampoline offset too big (%lx)", grub_util_error ("trampoline offset too big (%lx)",
@ -461,7 +460,8 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections,
case R_IA64_LTOFF22: case R_IA64_LTOFF22:
*gpptr = grub_host_to_target64 (addend + sym_addr); *gpptr = grub_host_to_target64 (addend + sym_addr);
add_value_to_slot_21 ((grub_addr_t) target, add_value_to_slot_21 ((grub_addr_t) target,
(char *) gpptr - (char *) pe_target); (char *) gpptr - (char *) pe_target
+ image_target->vaddr_offset);
gpptr++; gpptr++;
break; break;