PDA

View Full Version : Elf2bin problem



Azuki
May 29th, 2006, 14:09
Hi everybody,

I try to convert a .elf file i have made and i use (it works on DC with the cable) in a .bin file to make an autoboot CD.

I try several elf2bin tools but errors occur :


BFD: Warning: Writing section `.text' to huge (ie negative) file offset 0x8bfe00
00.
BFD: Warning: Writing section `.rodata' to huge (ie negative) file offset 0x8c04
b080.
BFD: Warning: Writing section `.data' to huge (ie negative) file offset 0x8c070a
a0.
BFD: Warning: Writing section `.eh_frame' to huge (ie negative) file offset 0x8c
07670c.
BFD: Warning: Writing section `.ctors' to huge (ie negative) file offset 0x8c076
7a0.
BFD: Warning: Writing section `.dtors' to huge (ie negative) file offset 0x8c076
7a8.
/cygdrive/c/WINDOWS/TEMP/elf2bin_tmp/sh-elf-objcopy: test.bin: File truncated
ELF2BI.EXE: Conversion of test.elf to test.bin completed.


Anyone could help me please ?


thank you

fackue
May 30th, 2006, 00:21
Try 1st_read.bin checker (http://www.consolevision.com/members/fackue/?My_Projects:1st_read.bin_file_checker) as in contains extra parameters for the extact problem you're getting.

Azuki
May 30th, 2006, 17:59
Thanks !

SiZiOUS
May 30th, 2006, 19:53
Yes it's depends of your binutils version. If you want to put the conversion in your makefiles, you can do this (Does your tool support commands line Fakue ? If yes ignore the next of this message) :

To know the version of your binutils type sh-elf-objcopy -v.

If your version is 2.13 or minor, use the command : sh-elf-objcopy -O binary myproggy.elf myproggy.bin

For 2.14 the command is : sh-elf-objcopy -S -R .stack -O binary myproggy.elf myproggy.bin

fackue
June 8th, 2006, 22:11
My tool add -R .stack... though I don't remember using -S. It didn't seem to have problems... what's -S for?

SiZiOUS
June 19th, 2006, 12:54
My tool add -R .stack... though I don't remember using -S. It didn't seem to have problems... what's -S for?
Don't know :D

Erwan wrote it in his Wiki.

PS : I updated my Elf2bin (http://sbibuilder.dc-france.com/index.php?mod=archives&ac=voir&id=81) proggy too.