On 29/12/15 10:16, John Paul Adrian Glaubitz wrote: > Hi Mark! > > On 12/29/2015 11:03 AM, Mark Cave-Ayland wrote: >> The a.out magic (0x107) is located at bytes 0x202-0x204 in the working >> image but appears at bytes 0x206-0x207 in the broken image. It looks >> like somehow your 64-bit SILO build is extending the a.out header fields >> from 32-bits to 64-bits which is why the bootloader fails to be detected >> by the PROM. > > Great work, you're absolutely right. The offsets for the magic are > different when comparing both isofs.b files. My suspicion is that there > is maybe a patch we need on sparc64 that's missing. > > @Jose: Any idea?
Browsing SILO's Rules.make file, it looks like the conversion to a.out is done using a separate executable, elftoaout. Some quick searching with Google takes me here: http://www.linuxfromscratch.org/clfs/view/svn/sparc64-64/final-system/elftoaout.html which points towards a set of 64-bit fixes at https://github.com/bradfa/cross-lfs/blob/master/patches/elftoaout-2.3-64bit_fixes-1.patch. A casual glance indicates that this at least fixes the problems with a.out header padding on 64-bits by switching "unsigned long" to "u_int32_t" in the relevant file, so it's definitely worth giving this patchset a try. HTH, Mark.

