Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1

From: Ryan Stone <rysto32_at_gmail.com>
Date: Wed, 23 Jun 2010 11:03:45 -0400
On Wed, Jun 23, 2010 at 3:10 AM, Andriy Gapon <avg_at_icyb.net.ua> wrote:
>
> Which also brings the question - what arch(s) is affected?
> I tested on amd64.

This should explain it.  It looks to me like i386 uses kern/link_elf.c
as its linker, while amd64 uses kern/link_elf_obj.c.  link_elf.c can
only find the sections containing the sysinits(and some related
things) via the magic symbols.  link_elf_obj.c seems to understand ELF
objects much better and doesn't need those symbols to be present.  It
just looks up the section that contains the sysinits directly via the
ELF metadata that is already present.

As far as I can tell, amd64 is the only arch in the tree that uses
link_elf_obj.c, so all other arches may be affected.

I have to admit that I'm more than a little surprised that this
problem does not affect modules that in src, but maybe that's because
I don't know all that much about FreeBSD's build infrastructure.  Are
the src modules being linked with a linker script that is not being
used for out-of-src modules?  Are the people affected by this not
using the base compiler to build ports?(I see that this affects PC-BSD
as well, and I'd be a little surprised to learn that it wasn't using
the base compiler).

The link line that I gave was a hack.  The proper solution is to use a
linker script that unconditionally puts the magic symbols in.
Received on Wed Jun 23 2010 - 13:03:47 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:04 UTC