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

"David S. Miller" <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2071
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2071
Author:   davem
Date:     2009-04-07 23:48:28 +0000 (Tue, 07 Apr 2009)
Log Message:
-----------
	* kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Add
	support for R_SPARC_OLO10 relocations.  Fix compile warning for
	R_SPARC_WDISP30 case.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/kern/sparc64/dl.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-04-07 00:48:57 UTC (rev 2070)
+++ trunk/grub2/ChangeLog	2009-04-07 23:48:28 UTC (rev 2071)
@@ -1,3 +1,9 @@
+2009-04-07  David S. Miller  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* include/grub/misc.h (ARRAY_SIZE): New macro.

Modified: trunk/grub2/kern/sparc64/dl.c
===================================================================
--- trunk/grub2/kern/sparc64/dl.c	2009-04-07 00:48:57 UTC (rev 2070)
+++ trunk/grub2/kern/sparc64/dl.c	2009-04-07 23:48:28 UTC (rev 2071)
@@ -95,7 +95,7 @@
 				     + entsize * ELF64_R_SYM (rel->r_info));
 
 		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 */
                     if (value & 0xFFFFFFFF00000000)
@@ -105,8 +105,8 @@
                     break;
                   case R_SPARC_WDISP30: /* 7 V-disp30 */
                     if (((value - (Elf64_Addr) addr) & 0xFFFFFFFF00000000) &&
-                        ((value - (Elf64_Addr) addr) & 0xFFFFFFFF00000000
-                        != 0xFFFFFFFF00000000))
+                        (((value - (Elf64_Addr) addr) & 0xFFFFFFFF00000000)
+			 != 0xFFFFFFFF00000000))
                       return grub_error (GRUB_ERR_BAD_MODULE,
                                          "Displacement out of 30 bits range");
                     *addr = (*addr & 0xC0000000) |
@@ -125,6 +125,12 @@
                   case R_SPARC_64: /* 32 V-xwords64 */
                     *(Elf64_Xword *) addr = value;
                     break;
+		  case R_SPARC_OLO10:
+		    *addr = (*addr & ~0x1fff)
+		      | (((value & 0x3ff) +
+			  (ELF64_R_TYPE (rel->r_info) >> 8))
+			 & 0x1fff);
+		    break;
 		  default:
 		    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
 				       "This relocation (%d) is not implemented yet",
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.