building world with debugging symbols [broken?]

Ryan Stone rysto32 at
Tue Jun 22 20:39:19 UTC 2010

I saw similar behaviour a couple of years ago when I switched from
using gcc 4.0.2 to gcc 4.3.0 to compile some out-of-tree KLD modules.
The problem ended up being a change in the linker script used by GNU
ld for linking kernel modules.  It used to always put some magic
symbols used by the linker to implement things like sysinits into the
module.  It was changed to only provide those symbols, which
apparently means that the linker would discard those symbols if
nothing referenced them(and nothing did reference them).  I had to
work around it by adding the following to my link line:

-u __start_set_sysinit_set -u __start_set_sysuninit_set \
-u __start_set_sysctl_set -u __start_set_modmetadata_set \
-u __stop_set_sysinit_set -u __stop_set_sysuninit_set \
-u __stop_set_sysctl_set -u __stop_set_modmetadata_set

More information about the freebsd-current mailing list