about summary refs log tree commit diff
path: root/elf/dl-reloc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-11-05 22:13:46 +0000
committerUlrich Drepper <drepper@redhat.com>2001-11-05 22:13:46 +0000
commitea41b9267dbd64faec6630e45fac87afb663ec11 (patch)
tree679e69865b152dc393c67d28740f83486df047b8 /elf/dl-reloc.c
parent3abe7c31ed9b6d7b6b977ecba0e0eabce9d5ba1f (diff)
downloadglibc-ea41b9267dbd64faec6630e45fac87afb663ec11.tar.gz
glibc-ea41b9267dbd64faec6630e45fac87afb663ec11.tar.xz
glibc-ea41b9267dbd64faec6630e45fac87afb663ec11.zip
Update.
	* elf/dl-reloc.c (_dl_reloc_bad_type): Rewrite to not use writable
	strings.  Change type of second parameter.
	* sysdeps/generic/ldsodefs.h: Adjust _dl_reloc_bad_type prototype
	for last change.
Diffstat (limited to 'elf/dl-reloc.c')
-rw-r--r--elf/dl-reloc.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index 931c9f455d..4ee0da0e9e 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -187,28 +187,23 @@ cannot make segment writable for relocation"));
     }
 }
 
-#include "../stdio-common/_itoa.h"
-#define DIGIT(b)	_itoa_lower_digits[(b) & 0xf];
 
 void
 internal_function
-_dl_reloc_bad_type (struct link_map *map, uint_fast8_t type, int plt)
+_dl_reloc_bad_type (struct link_map *map, unsigned int type, int plt)
 {
   extern const char _itoa_lower_digits[];
-  if (plt)
-    {
-      /* XXX We cannot translate the message.  */
-      static 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, NULL, msg);
-    }
-  else
-    {
-      /* XXX We cannot translate the message.  */
-      static 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, NULL, msg);
-    }
+#define DIGIT(b)	_itoa_lower_digits[(b) & 0xf];
+
+  /* XXX We cannot translate these messages.  */
+  static const char msg[2][32] = { "unexpected reloc type 0x",
+				   "unexpected PLT reloc type 0x" };
+  char msgbuf[sizeof (msg[0])];
+  char *cp;
+
+  cp = __stpcpy (msgbuf, msg[plt]);
+  *cp++ = DIGIT (type >> 4);
+  *cp = DIGIT (type);
+
+  _dl_signal_error (0, map->l_name, NULL, msgbuf);
 }