Subject: re: sparc ELF kernels with a miniroot are broken.
To: matthew green <mrg@eterna.com.au>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-sparc
Date: 06/23/1999 21:03:06
mrg writs:

>>   If you link a kernel with -m, does the link map look sane?
>
>uh, i have no idea what this means.

Invoke ld (by hand) so as to get a linker map.  Check the output to
see ld is putting the .bss data for the miniroot in the right segment.

>>   What about objdump output?
>
>anything in particular?  i can output probably 1M of 'useful'
>data with objdump and this file.  :-)

Check the ELF program header and the ELF section headers. 
Run:
	 objdump --file-headers ./netbsd 
	 objdump --section-headers ./netbsd 

Check that the ELF program-section layout from the first looks okay,
and then that the section headers are laid out in a plausible order,
with appropriate alignment constraints, and with VMAs/LMAs that are
consistent with the file-header sections.

If those  look OK try 
   objdump --full-headers
which will dump both the above, plus the symbol table, too.

(hm, you might have to do objdump --full-headers | head -10
to get the program header: I forget).


Or you could do binary-search on the size allocated for a miniroot,
looking for a thresh-hold where things break; and then compare the
program and section headers, on the broken and non-broken kernels,
looking for inconsistencies.

   
>>   If you build a miniroot kernel but dont stuffing a .fs into the
>>   miniroot space, and try and boot it, does that at least get loaded (up
>>   to trying to mount root)?

>as i meantioned earlier, it is broken before mdsetimage runs.  the
>exact same lossage happens either way.

Oh. Sorry.  I did look, but didnt find any mention of that; just
taking out MIN[I]ROOT altogether.