Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Apr 2019 13:29:14 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>, Justin Hibbits <chmeeedalf@gmail.com>
Subject:   Re: power9: "Successfully booted an LLVM compiled kernel": Can kernel modules (.ko) be dynamically loaded?
Message-ID:  <3BF85ED4-FB88-4660-8D32-C86F06AE8470@yahoo.com>
In-Reply-To: <53D45B7C-E7F0-4DC9-B09D-D3EFD56122E9@yahoo.com>
References:  <53D45B7C-E7F0-4DC9-B09D-D3EFD56122E9@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help


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.)
>=20
> Last I checked, FreeBSD did not support R_PPC64_JMP_SLOT
> and crashed during a dynamic-load of any(?) .ko that had
> such.
>=20
> 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.
>=20
> (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.)
>=20
> 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@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=3D (patched) and WITHOUT_LIB32=3D . 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.)

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3BF85ED4-FB88-4660-8D32-C86F06AE8470>