c++/2274: loading elf generates error msg

c.gers@jenoptik-si.de c.gers@jenoptik-si.de
Mon Jun 18 15:58:00 GMT 2007


>Number:         2274
>Category:       c++
>Synopsis:       loading elf generates error msg
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 18 15:58:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     c.gers@jenoptik-si.de
>Release:        unknown-1.0
>Organization:
>Environment:
gcc 4.1.1, binutils 2.16.0 cross development pc as host ppc as target (xilinx environment + tools)
>Description:
loading an elf file causes the message :
Error: Dwarf Error: wrong version in compilation unit header (is 512, should be 2) [in module /cygdrive/x/Projekte/VCI_2_Project/FPGAs/EDK/_BL/BL_PPC_0/executable.elf] 

i think this is a problem of mixed little and big endian modules in my app. The boot module for the ppc has to be in big endian. After init i switch endianess and jum into other modules now compiled as little endian. 

I tried readelf -wi and saw :
The section .debug_info contains:
Compilation Unit @ offset 0x0:
Length 20300443136
Version 512
:
readelf -a brings up
.debug_info offset = 021913
:
Now i tried to repair the fault :
Hexeditor offset 021913
00 00 00 79 00 02 -> changed to 79 00 00 00 02 00
and heureca things work again.

i dont know if this is a problem of gdb or of the compiler/linker so please forward this information if you think other people shoud handle this.

tks
>How-To-Repeat:
Use readelf -wi executable.elf
>Fix:
Hexeditor offset 021913
00 00 00 79 00 02 -> changed to 79 00 00 00 02 00
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gdb-prs mailing list