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

Reply via email to