On 19/02/2022 21:21, Segher Boessenkool wrote:
On Sat, Feb 19, 2022 at 12:06:50AM +0000, Mark Cave-Ayland wrote:
On 17/02/2022 19:13, Glenn Washburn wrote:
Recent versions of GDB (and probably older ones too, but not checked) crash with and abort when loading the non-stripped 32-bit PPC QEMU build. This is due to a bug in GDB on reading stab symbols. The only place in OpenBIOS where stab symbols are generated is in libgcc/crtsavres.S, which was copied from the linux kernel.
Symbols that were defined in the stabs section are still able to be seen in GDB after stabs removal. There does not appear to be a loss in debugging functionality.
 https://sourceware.org/bugzilla/show_bug.cgi?id=28900  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch...
Signed-off-by: Glenn Washburn email@example.com
libgcc/crtsavres.S | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/libgcc/crtsavres.S b/libgcc/crtsavres.S index 40bd736..8a77ba1 100644 --- a/libgcc/crtsavres.S +++ b/libgcc/crtsavres.S @@ -76,13 +76,9 @@ GLUE(.,name):
#define _GLOBAL(n) \ .text; \
- .stabs __stringify(n:F-1),N_FUN,0,0,n;\ .globl n; \ n:
-/* some stab codes */ -#define N_FUN 36
/* arch/powerpc/lib/crtsavres.S continues */
Thanks for the patch and the related links. From what I can see this looks correct and I see no issues debugging here, so I'll queue this for master pending any further comments (Segher?).
The patch is obviously correct.
But I have the same question I had with the simlar recent Linux patch: is it useful to have this debug info in Dwarf now, or is it not useful at all?
That is a good question. I'm assuming that since these symbols are still in upstream Linux then they have some utility? I don't think they would be useful on a day-to-day basis unless you were tracking down a compiler bug.