Bug 239194 - gcov-enabled kernel can't load modules
Summary: gcov-enabled kernel can't load modules
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Matt Macy
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2019-07-14 02:22 UTC by Alan Somers
Modified: 2019-10-13 18:41 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer 2019-07-14 02:22:32 UTC
The gcov support added to the kernel in r344487 doesn't work with modules.  Everything seems to be working for the kernel itself, but when I try to load a module I get this error:

> sudo kldload fdescfs
kldload: an error occurred while loading module fdescfs. Please check dmesg(8) for more details.
> tail -n2 /var/log/messages
Jul 13 20:14:08 fbsd-head kernel: kldload: fdescfs.ko: lost base for reltab
Jul 13 20:14:08 fbsd-head kernel: linker_load_file: /boot/kernel.old/fdescfs.ko - unsupported file type

I don't observe the kldload failure when I build a GENERIC kernel using the amd64-gcc cross toolchain.  I only see it when using the GCOV kernel.  If I cd to /usr/src/sys/modules/whatever and build the module there, then I _can_ load it.  However, coverage data is not collected.

> sudo kldload /boot/modules/fusefs.ko
> uname -a
FreeBSD fbsd-head.lauralan.noip.me 13.0-CURRENT FreeBSD 13.0-CURRENT r349977 GCOV  amd64
> cat sys/amd64/conf/GCOV 
include	GENERIC
ident	GCOV
options	LINDEBUGFS
options	GCOV