Page MenuHomeFreeBSD

kern_mib: remove kern.fallback_elf_brand compat sysctl
ClosedPublic

Authored by chris.longros_gmail.com on Mar 25 2026, 2:06 PM.
Tags
None
Referenced Files
F170973550: D56085.id174293.diff
Mon, Sep 7, 11:05 PM
Unknown Object (File)
Sat, Sep 5, 8:04 AM
Unknown Object (File)
Sat, Sep 5, 8:01 AM
Unknown Object (File)
Sat, Sep 5, 6:59 AM
Unknown Object (File)
Sat, Sep 5, 1:00 AM
Unknown Object (File)
Sat, Sep 5, 12:28 AM
Unknown Object (File)
Sat, Sep 5, 12:28 AM
Unknown Object (File)
Fri, Sep 4, 6:12 PM
Subscribers

Details

Summary

This compatibility alias for kern.elf{32,64}.fallback_brand has been
marked for removal since FreeBSD 6.0.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 71716
Build 68599: arc lint + arc unit

Event Timeline

Does the extern declaration for __elfN(fallback_brand) in sys/sys/imgact_elf.h is needed after the patch? Could the __elfN(fallback_brand) var made static in kern_elf.c?

Good point. Updated the made __elfN(fallback_brand) from extern to static in imgact_elf.c.

make fallback_brand static, remove extern

This revision is now accepted and ready to land.Mar 27 2026, 2:04 AM

@kib Hi, could you commit this when you time? Thanks!

Any updates regarding this patch ? :) @emaste @kib

Note that these are currently accessed in libexec/rc/rc.d/linux:

# Handle unbranded ELF executables by defaulting to ELFOSABI_LINUX.
if [ `sysctl -ni kern.elf64.fallback_brand` -eq "-1" ]; then
        sysctl kern.elf64.fallback_brand=3 > /dev/null
fi

if [ `sysctl -ni kern.elf32.fallback_brand` -eq "-1" ]; then
        sysctl kern.elf32.fallback_brand=3 > /dev/null
fi