From owner-cvs-all Tue Jul 16 11:15: 5 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E137F37B400 for ; Tue, 16 Jul 2002 11:15:02 -0700 (PDT) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9065843E65 for ; Tue, 16 Jul 2002 11:15:02 -0700 (PDT) (envelope-from peter@wemm.org) Received: from fw.wemm.org (canning.wemm.org [192.203.228.65]) by canning.wemm.org (Postfix) with ESMTP id 6DD962A7D6 for ; Tue, 16 Jul 2002 11:15:02 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (overcee.wemm.org [10.0.0.3]) by fw.wemm.org (Postfix) with ESMTP id 26B284C272 for ; Tue, 16 Jul 2002 11:15:02 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (Postfix) with ESMTP id C69CB3910; Tue, 16 Jul 2002 11:15:01 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: W Gerald Hicks Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/release/picobsd/build write_mfs_in_kernel.c In-Reply-To: <5327CDCB-9867-11D6-9B14-0030657B5F1E@gehicks.dyndns.org> Date: Tue, 16 Jul 2002 11:15:01 -0700 From: Peter Wemm Message-Id: <20020716181501.C69CB3910@overcee.wemm.org> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG W Gerald Hicks wrote: > > On Monday, July 15, 2002, at 09:28 PM, Peter Wemm wrote: > > > > > Yes, it is far far better to use objcopy --add-section, and then use > > &__start_
and &__stop_
symbols to find where it ended > > up. > > > > > > I've been doing it with a slightly different operation but yes it seems > to be a > better way than jumping in after linking and patching up the kernel > image. > > Even if one is concerned about toolchain portability something like this > exists > for every other (reasonable) toolchain I can think of. Whatever works. :-) I like the --add-section approach personally because it adapts automatically to the file format being used and seems to need less comamnd line args. However, it requires doing things a bit differently. I used to use it as a final pre-link stage on one file, but I suppose creating the .o file directly makes it easier from a Makefile perspective. I used to do things like this: mdroot.o: mdroot.dd mdroot_driver.o objcopy --add_section mdroot=mdroot.dd .... mdroot_driver.o: md.c ... etc And the build used the resulting mdroot.o with the binary embedded in it. Anyway, it is good to know that there is more than one way to do it and that the evil write_mfs_in_kernel can finally be laid to rest for good. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message