Re: Can't load linux64.ko module

From: John Baldwin <jhb_at_freebsd.org>
Date: Mon, 09 Apr 2018 12:41:07 -0700
On Wednesday, April 04, 2018 02:34:53 PM Steve Kargl wrote:
> On Wed, Apr 04, 2018 at 02:13:15PM -0700, Steve Kargl wrote:
> > 
> > OK, so where is elf64_linux_vdso_fixup suppose to come from?
> > 
> 
> The answer is compat/linux/linux_vdso.c where we find
> 
> #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
> #define __ELF_WORD_SIZE 32
> #else
> #define __ELF_WORD_SIZE 64
> #endif
> 
> having COMPAT_LINUX32 in my kernel config file gives me
> elf32_linux_vdso_fixup.  It seems that one cannot have
> a kernel that supports both 32 and 64-bit linux software.
> 
> linux(4) states
> 
>      for an amd64 kernel use:
> 
>            options COMPAT_LINUX32
> 
>      Alternatively, to load the ABI as a module at boot time, place the
>      following line in loader.conf(5):
> 
>            linux_load="YES"
> 
> It turns out that I have 'linux_load=YES" in /etc/loader.conf.
> When I boot the kernel built with COMPAT_LINUX32 prevents 
> the kldload of linux64.ko.
> 
> Oh well, learn something new everyday.

The Right Way to fix this is probably to have linux_vdso32.c and
linux_vdso64.c that #include linux_vdso.c after setting
ELF_WORD_SIZE similar to how sys/kern/imgact_elf.c works.
Then the COMPAT_LINUX and linux64.ko modules would include
linux_vdso64.c and COMPAT_LINUX32 and linux32.ko modules
(and linux.ko on i386) would include linux_vdso32.c.

-- 
John Baldwin
Received on Mon Apr 09 2018 - 17:52:43 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:15 UTC