What is /boot/kernel/*.symbols?

Dimitry Andric dimitry at andric.com
Fri Jul 3 15:05:11 UTC 2009

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:

	${OBJCOPY} --strip-debug --add-gnu-debuglink=${KERNEL_KO}.symbols\
	${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

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.

More information about the freebsd-stable mailing list