NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-mips/40522: mips kernel ldscript updates for dwarf2



>Number:         40522
>Category:       port-mips
>Synopsis:       mips kernel ldscript updates for dwarf2
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-mips-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 31 00:10:00 +0000 2009
>Originator:     David A. Holland / dholland%eecs.harvard.edu@localhost
>Release:        NetBSD 5.99.7 (20090130)
>Organization:
>Environment:
System: NetBSD tanaqui 4.99.54 NetBSD 4.99.54 (TANAQUI) #21: Fri Feb 29 
12:31:31 EST 2008 dholland@tanaqui:/usr/src/sys/arch/i386/compile/TANAQUI i386
Architecture: i386
Machine: i386
>Description:

The mips kernel ldscript (src/sys/arch/mips/conf/kern.ldscript)
doesn't handle DWARF2 debug info sections.

>How-To-Repeat:

Swipe kern.ldscript to compile a mips research kernel that uses recent
tools (binutils 2.17, gcc 4.1.2, gdb 6.6) in a custom but pretty much
basic/default config, and discover that gdb can't find line number
information in the output kernel.

>Fix:

Add these sections to the end of kern.ldscript along with the other
dwarf debug sections:

        .debug_abbrev
        .debug_frame
        .debug_info
        .debug_line
        .debug_loc
        .debug_macinfo
        .debug_str

I expect this is not required with the tools or configs NetBSD is
currently using, or someone would have noticed, but on the other hand,
adding them is harmless and makes the ldscript more future-proof.

I have also found that with binutils 2.17 it doesn't work to set the
kernel base address with -Ttext; if you do that it seems to cheerfully
ignore what your linker script says and put .data in the normal
userspace location. Or something like that; it doesn't work, anyway.
It is not worth changing the kernel build in anticipation of this but
it might be worth sticking a comment in somewhere as a warning.



Home | Main Index | Thread Index | Old Index