power9: "Successfully booted an LLVM compiled kernel": Can kernel modules (.ko) be dynamically loaded?

Mark Millard marklmi at yahoo.com
Mon Apr 1 20:29:21 UTC 2019



On 2019-Mar-23, at 12:13, Mark Millard <marklmi at yahoo.com> wrote:

> As of when clang 5 (and later) became system clang,
> I've found that .ko files started using R_PPC64_JMP_SLOT
> r_types in .rela.plt sections. (My context, then and
> now is still ELFv1 ABI and based on svn's head
> materials.)
> 
> Last I checked, FreeBSD did not support R_PPC64_JMP_SLOT
> and crashed during a dynamic-load of any(?) .ko that had
> such.
> 
> So I've been building the modules that I want to use into
> the kernel itself for when I experiment with clang-based
> powerpc64 system builds.
> 
> (I've no clue if the R_PPC64_JMP_SLOT use is considered
> "KBI" compliant or not vs. if FreeBSD is/was just
> incomplete in its coverage of the "KBI" for pwoerpc64:
> so which side should change.)
> 
> I recognize that power9 likely is based on the ELFv2
> ABI.

Ignore the question: I've tested head -r345758 and clang
is producing R_PPC64_JMP_SLOT in .ko files but the
dynamic loads are working. I no longer need to build
modules into the kernel for this issue.

# uname -apKU
FreeBSD FBSDG5L 13.0-CURRENT FreeBSD 13.0-CURRENT #8 r345758M: Sun Mar 31 19:43:35 PDT 2019     markmi at FBSDFSSD:/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/powerpc.powerpc64/sys/GENERIC64vtsc-NODBG  powerpc powerpc64 1300017 1300017

amd64->powerpc64 cross-built with system-clang and devel/powerpc64-binutils using
WITH_LLVM_LIBUNWIND= (patched) and WITHOUT_LIB32= . Various other patches/workarounds
for other issues are present, unrelated to R_PPC64_JMP_SLOT use in .ko files. (I
exierment with using more modern tool-chains to build for powerpc64 and powerpc.)

The system is an old PowerMac G5 (2 sockets, 2 cores per).

I was able to comment out my prior inclusion of filemon and mac_ntpd
in the kernel, so I now have:

# kldstat
Id Refs Address                Size Name
 1    6 0xc000000000100000  1927578 kernel
 2    1 0xe00000008fcd2000    12000 mac_ntpd.ko
 3    1 0xe00000008efda000    15000 filemon.ko

I've no clue just when the status changed.

I have closed bugzilla 224561 as overcome by events.

(For other reasons I have to build in epair to allow
kyua runs to not crash the system. I've updated
bugzilla 232387 with recent information as well.)

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)



More information about the freebsd-ppc mailing list