Bug 291270 - mfi_linux.ko fails to load with module loader local symbol resolution disabled
Summary: mfi_linux.ko fails to load with module loader local symbol resolution disabled
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 16.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords:
Depends on:
Blocks: 207898
  Show dependency tree / graph
 
Reported: 2025-11-28 18:02 UTC by Ed Maste
Modified: 2026-07-17 06:25 UTC (History)
1 user (show)

See Also:


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:02:47 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 mfi_linux.ko
link_elf_obj: symbol linux_device_register_handler undefined
linker_load_file: /boot/kernel/mfi_linux.ko - unsupported file type
kldload: an error occurred while loading module mfi_linux.ko. Please check dmesg(8) for more details.

The dependent module's Makefile should have an EXPORT_SYMS= line that lists all of the symbols that should be intentionally exported. Another option (but not preferred) is to just set EXPORT_SYMS=YES, unless we explicitly want all symbols exported.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2025-11-28 18:04:12 UTC
Also mrsas_linux.ko

# kldload mrsas_linux.ko
link_elf_obj: symbol linux_device_register_handler undefined
linker_load_file: /boot/kernel/mrsas_linux.ko - unsupported file type
kldload: an error occurred while loading module mrsas_linux.ko. Please check dmesg(8) for more details.
Comment 2 Ed Maste freebsd_committer freebsd_triage 2025-12-29 16:41:19 UTC
linux/Makefile and linux_common/Makefile already have EXPORT_SYMS lists, so adding to the existing list makes sense. Unsure if additional symbols beyond linux_device_register_handler are required, but will start with that one.
Comment 3 commit-hook freebsd_committer freebsd_triage 2025-12-29 16:42:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=3e2093de47251de5e6e61c08d2955251137afd01

commit 3e2093de47251de5e6e61c08d2955251137afd01
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-11-28 21:25:26 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-12-29 16:39:28 +0000

    linux: Add required symbol to EXPORT_SYMS list

    PR:             291270

 sys/modules/linux/Makefile        | 1 +
 sys/modules/linux_common/Makefile | 1 +
 2 files changed, 2 insertions(+)
Comment 4 commit-hook freebsd_committer freebsd_triage 2026-01-05 16:24:06 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=4c318cb3320d9aedd17a2e3c07ff5c69225a29eb

commit 4c318cb3320d9aedd17a2e3c07ff5c69225a29eb
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-11-28 21:25:26 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-01-05 16:15:53 +0000

    linux: Add required symbol to EXPORT_SYMS list

    PR:             291270
    (cherry picked from commit 3e2093de47251de5e6e61c08d2955251137afd01)

 sys/modules/linux/Makefile        | 1 +
 sys/modules/linux_common/Makefile | 1 +
 2 files changed, 2 insertions(+)
Comment 5 commit-hook freebsd_committer freebsd_triage 2026-01-05 16:27:09 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=408cd2fff86176513c69e880d7515af11f980cb7

commit 408cd2fff86176513c69e880d7515af11f980cb7
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2025-11-28 21:25:26 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-01-05 16:25:27 +0000

    linux: Add required symbol to EXPORT_SYMS list

    PR:             291270
    (cherry picked from commit 3e2093de47251de5e6e61c08d2955251137afd01)
    (cherry picked from commit 4c318cb3320d9aedd17a2e3c07ff5c69225a29eb)

 sys/modules/linux/Makefile        | 1 +
 sys/modules/linux_common/Makefile | 1 +
 2 files changed, 2 insertions(+)
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2026-07-17 06:25:16 UTC
^Triage: assign to committer.

Is there any reason to leave this Problem Report open now?