[ECOS] Elf to Bin format

Narayana, Venkat A. NarayVA@nsc-msg01.network.com
Mon Jun 4 11:49:00 GMT 2001


Hi Friends,
Thanks you very much for helping me a learn a lot.
The problem i encountered is both with my experimentation
and with the convert tool i am using.This tool,by default,
will convert elf sections based on Virtual addresses,
not on physical addresss. This means that the bin file
will not contain any sections, whose reloc addresses are 
different from load address. To compound the matters,
the bin file size this tool created is same as objcopy's
bin file, hence the confusion.

Thanks for your patience and help.

Thanks to Mark, Jonathan, Gary and others.

Best Regards,
Venkat

>>>>> Narayana, Venkat A writes:

> 	objdump of redboot.elf

> arm-elf-objdump -h redboot.elf | more

> redboot.elf:     file format elf32-littlearm

> Sections:
> Idx Name          Size      VMA       LMA       File off  Algn
>   0 .debug_aranges 000005a0  00000000  00000000  0003a7d4  2**0
>                   CONTENTS, READONLY, DEBUGGING
>   1 .debug_pubnames 000027b0  00000000  00000000  0003ad74  2**0
>                   CONTENTS, READONLY, DEBUGGING
>   2 .debug_info   000303df  00000000  00000000  0003d524  2**0
>                   CONTENTS, READONLY, DEBUGGING
>   3 .debug_abbrev 00004794  00000000  00000000  0006d903  2**0
>                   CONTENTS, READONLY, DEBUGGING
>   4 .debug_line   000184ab  00000000  00000000  00072097  2**0
>                   CONTENTS, READONLY, DEBUGGING
>   5 .rom_vectors  00000040  a0000000  00000000  00008000  2**0
>                   CONTENTS, ALLOC, LOAD, CODE
>   6 .text         000274b4  00002000  00002000  0000a000  2**14
>                   CONTENTS, ALLOC, LOAD, READONLY, CODE
>   7 .fini         00000000  000294b4  000294b4  0008a542  2**0
>                   CONTENTS
>   8 .rodata       00006e38  000294b4  000294b4  000314b4  2**2
>                 CONTENTS, ALLOC, LOAD, DATA
>   9 .rodata1      00000000  000302ec  000302ec  0008a542  2**0
>                   CONTENTS
>  10 .fixup        00000000  000302ec  000302ec  0008a542  2**0
>                   CONTENTS
>  11 .gcc_except_table 00000000  000302ec  000302ec  0008a542  2**0
>                   CONTENTS
>  12 .fixed_vectors 00000160  a1f00020  a1f00020  0008a560  2**5
>                   CONTENTS
                               ^^^^^^^^^^^^^^^^^^

This looks worng. You mentioned earlier that you moved .fixed_vectors.
This may be triggering a objcopy bug. Objcopy would try to put the
.fixed_vectors at offset 0xa1f00020 in the binary file which would
make the file ~2.7G long. Objcopy might be giving up at this point
so it doesn't get to .data. 

It looks like you missed something when moving the .fixed_vectors
around.

>  13 .data         000007d4  a000a000  000302ec  0003a000  2**2
>                   CONTENTS, ALLOC, LOAD, DATA
>  14 .bss          00006c38  a000a7d4  a000a7d4  0003a7d4  2**4
>                   ALLOC

--Mark



More information about the Ecos-discuss mailing list