[Bug c/81996] __builtin_return_address(0) does not work on powerpc in -fPIC mode and causes SIGSEGVs
slyfox at inbox dot ru
gcc-bugzilla@gcc.gnu.org
Sun Aug 27 22:55:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81996
--- Comment #3 from Sergei Trofimovich <slyfox at inbox dot ru> ---
Built vanilla gcc from head to make sure it's not local patches.
-fstack-protector-all is the trigger breaking return address:
Target: powerpc-unknown-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc-installed
Thread model: posix
gcc version 8.0.0 20170827 (experimental) (GCC)
$ gcc-installed/bin/gcc -O2 a.c -o a -fPIC -fstack-protector-all && ./a
main =0x1000030c
ret_addr=0x7c641b78
$ gcc-installed/bin/gcc -O2 a.c -o a -fno-PIC -fstack-protector-all && ./a
main =0x10000310
ret_addr=0x10000344
More information about the Gcc-bugs
mailing list