[Bug target/71951] libgcc_s built with -fomit-frame-pointer on aarch64 is broken
icenowy at aosc dot io
gcc-bugzilla@gcc.gnu.org
Thu Jul 27 21:07:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71951
Icenowy Zheng <icenowy at aosc dot io> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |icenowy at aosc dot io
--- Comment #10 from Icenowy Zheng <icenowy at aosc dot io> ---
In my environment (glibc 2.25, and both the building scripts of glibc and gcc
have -fomit-frame-pointer automatically enabled), this bug is not fully
resolved yet.
With GCC upgraded to 6.4.0, GDB debugger started to work correctly. (With GCC
6.3.0 GDB cannot even work and segfault at unwind code in libgcc).
However, if I still build GCC with -fomit-frame-pointer in CFLAGS, the
backtrace() function of glibc cannot work, and segfault at line 240 of
libgcc/unwind-dw2.c .
By reading the source code, I think the unwind code is still trying to get CFA
from the register x29, and when debugging I found that the x29 register in the
unwind context is 0 (because of -fomit-frame-pointer), so line 240 is
dereferencing a NULL pointer, so it segfaulted.
Maybe the behavior that accessing x29 register to get CFA is not correct?
More information about the Gcc-bugs
mailing list