root@freebsd:~/trymodules # touch hello.c; make
Warning: Object directory not changed from original /root/trymodules
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -include /root/trymodules/opt_global.h -I. -I/usr/freebsd-src-stable-14/sys -I/usr/freebsd-src-stable-14/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/freebsd-src-stable-14/sys/amd64/include -fdebug-prefix-map=./x86=/usr/freebsd-src-stable-14/sys/x86/include -fdebug-prefix-map=./i386=/usr/freebsd-src-stable-14/sys/i386/include -MD -MF.depend.hello.o -MThello.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length -mno-aes -mno-avx -std=gnu99 -c hello.c -o hello.o
ld -m elf_x86_64_fbsd -warn-common --build-id=sha1 -T /usr/freebsd-src-stable-14/sys/conf/ldscript.kmod.amd64 -r -o hello.ko hello.o
:> export_syms
awk -f /usr/freebsd-src-stable-14/sys/conf/kmod_syms.awk hello.ko export_syms | xargs -J% objcopy % hello.ko
objcopy --strip-debug hello.ko