]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
powerpc: Fix error message during relocation overflow
authorTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Fri, 5 Jan 2018 20:34:09 +0000 (18:34 -0200)
committerTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Fri, 5 Jan 2018 20:34:09 +0000 (18:34 -0200)
The function _itoa_word() writes characters from the higher address to
the lower address, requiring the destination string to reserve that size
before calling it.

* sysdeps/powerpc/powerpc64/dl-machine.c (_dl_reloc_overflow):
Reserve 16 chars to reloc_addr before calling _itoa_word.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
ChangeLog
sysdeps/powerpc/powerpc64/dl-machine.c

index 8928d9bed23f490fbb415f05df4582e81f09aa01..7a09e8e44a51d1b8d3dbeb0fe9acb8af09dd64b3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-05  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
+
+       * sysdeps/powerpc/powerpc64/dl-machine.c (_dl_reloc_overflow):
+       Reserve 16 chars to reloc_addr before calling _itoa_word.
+
 2018-01-05  Aurelien Jarno  <aurelien@aurel32.net>
 
        [BZ #22678]
index d732a854eae1d16c74e51f2efd90964c2652836c..959907bf02a5c973b22dc442878eb4345085f32e 100644 (file)
@@ -31,7 +31,10 @@ _dl_reloc_overflow (struct link_map *map,
   char buffer[1024];
   char *t;
   t = stpcpy (buffer, name);
-  t = stpcpy (t, " reloc at 0x");
+  /* Notice that _itoa_word() writes characters from the higher address to the
+     lower address, requiring the destination string to reserve all the
+     required size before the call.  */
+  t = stpcpy (t, " reloc at 0x0000000000000000");
   _itoa_word ((unsigned long) reloc_addr, t, 16, 0);
   if (refsym)
     {