Defeat compiler optimization which assumes function addresses are never NULL
commit82f8d0bce10403deab704871e638edc24e7933ee
authorDenys Vlasenko <dvlasenk@redhat.com>
Thu, 15 Sep 2011 14:59:21 +0000 (15 16:59 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Thu, 15 Sep 2011 14:59:21 +0000 (15 16:59 +0200)
tree1afb443b538e0dcdaed4908dac4872a73366f3bb
parent200895dab88678b5b4e7d1dac9172be23e92eb31
Defeat compiler optimization which assumes function addresses are never NULL

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.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
libc/stdlib/_atexit.c
libc/stdlib/abort.c