This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] sparc64 fixes


Hi!

Below is an implementation of R_SPARC_UA64 reloc in sparc64 ld.so (it is
present in .eh_frame because it aligns to 4 only), added sparc64-linux
time.c (it is defined in unistd.h due to sparc32 but the kernel
implementation is not 64bit clean) and, shame on me for not finding all at
once, I found one more bug in _dl_reloc_bad_type.

2000-05-10  Jakub Jelinek  <jakub@redhat.com>

	* elf/dl-reloc.c (_dl_reloc_bad_type): Sync messages with plt
	argument.
	* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Handle
	R_SPARC_UA64.
	* sysdeps/unix/sysv/linux/sparc/sparc64/time.c: New file.

--- libc/elf/dl-reloc.c.jj	Wed May 10 12:04:54 2000
+++ libc/elf/dl-reloc.c	Wed May 10 13:36:41 2000
@@ -157,14 +157,14 @@ _dl_reloc_bad_type (struct link_map *map
   extern const char _itoa_lower_digits[];
   if (plt)
     {
-      char msg[] = "unexpected reloc type 0x??";
+      char msg[] = "unexpected PLT reloc type 0x??";
       msg[sizeof msg - 3] = DIGIT(type >> 4);
       msg[sizeof msg - 2] = DIGIT(type);
       _dl_signal_error (0, map->l_name, msg);
     }
   else
     {
-      char msg[] = "unexpected PLT reloc type 0x??";
+      char msg[] = "unexpected reloc type 0x??";
       msg[sizeof msg - 3] = DIGIT(type >> 4);
       msg[sizeof msg - 2] = DIGIT(type);
       _dl_signal_error (0, map->l_name, msg);
--- libc/sysdeps/sparc/sparc64/dl-machine.h.jj	Mon May  8 14:30:55 2000
+++ libc/sysdeps/sparc/sparc64/dl-machine.h	Wed May 10 13:34:53 2000
@@ -316,6 +316,24 @@ elf_machine_rela (struct link_map *map, 
 	  elf_machine_fixup_plt(map, reloc, reloc_addr, value);
 	  break;
 
+	case R_SPARC_UA64:
+	  if (! ((long) reloc_addr & 3))
+	    {
+	      /* Common in .eh_frame */
+	      ((unsigned int *) reloc_addr) [0] = value >> 32;
+	      ((unsigned int *) reloc_addr) [1] = value;
+	      break;
+	    }
+	  ((unsigned char *) reloc_addr) [0] = value >> 56;
+	  ((unsigned char *) reloc_addr) [1] = value >> 48;
+	  ((unsigned char *) reloc_addr) [2] = value >> 40;
+	  ((unsigned char *) reloc_addr) [3] = value >> 32;
+	  ((unsigned char *) reloc_addr) [4] = value >> 24;
+	  ((unsigned char *) reloc_addr) [5] = value >> 16;
+	  ((unsigned char *) reloc_addr) [6] = value >> 8;
+	  ((unsigned char *) reloc_addr) [7] = value;
+	  break;
+
 	default:
 	  _dl_reloc_bad_type (map, ELFW(R_TYPE) (reloc->r_info), 0);
 	  break;
--- libc/sysdeps/unix/sysv/linux/sparc/sparc64/time.c.jj	Wed May 10 15:56:28 2000
+++ libc/sysdeps/unix/sysv/linux/sparc/sparc64/time.c	Wed May 10 15:56:35 2000
@@ -0,0 +1 @@
+#include <sysdeps/unix/time.c>

	Jakub

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]