* kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Add

support for R_SPARC_OLO10 relocations.  Fix compile warning for
	R_SPARC_WDISP30 case.
This commit is contained in:
davem 2009-04-07 23:48:28 +00:00
parent 1007d1f562
commit c2cdde70b3
2 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2009-04-07 David S. Miller <davem@davemloft.net>
* kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Add
support for R_SPARC_OLO10 relocations. Fix compile warning for
R_SPARC_WDISP30 case.
2009-04-06 Pavel Roskin <proski@gnu.org> 2009-04-06 Pavel Roskin <proski@gnu.org>
* include/grub/misc.h (ARRAY_SIZE): New macro. * include/grub/misc.h (ARRAY_SIZE): New macro.

View file

@ -95,7 +95,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
+ entsize * ELF64_R_SYM (rel->r_info)); + entsize * ELF64_R_SYM (rel->r_info));
value = sym->st_value + rel->r_addend; value = sym->st_value + rel->r_addend;
switch (ELF64_R_TYPE (rel->r_info)) switch (ELF64_R_TYPE (rel->r_info) & 0xff)
{ {
case R_SPARC_32: /* 3 V-word32 */ case R_SPARC_32: /* 3 V-word32 */
if (value & 0xFFFFFFFF00000000) if (value & 0xFFFFFFFF00000000)
@ -105,8 +105,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
break; break;
case R_SPARC_WDISP30: /* 7 V-disp30 */ case R_SPARC_WDISP30: /* 7 V-disp30 */
if (((value - (Elf64_Addr) addr) & 0xFFFFFFFF00000000) && if (((value - (Elf64_Addr) addr) & 0xFFFFFFFF00000000) &&
((value - (Elf64_Addr) addr) & 0xFFFFFFFF00000000 (((value - (Elf64_Addr) addr) & 0xFFFFFFFF00000000)
!= 0xFFFFFFFF00000000)) != 0xFFFFFFFF00000000))
return grub_error (GRUB_ERR_BAD_MODULE, return grub_error (GRUB_ERR_BAD_MODULE,
"Displacement out of 30 bits range"); "Displacement out of 30 bits range");
*addr = (*addr & 0xC0000000) | *addr = (*addr & 0xC0000000) |
@ -125,6 +125,12 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
case R_SPARC_64: /* 32 V-xwords64 */ case R_SPARC_64: /* 32 V-xwords64 */
*(Elf64_Xword *) addr = value; *(Elf64_Xword *) addr = value;
break; break;
case R_SPARC_OLO10:
*addr = (*addr & ~0x1fff)
| (((value & 0x3ff) +
(ELF64_R_TYPE (rel->r_info) >> 8))
& 0x1fff);
break;
default: default:
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"This relocation (%d) is not implemented yet", "This relocation (%d) is not implemented yet",