public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Fix error message during relocation overflow
@ 2017-10-18 15:38 Tulio Magno Quites Machado Filho
  2017-10-30 11:21 ` Adhemerval Zanella
  0 siblings, 1 reply; 3+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2017-10-18 15:38 UTC (permalink / raw)
  To: libc-alpha

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.

2017-10-18  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.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
---
 sysdeps/powerpc/powerpc64/dl-machine.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sysdeps/powerpc/powerpc64/dl-machine.c b/sysdeps/powerpc/powerpc64/dl-machine.c
index 2cfd43b..4c1b556 100644
--- a/sysdeps/powerpc/powerpc64/dl-machine.c
+++ b/sysdeps/powerpc/powerpc64/dl-machine.c
@@ -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)
     {
-- 
2.9.5

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: Fix error message during relocation overflow
  2017-10-18 15:38 [PATCH] powerpc: Fix error message during relocation overflow Tulio Magno Quites Machado Filho
@ 2017-10-30 11:21 ` Adhemerval Zanella
  2018-01-05 20:58   ` Tulio Magno Quites Machado Filho
  0 siblings, 1 reply; 3+ messages in thread
From: Adhemerval Zanella @ 2017-10-30 11:21 UTC (permalink / raw)
  To: libc-alpha



On 18/10/2017 13:38, Tulio Magno Quites Machado Filho wrote:
> 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.
> 
> 2017-10-18  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.
> 
> Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/powerpc/powerpc64/dl-machine.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/sysdeps/powerpc/powerpc64/dl-machine.c b/sysdeps/powerpc/powerpc64/dl-machine.c
> index 2cfd43b..4c1b556 100644
> --- a/sysdeps/powerpc/powerpc64/dl-machine.c
> +++ b/sysdeps/powerpc/powerpc64/dl-machine.c
> @@ -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)
>      {
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: Fix error message during relocation overflow
  2017-10-30 11:21 ` Adhemerval Zanella
@ 2018-01-05 20:58   ` Tulio Magno Quites Machado Filho
  0 siblings, 0 replies; 3+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2018-01-05 20:58 UTC (permalink / raw)
  To: libc-alpha

Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:

> On 18/10/2017 13:38, Tulio Magno Quites Machado Filho wrote:
>> 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.
>> 
>> 2017-10-18  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.
>> 
>> Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
>
> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

Pushed as 3a32b7168d9f.

-- 
Tulio Magno

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-05 20:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-18 15:38 [PATCH] powerpc: Fix error message during relocation overflow Tulio Magno Quites Machado Filho
2017-10-30 11:21 ` Adhemerval Zanella
2018-01-05 20:58   ` Tulio Magno Quites Machado Filho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).