Bug 215061

Summary: COMPAT_LINUX32 in kernel with linux_enable causes undefined symbol on boot
Product: Base System Reporter: Jack <xxjack12xx>
Component: kernAssignee: freebsd-emulation mailing list <emulation>
Status: New ---    
Severity: Affects Many People CC: asmodai, avos, xxjack12xx
Priority: ---    
Version: 11.0-RELEASE   
Hardware: amd64   
OS: Any   

Description Jack 2016-12-05 04:30:16 UTC
When
options         COMPAT_LINUX32
is defined in the kernel and
linux_enable="YES"
in rc.conf, the system boots with this error:

link_elf_obj: symbol elf64_linux_vdso_fixup undefined
linker_load_file: Unsupported file type


When
options         COMPAT_LINUX32
is not defined in the kernel and linux_enable="YES" in rc.conf, the linux module loads fine.

Linux x86-64 ELF exec handler installed
Comment 1 Jeroen Ruigrok van der Werven freebsd_committer 2017-06-01 06:02:59 UTC
Actually, on 11-STABLE and not having any mention of COMPAT_LINUX or COMPAT_LINUX32 in my kernel, trying to kldload linux64.ko I still get this message in the logs:

% sudo kldload linux64
kldload: an error occurred while loading the module. Please check dmesg(8) for more details.
% dmesg | tail -2
link_elf_obj: symbol elf64_linux_vdso_fixup undefined
linker_load_file: Unsupported file type
% grep LINUX /usr/src/sys/amd64/conf/DEALER 
#options 	COMPAT_LINUX
Comment 2 Jeroen Ruigrok van der Werven freebsd_committer 2017-06-01 06:15:25 UTC
Rephrase my previous comment, looks like the kernel I was using had COMPAT_LINUX32 compiled in.

Rebuilding with the file shown from the grep allows one to kldload either linux.ko or linux64.ko successfully.

I'll check the documentation and see what can be adjusted there to save people from annoyance.
Comment 3 Jeroen Ruigrok van der Werven freebsd_committer 2017-06-01 06:16:12 UTC
For the record:

% uname -a
FreeBSD dealer 11.1-PRERELEASE FreeBSD 11.1-PRERELEASE #7 r319368M: Thu Jun  1 08:01:01 CEST 2017     root@dealer:/usr/obj/usr/src/sys/DEALER  amd64

% kldstat | grep  lin
 5    1 0xffffffff8261f000 a887     linprocfs.ko
 6    2 0xffffffff8262a000 7afc     linux_common.ko
 7    1 0xffffffff82632000 3c7ff    linux64.ko