ltoff relocation support

This commit is contained in:
phcoder 2011-01-02 14:39:23 +01:00
parent f9c30af6d0
commit daca6c5f45

View file

@ -187,6 +187,10 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
rel++) rel++)
switch (ELF_R_TYPE (rel->r_info)) switch (ELF_R_TYPE (rel->r_info))
{ {
case R_IA64_LTOFF22X:
case R_IA64_LTOFF22:
gp_size += 8;
break;
default: break; default: break;
} }
} }
@ -275,6 +279,16 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
case R_IA64_SEGREL64LSB: case R_IA64_SEGREL64LSB:
*(grub_uint64_t *) addr += value - rel->r_offset; *(grub_uint64_t *) addr += value - rel->r_offset;
break; break;
case R_IA64_LTOFF22X:
case R_IA64_LTOFF22:
*gpptr = value;
add_value_to_slot13_20 (addr, (gpptr - gp) * sizeof (grub_uint64_t), slot);
gpptr++;
break;
/* We treat LTOFF22X as LTOFF22, so we can ignore LDXMOV. */
case R_IA64_LDXMOV:
break;
default: default:
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"this relocation (0x%x) is not implemented yet", "this relocation (0x%x) is not implemented yet",