From owner-cvs-all@FreeBSD.ORG Fri Jul 11 00:00:03 2008 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2F68106567A for ; Fri, 11 Jul 2008 00:00:03 +0000 (UTC) (envelope-from peter@wemm.org) Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.228]) by mx1.freebsd.org (Postfix) with ESMTP id 64B838FC0C for ; Fri, 11 Jul 2008 00:00:03 +0000 (UTC) (envelope-from peter@wemm.org) Received: by qb-out-0506.google.com with SMTP id q12so487970qba.13 for ; Thu, 10 Jul 2008 17:00:02 -0700 (PDT) Received: by 10.142.90.13 with SMTP id n13mr2834923wfb.75.1215734402266; Thu, 10 Jul 2008 17:00:02 -0700 (PDT) Received: by 10.142.76.14 with HTTP; Thu, 10 Jul 2008 17:00:02 -0700 (PDT) Message-ID: Date: Thu, 10 Jul 2008 17:00:02 -0700 From: "Peter Wemm" To: obrien@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200807101635.m6AGZv7I090311@svn.freebsd.org> <20080710233721.GA55073@dragon.NUXI.org> Cc: cvs-src@freebsd.org, src-committers@freebsd.org, "cvs-all@freebsd.org" Subject: Re: svn commit: r180431 - in head/sys: kern sys X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2008 00:00:03 -0000 On Thu, Jul 10, 2008 at 4:58 PM, Peter Wemm wrote: > On Thu, Jul 10, 2008 at 4:37 PM, David O'Brien wrote: >> On Thu, Jul 10, 2008 at 10:35:35AM -0700, Peter Wemm wrote: >>> On Thu, Jul 10, 2008 at 9:35 AM, David E. O'Brien wrote: >>> > Author: obrien >>> > Date: Thu Jul 10 16:35:57 2008 >>> > New Revision: 180431 >>> > URL: http://svn.freebsd.org/changeset/base/180431 >>> > >>> > Log: >>> > Allow 'elf_file_t' to be used in a wider scope. >>> > >>> > Modified: >>> > head/sys/kern/link_elf.c >>> > head/sys/sys/link_elf.h >>> >>> This really was intentional. elf_file_t was supposed to be opaque and >>> changeable. What do you need this for? >> >> Juniper needs to be able to call functions in the loadable modules before >> the modules are actually linked into the kernel. This will be used to >> call platform specific initialization functions early in the bootup >> process. Will also need un-static link_elf_preload_parse_symbols, >> parse_dynamic, symbol_name, link_elf_lookup_symbol, >> link_elf_symbol_values. > > I think you should leave it in Juniper's tree for a tad longer: > ../../../kern/link_elf_obj.c:88: error: redefinition of 'struct elf_file' > ../../../kern/link_elf_obj.c:119: error: redefinition of typedef 'elf_file_t' > ../../../sys/link_elf.h:133: error: previous declaration of > 'elf_file_t' was here > > There is a better way to do what you want though. You're using loader > still, right? I have old code kicking around that allowed linking the > kernel against a hal module properly. I did this to support linking > the kernel against an apic / smp / apic / 8259 module and > combinations. I forgot to mention.. the fact that kld's happen to currently be ELF is very specifically and deliberately not part of any public API. All references go via linker_* because there is no guarantee about elf, a.out, pecoff, raw binary, whatever. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell