https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117320
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |MOVED Status|WAITING |RESOLVED --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I tried to build into an executable but there are so many undefined symbols it didn't work. With shared library: [apinski@xeond2 upstream-gcc-match]$ ~/upstream-gcc/bin/gcc -O2 -g ~/src/eval.i -shared -fPIC -fno-semantic-interposition [apinski@xeond2 upstream-gcc-match]$ nm a.out | grep -E 'backtrace_(next|function)' 0000000000007ac0 T backtrace_function 0000000000006759 t backtrace_function.cold 0000000000006740 t backtrace_function.part.0 00000000000078d0 T backtrace_next [apinski@xeond2 upstream-gcc-match]$ !gdb gdb -ex 'print backtrace_next' -ex 'print backtrace_function' a.out GNU gdb (GDB) Red Hat Enterprise Linux 10.2-13.el9 Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from a.out... $1 = {union specbinding *(union specbinding *)} 0x78d0 <backtrace_next> $2 = {Lisp_Object (union specbinding *)} 0x6740 <backtrace_function> (gdb) quit So this looks to be a gdb issue with respect to an relocated object file and not a debugging information produced by GCC.