On Thursday, September 15, 2011 10:59:21 Denys Vlasenko wrote:
> From email:
> A warning for people who can be hit by the same or similar issue:
> gcc 4.1.2 with -march=i486 here with -Os and even with -O2 or -O
> is "optimizing away" the check
>        if (_stdio_term)
> in libc/stdlib/_atexit.c
> which results in a "call 0" and a segfault at exit
> if you do not happen to link in stdio.

there's quite a lot of noise in this changeset because you're mixing style 
with functional.  please refrain from this in the future.

> --- a/libc/stdlib/_atexit.c
> +++ b/libc/stdlib/_atexit.c
> 
> +/* Defeat compiler optimization which assumes function addresses are never
> +static __always_inline int not_null_ptr(const void *p)
> +{
> +     const void *q;
> +     __asm__ (""
> +             : "=r" (q) /* output */
> +             : "0" (p) /* input */
> +     );
> +     return q != 0;
> +}
> 
> --- a/libc/stdlib/abort.c
> +++ b/libc/stdlib/abort.c
> 
> +/* Defeat compiler optimization which assumes function addresses are never
> +static __always_inline int not_null_ptr(const void *p)
> +{
> +     const void *q;
> +     __asm__ (""
> +             : "=r" (q) /* output */
> +             : "0" (p) /* input */
> +     );
> +     return q != 0;
> +}

ugh, you copy & pasted the same thing.  please locate a common header to stick 
this into.  or drop it.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to