Le 21/02/2022 à 23:25, Segher Boessenkool a écrit :
On Mon, Feb 21, 2022 at 08:45:29PM +0000, Mark Cave-Ayland wrote:
On 20/02/2022 21:11, Segher Boessenkool wrote:
There are no symbols going away. In fact, all debuggers may get enough information from the function symbols themselves, and the STABS info does not add anything. Oh wait, STABS info is encoded in artificial symbol table names, right.
The stuff removed from Linux is in the DSO; in OpenBIOS this is in its libgcc code. In GCC itself this code was removed in 2008, and it never has contained STABS info anyway. I have no idea what the OpenBIOS history here is, why the STABS was added in the first place.
As far as I can see in the OpenBIOS case the STABS info does not have any value-add. In the Linux case it is not so clear (there is more information encoded there, not just that some function name exists :-) )
So what's the history here? Was this code added to OpenBIOS from some other project?
My guess is that it was taken from historical gcc/Linux since that's where parts of the SPARC code come from. So given that Glenn's patch is echoing what's happening upstream, I'm inclined to take it as-is, and then a separate decision can be taken about the usefulness of the symbols later as they seem to cause no harm.
The actual code you are removing:
#define _GLOBAL(n) \ .text; \ .stabs __stringify(n:F-1),N_FUN,0,0,n;\ .globl n; \ n:
The STABS means this is an externally visible function called <n>, with return type -1 (which means unspecified afaics), and it has entry point <n> as well.
All of this is already made clear to the debugger by the .globl :-)
So the patch is fine. But once again, this code is not in Linux, if it ever was there! It seems to be a coincidence that PowerPC Linux is removing its STABS remnants at about this same time :-)
Linux kernel's commit 12318163737c ("powerpc/32: Remove remaining .stabs annotations") contains the following hunk:
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index f21e6bde17a1..c4b074263bf9 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -208,7 +208,6 @@ GLUE(.,name): n:
#define _GLOBAL(n) \ - .stabs __stringify(n:F-1),N_FUN,0,0,n;\ .globl n; \ n:
Christophe