From owner-freebsd-current@FreeBSD.ORG Wed Jun 23 15:03:47 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B0EB1065675; Wed, 23 Jun 2010 15:03:47 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by mx1.freebsd.org (Postfix) with ESMTP id A67A08FC14; Wed, 23 Jun 2010 15:03:46 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 25so426869eya.9 for ; Wed, 23 Jun 2010 08:03:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=kS5qWBKNlUi/Cq6inyK4bZ3ozNVp33lDveAPWAJGns8=; b=P+DmexcM8JQXoXwYzsVfDXycOg/k8JizvVc74eIB8OsDyd/RVfjyhhJVv0mIzthx8V tldLp9Tac5K8Z/s1TU+JeykDb5VFG4rS6EMKGH+cUtGjlCjrD1nIejuwc0Rh6TqumoUj 6SkkFTq8lw1UTZ0riPzTJU/VuBOE/uO0cwkho= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=n5exZO6RkY9njU/QOhyWckZDrRhQAKvWi5laXU/Q16HeQakvluTvW1ptTcK/KqwU1M peSOMlZltdfIbcKi9D6u3PLC97BjdK6BFUh5PcmA+HDxTGzw4mytpzj44pKwMk63uCIw +x8NCZuNgqcaECApNQDsIBS/h7qOhW2gRCG/g= MIME-Version: 1.0 Received: by 10.213.32.136 with SMTP id c8mr1796601ebd.38.1277305425285; Wed, 23 Jun 2010 08:03:45 -0700 (PDT) Received: by 10.213.10.131 with HTTP; Wed, 23 Jun 2010 08:03:45 -0700 (PDT) In-Reply-To: <4C21B383.2000602@icyb.net.ua> References: <201006230238.06831.hselasky@c2i.net> <4C21AE18.4050400@icyb.net.ua> <201006230852.26536.hselasky@c2i.net> <4C21B170.2030903@icyb.net.ua> <4C21B383.2000602@icyb.net.ua> Date: Wed, 23 Jun 2010 11:03:45 -0400 Message-ID: From: Ryan Stone To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org, Hans Petter Selasky Subject: Re: [HEADS UP] Kernel modules don't work properly in FreeBSD 8.1-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 15:03:47 -0000 On Wed, Jun 23, 2010 at 3:10 AM, Andriy Gapon 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.