Subject: Re: cross-elf2ecoff
To: M. Warner Losh <>
From: Jason R Thorpe <>
List: tech-toolchain
Date: 03/21/2002 20:56:20
On Thu, Mar 21, 2002 at 09:30:30PM -0700, M. Warner Losh wrote:

 > The issue with objcopy is that it produces ECOFF files that older ROMs
 > won't boot.  These files have the wrong magic number.  While the magic
 > number can sometimes be changed and the file will boot, other times it
 > can't.  At least that's been my experience with elf2ecoff and my
 > Deskstation rPC44.

Right, the most serious problem is that when the ELF image is read
into BFD's internal format, D_PAGED is set in the metadata.  Because
D_PAGED is set, when the image is when written out to ECOFF, it is
marked as ZMAGIC, even though the ECOFF file sections are okay.  I have
an e-vile hack which uses an iffy hueristic to clear D_PAGED in the

The less serious problem is that the ELF sections (and thus the ECOFF
sections) are in the wrong order for some systems' firmware.  This can
mostly be corrected by using a linker script properly.

        -- Jason R. Thorpe <>