Bug 291271 - qat_common.ko missing symbol exports -- dependent modules fail to load with module loader local symbol resolution disabled
Summary: qat_common.ko missing symbol exports -- dependent modules fail to load with m...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 16.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks: 207898
  Show dependency tree / graph
 
Reported: 2025-11-28 18:11 UTC by Ed Maste
Modified: 2026-07-19 14:23 UTC (History)
1 user (show)

See Also:
linimon: mfc-stable15?
linimon: mfc-stable14?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2025-11-28 18:11:21 UTC
See https://lists.freebsd.org/archives/freebsd-current/2025-November/009500.html for background.

To reproduce, set
debug.link_elf_leak_locals=0
debug.link_elf_obj_leak_locals=0
then

# kldload qat.ko
link_elf_obj: symbol M_QAT undefined
linker_load_file: /boot/kernel/qat_api.ko - unsupported file type

The module's Makefile should have an EXPORT_SYMS= line that lists all of the symbols to be intentionally exported.

Another option is to just set EXPORT_SYMS=YES.  An explicit export list is preferred over EXPORT_SYMS=YES, unless we explicitly want all symbols exported.
Comment 1 Rupesh Pilania 2025-12-06 19:36:59 UTC
Changes available here: https://reviews.freebsd.org/D54107
Comment 2 commit-hook freebsd_committer freebsd_triage 2025-12-29 16:15:00 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=6ea05372bea5bdb19ca329c27c4c6510cbeed7c8

commit 6ea05372bea5bdb19ca329c27c4c6510cbeed7c8
Author:     Rupesh Pilania <rupeshpilania@gmail.com>
AuthorDate: 2025-12-29 16:13:48 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-12-29 16:13:53 +0000

    qat: Export missing symbols in qat_common

    Some symbols required by dependent modules were missing from
    qat_common.ko and qat_api.ko, causing load failures when local symbol
    resolution is disabled.

    PR:             291271
    Reviewed by:    zlei, markj
    Differential Revision:  https://reviews.freebsd.org/D54107

 sys/modules/qat/qat_api/Makefile    | 2 +-
 sys/modules/qat/qat_common/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)