Subject: Re: Boot code of linuxppc v. netbsd
To: None <youngdrow@geocities.com, Stephen.Ma@jtec.com.au>
From: Wolfgang Solfrank <ws@kurt.tools.de>
List: port-powerpc
Date: 01/06/1998 15:14:28
> Also, regarding the comments about differences in the number of
> arguments to _start() and main(), this doesn't appear to be a problem
> - all of the arguments are passed in registers, so a mismatched number
> of arguments merely means that some value is placed in a register by
> the calling code, and subsequently ignored by the called routine.

Sounds reasonable.

> The boot code only mentions "loading .text", "loading .data", and
> "clearing .bss". Are the other sections really loaded?

Hmm, this might indeed be the case.  One would have to check the contents of
the memory at the other sections addresses to be sure.  I'm not too familiar
with XCOFF, but doesn't this format have an embedded a.out header?  If so,
it doesn't have space to store an arbitrary number of sections, but only
the .text, .data and .bss ones.  I'd expect that the linker/objcopy utility
would at least try to fit all the sections into these three sections in order
to accomodate for this deficiency.  It looks like it doesn't, but the Mac
boot code loads the executable relying on this a.out header.

Note that this is mostly speculation and may all not apply, if my recollection
of the embedded a.out header is nonsense.

Ciao,
Wolfgang
-- 
ws@TooLs.DE     (Wolfgang Solfrank, TooLs GmbH) 	+49-228-985800