[PATCH] Fix _dl_reloc_bad_type

Jakub Jelinek jakub@redhat.com
Wed May 10 03:01:00 GMT 2000


Hi!

sizeof msg is including the terminating '\0', so we used to put the digits
at a wrong place.
Now have to find out what reloc ld.so is not happy about in libstdc++...

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

	* elf/dl-reloc.c (_dl_reloc_bad_type): Write type into the message
	at proper place.

--- libc/elf/dl-reloc.c.jj	Mon May  8 08:22:14 2000
+++ libc/elf/dl-reloc.c	Wed May 10 11:50:58 2000
@@ -158,15 +158,15 @@ _dl_reloc_bad_type (struct link_map *map
   if (plt)
     {
       char msg[] = "unexpected reloc type 0x??";
-      msg[sizeof msg - 2] = DIGIT(type >> 8);
-      msg[sizeof msg - 1] = DIGIT(type);
+      msg[sizeof msg - 3] = DIGIT(type >> 8);
+      msg[sizeof msg - 2] = DIGIT(type);
       _dl_signal_error (0, map->l_name, msg);
     }
   else
     {
       char msg[] = "unexpected PLT reloc type 0x??";
-      msg[sizeof msg - 2] = DIGIT(type >> 8);
-      msg[sizeof msg - 1] = DIGIT(type);
+      msg[sizeof msg - 3] = DIGIT(type >> 8);
+      msg[sizeof msg - 2] = DIGIT(type);
       _dl_signal_error (0, map->l_name, msg);
     }
 }

	Jakub


More information about the Libc-hacker mailing list