Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Dec 1998 10:45:56 +0000 (GMT)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Greg Lehey <grog@lemis.com>
Cc:        FreeBSD current users <FreeBSD-current@FreeBSD.ORG>
Subject:   Re: How do I build an a.out kld?
Message-ID:  <Pine.BSF.4.01.9812281041290.381-100000@herring.nlsystems.com>
In-Reply-To: <19981228145909.R12346@freebie.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 28 Dec 1998, Greg Lehey wrote:

> I find I have to change to klds in a hurry, and have just run across a
> number of problems.  I'm running an a.out kernel, which loads ELF klds
> quite happily (once you know that there's an undocumented search path,
> but that you can win by specifying a full pathname).  The problem is
> that there are two versions of gdb, one of which recognizes only a.out
> (the kernel), and the other only ELF (the kld).  I appear to have
> three choices:
> 
> 1.  I can build an ELF kernel.  My understanding is that this will
>     also require me to install the new style boot blocks.  Correct?
>     If so, is there any documentation on what to do here?

Mostly.  If you have fairly recent boot blocks, you can try typing
'/boot/loader' to your existing bootblocks which should leave you in the
third stage boot.

> 
> 2.  I could build an a.out kld.  Unfortunately, there's an
>     (undocumented) program called gensetdefs which runs against the
>     objects, and expects only ELF files.  It doesn't understand an
>     -aout flag.  Can I get past this problem?

Are you using bsd.kmod.mk?  If you look at it, gensetdefs is only used for
elf.  Linking an a.out module is even simpler:

	${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${OBJS} ${KMODDEPS}

Try 'make OBJFORMAT=aout' and see what happens.

> 
> 3.  I could fix gdb to understand both a.out and ELF formats, but I
>     don't think I'll do it today.

I looked at this when I made it work for ELF and it was going to be hard
to support both elf and a.out shared libs.  Its easy to build an a.out gdb
and keep it around for odd jobs which require a.out support.

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 442 9037




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.01.9812281041290.381-100000>