Subject: Re: exec_aout.h: N_TXTADDR vs. NMAGIC executables
To: None <tech-kern@NetBSD.ORG>
From: Scott Reynolds <scottr@og.org>
List: tech-kern
Date: 09/15/1997 00:19:45
Following up to my own message... (sigh)

On Sat, 13 Sep 1997, I wrote:

> Can anyone explain why N_TXTADDR claims that my NMAGIC kernel text should
> load at __LDPGSZ rather than 0 [...]?

Well, my investigation made me conclude that someone long ago made a break
with tradition and decreed that OMAGIC and NMAGIC executables should be
loaded at __LDPGSZ.  Naturally, this screws up anything that is linked
with the text address other than the default, for both gdb and mdsetimage.

> Does anyone see a way out of this fine little mess, other than dumping
> a.out?

There's a hack in usr.sbin/mdsetimage/exec_aout.c that looks like it
attempts to correct things, but the hack fails if the entry point happens
to fall somewhere in the second page of kernel text.  The mac68k `start'
symbol in the kernel is at 0x2e00, so I'm sunk.

I guess this means a hack to mdsetimage(1) to allow the user to
specify the text start address is necessary.  I hate having to add hacks,
but I don't see any alternative in this case, as I can't move start down
any further than it already is.  Any thoughts on this?

--scott