NetBSD Problem Report #40522

From  Sat Jan 31 00:06:39 2009
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id 2AC9D63B879
	for <>; Sat, 31 Jan 2009 00:06:39 +0000 (UTC)
Message-Id: <>
Date: Fri, 30 Jan 2009 19:06:19 -0500 (EST)
Subject: mips kernel ldscript updates for dwarf2
X-Send-Pr-Version: 3.95

>Number:         40522
>Category:       port-mips
>Synopsis:       mips kernel ldscript updates for dwarf2
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-mips-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 31 00:10:00 +0000 2009
>Closed-Date:    Sat Mar 05 21:43:14 +0000 2011
>Last-Modified:  Sat Mar 05 21:43:14 +0000 2011
>Originator:     David A. Holland /
>Release:        NetBSD 5.99.7 (20090130)
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

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


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.


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


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.


From: "Matt Thomas" <>
Subject: PR/40522 CVS commit: src/sys/arch/mips/conf
Date: Sat, 5 Mar 2011 15:19:45 +0000

 Module Name:	src
 Committed By:	matt
 Date:		Sat Mar  5 15:19:44 UTC 2011

 Modified Files:
 	src/sys/arch/mips/conf: kern.ldscript

 Log Message:
 Add missing .debug lines from usr/libdata/ldscripts
 Add missing .mdebug lines from usr/libdata/ldscripts
 Fixes PR/40522

 To generate a diff of this commit:
 cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/conf/kern.ldscript

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-When: Sat, 05 Mar 2011 21:43:14 +0000


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.