I'm compelled to disable debug symbols...

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Silverhawk

I'm compelled to disable debug symbols...

Post by Silverhawk »

Hi guys,

I'm in front of a problem concerning the debug informations in my kernel binary...

If I do not use the -S option while I link my kernel, it provoques an error :
ld: bootstrap/jumpToKernel.o(.stab+0x0): entr?e des talons a une cha?ne index invalide

It's a little bit bothering in order to debug...

What is "stab" ?
How to correct this problem ?

Thanks.
Chris Giese

Re:I'm compelled to disable debug symbols...

Post by Chris Giese »

STABS is a debug format used in old versions of GCC. New versions of GCC use DWARF instead.

If leaving STABS debug information in the kernel causes problems, you might need to add these statements to the linker script:

.stab : { *(.stab) }
.stabstr : { *(.stabstr) }

http://my.execpc.com/~geezer/osd/code/krnl1m.ld
Silverhawk

Re:I'm compelled to disable debug symbols...

Post by Silverhawk »

Thanks Chris,

I've tried what you said : it didn't work...
Always the same error.

So, I've tried to suppress debug info generated by nasm (stop using -g option with nasm), and to keep debug info generated by gcc.
The link is now possible ! It works fine !

Is there anybody who has noticed this fact ?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:I'm compelled to disable debug symbols...

Post by Pype.Clicker »

iirc, you can select the debug format to be used by nasm (with -F; it has at least a list of available formats using "nasm -f elf/coff -y").

However, my local nasm build doesn't seem to support anything else but "Null debug format" ...
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:I'm compelled to disable debug symbols...

Post by Pype.Clicker »

Chris Giese wrote: STABS is a debug format used in old versions of GCC. New versions of GCC use DWARF instead.
Funny enough, i got a book about linux kernel that presents "stabs" as being "nowadays" and "dwarf" as being "old days legacy".

The actual debug format used by gcc 3.x is dwarf v2 ;)
Post Reply