Page MenuHomeFreeBSD

kernel linker: Disable local sym resolution by default
Needs ReviewPublic

Authored by emaste on Nov 25 2024, 7:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 1, 8:23 AM
Unknown Object (File)
Sun, Nov 30, 1:22 PM
Unknown Object (File)
Fri, Nov 28, 9:04 AM
Unknown Object (File)
Mon, Nov 10, 3:34 PM
Unknown Object (File)
Nov 5 2025, 5:01 AM
Unknown Object (File)
Nov 5 2025, 12:46 AM
Unknown Object (File)
Nov 4 2025, 8:20 PM
Unknown Object (File)
Nov 4 2025, 8:19 PM

Details

Summary
In 95c20faf11a1 and ecd8245e0d77 kib introduced support to have the
kernel linker stop resolving local symbols from other files, but did
not enable it by default to avoid surprises.  Flip the default now,
in advance of FreeBSD 15.0.  The debug.link_elf_leak_locals sysctl
is available to revert to the previous behaviour if necessary.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste created this revision.

PR: 207898

drm-kmod will not load after this change without the fix in https://github.com/freebsd/drm-kmod/pull/338

If drm-kmod is fixed I think it would be time to flip this switch in 16 now.

This revision is now accepted and ready to land.Mon, Nov 24, 1:14 AM
emaste added subscribers: np, mav, adrian and 2 others.

@mav reported a regression; at least one issue is linux.ko depends on kern_kmq_open as of 97add684f5306ebf93be238a0340597ba1898d0e. Now fixed by eb90470f5f2a0e5c820c47be329423f5c60ca247 and a897492770735d4e5a55cbc06a02e267ca41f5b8. @cy reported a regression when agp is loaded as a module, fixed by a87c1e2dd8fc997d6ee603c252c543afe8a4d2a4.

I have found three more regressions in local testing

Also encountered a kernel panic that's unrelated to this but means modules alphabetically after kgssapi did not get tested. D53949 is open for that.

Given these new issues and the US Thanksgiving holiday I'll hold off for a little while before recommitting.