Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 Jul 2009 17:05:08 +0200
From:      Dimitry Andric <dimitry@andric.com>
To:        "Patrick M. Hausen" <hausen@punkt.de>
Cc:        FreeBSD Stable Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: What is /boot/kernel/*.symbols?
Message-ID:  <4A4E1E24.3020303@andric.com>
In-Reply-To: <20090703144121.GC11039@hugo10.ka.punkt.de>
References:  <20090703142528.GA11039@hugo10.ka.punkt.de>	<4A4E174A.1050207@andric.com> <20090703144121.GC11039@hugo10.ka.punkt.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2009-07-03 16:41, Patrick M. Hausen wrote:
> But I thought, they were in the kernel itself?
> 
> %file /boot/kernel/kernel
> /boot/kernel/kernel: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), not stripped
> 
> "not stripped" - i.e. "with debug symbols". Wrong? Since when?

Well, only the debug symbols have been stripped, not any others.  If you
look in /usr/src/sys/conf/kern.post.mk, you will see this fragment:

${KERNEL_KO}: ${FULLKERNEL} ${KERNEL_KO}.symbols
	${OBJCOPY} --strip-debug --add-gnu-debuglink=${KERNEL_KO}.symbols\
	    ${FULLKERNEL} ${.TARGET}
${KERNEL_KO}.symbols: ${FULLKERNEL}
	${OBJCOPY} --only-keep-debug ${FULLKERNEL} ${.TARGET}

E.g. the debug stuff is put into the .symbols files.  The kernel itself
still contains the function and data names, though:

$ objdump -t /boot/kernel/kernel

/boot/kernel/kernel:     file format elf32-i386-freebsd

SYMBOL TABLE:
c092de00 l       .data  00000000 tmpstk
c092de58 l       .data  00000000 physfree
c092de64 l       .data  00000000 proc0uarea
[...]

If you want to build absolutely without any symbols whatsover, remove
the "makeoptions DEBUG=-g" line from your kernel config file.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A4E1E24.3020303>