diff mbox

[ARM,v2] PR target/68059 libgcc should not use __write for printing fatal error

Message ID 563CAC08.7050109@arm.com
State New
Headers show

Commit Message

Szabolcs Nagy Nov. 6, 2015, 1:32 p.m. UTC
libgcc/config/arm/linux-atomic-64bit.c uses __write to print an error
message if the 64bit cmpxchg method is not available in the kernel.

__write is not part of the public libc abi, so use write instead.
(user code may define write in iso c conforming mode and then the
error message may not be visible before the crash.)

The return type in the declaration of write is fixed too.

OK for trunk and backporting?

libgcc/ChangeLog:

2015-11-06  Szabolcs Nagy  <szabolcs.nagy@arm.com>

	PR target/68059
	* config/arm/linux-atomic-64bit.c (__write): Rename to...
	(write): ...this and fix the return type.

Comments

Szabolcs Nagy Nov. 23, 2015, 2:56 p.m. UTC | #1
On 06/11/15 13:32, Szabolcs Nagy wrote:
> libgcc/config/arm/linux-atomic-64bit.c uses __write to print an error
> message if the 64bit cmpxchg method is not available in the kernel.
>
> __write is not part of the public libc abi, so use write instead.
> (user code may define write in iso c conforming mode and then the
> error message may not be visible before the crash.)
>
> The return type in the declaration of write is fixed too.
>
> OK for trunk and backporting?
>

ping.

> libgcc/ChangeLog:
>
> 2015-11-06  Szabolcs Nagy  <szabolcs.nagy@arm.com>
>
>      PR target/68059
>      * config/arm/linux-atomic-64bit.c (__write): Rename to...
>      (write): ...this and fix the return type.
Richard Earnshaw Nov. 23, 2015, 2:59 p.m. UTC | #2
On 06/11/15 13:32, Szabolcs Nagy wrote:
> libgcc/config/arm/linux-atomic-64bit.c uses __write to print an error
> message if the 64bit cmpxchg method is not available in the kernel.
> 
> __write is not part of the public libc abi, so use write instead.
> (user code may define write in iso c conforming mode and then the
> error message may not be visible before the crash.)
> 
> The return type in the declaration of write is fixed too.
> 
> OK for trunk and backporting?
> 
> libgcc/ChangeLog:
> 
> 2015-11-06  Szabolcs Nagy  <szabolcs.nagy@arm.com>
> 
>     PR target/68059
>     * config/arm/linux-atomic-64bit.c (__write): Rename to...
>     (write): ...this and fix the return type.
> 

OK.

R.
diff mbox

Patch

diff --git a/libgcc/config/arm/linux-atomic-64bit.c b/libgcc/config/arm/linux-atomic-64bit.c
index cdf713c..894450e 100644
--- a/libgcc/config/arm/linux-atomic-64bit.c
+++ b/libgcc/config/arm/linux-atomic-64bit.c
@@ -33,7 +33,7 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    kernels; we check for that in an init section and bail out rather
    unceremoneously.  */
 
-extern unsigned int __write (int fd, const void *buf, unsigned int count);
+extern int write (int fd, const void *buf, unsigned int count);
 extern void abort (void);
 
 /* Kernel helper for compare-and-exchange.  */
@@ -56,7 +56,7 @@  static void __check_for_sync8_kernelhelper (void)
 	 for the user - I'm not sure I can rely on much else being
 	 available at this point, so do the same as generic-morestack.c
 	 write () and abort ().  */
-      __write (2 /* stderr.  */, err, sizeof (err));
+      write (2 /* stderr.  */, err, sizeof (err));
       abort ();
     }
 };