|
From: Naveen K. <g_n...@ya...> - 2009-05-11 12:48:02
|
Hmm. I tried nm and I get a lot of errors like this
BFD: /mnt2/package/usr/local/valgrind/bin/valgrind: invalid string offset 12 >= 0 for section `'
BFD: /mnt2/package/usr/local/valgrind/bin/valgrind: invalid string offset 65536 >= 0 for section `.shstrtab'
I tried readelf and it looks like lots of sections are corrupt
-bash-2.05b# readelf -a /mnt2/package/usr/local/valgrind/bin/valgrind
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: PowerPC
Version: 0x1
Entry point address: 0x100007c8
Start of program headers: 52 (bytes into file)
Start of section headers: 31716 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 8
Size of section headers: 40 (bytes)
Number of section headers: 40
Section header string table index: 37
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] <corrupt> <unknown>: 2e63 74002e64 65627567 5f617261 7075626e AXxSIOTxxxxxop 1852269939 3040357 1651861343
[ 1] <corrupt> <unknown>: 2e64 696e666f 2e6465 6275675f 675f6c69 WAXxMIOGTxxxxop 1633837682 1702232110 1684365941
[ 2] <corrupt> LOOS+4656275 616d6500 2e646562 75675f73 6e676573 AMSIGTxxxxxxop 1953628206 1684365941 1734308449
[ 3] <corrupt> NULL 00000000 000000 000000 00 0 0 0
[ 4] <corrupt> <unknown>: 1b 00000002 10000154 000154 01 W 13 0 0
[ 5] <corrupt> <unknown>: 23 00000002 10000164 000164 04 WAX 32 0 0
[ 6] <corrupt> <unknown>: 31 00000002 10000184 000184 04 WX 212 4 0
[ 7] <corrupt> <unknown>: 37 00000002 10000258 000258 04 WAx 544 5 1
[ 8] <corrupt> <unknown>: 3f 00000002 10000478 000478 01 WA 320 0 0
[ 9] <corrupt> <unknown>: 47 00000002 100005b8 0005b8 02 WAXxMSILOGTxxxxxxxxxop 68 4 0
[10] <corrupt> <unknown>: 54 00000002 100005fc 0005fc 04 AXxMSILOGTxxxxxxxxxop 48 5 1
[11] <corrupt> <unknown>: 63 00000002 1000062c 00062c 04 X 24 4 0
[12] <corrupt> <unknown>: 6d 00000002 10000644 000644 04 X 348 4 26
[13] <corrupt> <unknown>: 77 00000006 100007a0 0007a0 04 W 40 0 0
[14] <corrupt> <unknown>: 7d 00000006 100007c8 0007c8 04 W 9252 0 0
[15] <corrupt> <unknown>: 83 00000006 10002bec 002bec 04 W 32 0 0
[16] <corrupt> <unknown>: 89 00000002 10002c0c 002c0c 04 W 1160 0 0
[17] <corrupt> <unknown>: 91 00000002 10003094 003094 04 W 0 0 0
[18] <corrupt> <unknown>: 99 00000002 10003094 003094 04 W 28 0 0
[19] <corrupt> <unknown>: a7 00000002 100030b0 0030b0 04 W 96 0 0
[20] <corrupt> <unknown>: b1 00000003 10013110 003110 04 W 8 0 0
[21] <corrupt> <unknown>: b8 00000003 10013118 003118 04 W 8 0 0
[22] <corrupt> <unknown>: bf 00000003 10013120 003120 04 W 4 0 0
[23] <corrupt> <unknown>: c4 00000003 10013124 003124 01 W 16 0 0
[24] <corrupt> <unknown>: ca 00000003 10013134 003134 04 AX 200 5 0
[25] <corrupt> <unknown>: d3 00000003 100131fc 0031fc 04 W 12 0 0
[26] <corrupt> <unknown>: d9 00000007 10013208 003208 04 W 20 0 0
[27] <corrupt> <unknown>: de 00000003 1001321c 00321c 04 W 0 0 0
[28] <corrupt> <unknown>: e5 00000003 1001321c 00321c 04 x 8 0 0
[29] <corrupt> <unknown>: 72 00000007 10013224 00321c 04 x 420 0 0
[30] <corrupt> <unknown>: eb 00000003 100133c8 00321c 04 x 4100 0 0
[31] <corrupt> <unknown>: f0 00000000 000000 00321c 01 W 650 0 0
[32] <corrupt> <unknown>: f9 00000000 000000 0034a8 08 W 280 0 0
[33] <corrupt> <unknown>: 108 00000000 000000 0035c0 01 W 313 0 0
[34] <corrupt> <unknown>: 118 00000000 000000 0036f9 01 W 8848 0 0
[35] <corrupt> <unknown>: 124 00000000 000000 005989 01 W 2177 0 0
[36] <corrupt> <unknown>: 132 00000000 000000 00620d 00 W 167772173 176488448 0
[37] <corrupt> NULL 00010000 000000 000000 00 xxxo 1821376512 43778048 0
[38] <corrupt> NULL 00010000 300000 000000 00 xxxo 1865154560 135856128 0
[39] <corrupt> <unknown>: 1000 00010000 000000 000000 00 xxo 2001010688 54001664 0
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
There are no section groups in this file.
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000034 0x10000034 0x10000034 0x00120 0x00120 R E 0x4
INTERP 0x000154 0x10000154 0x10000154 0x0000d 0x0000d R 0x1
[Requesting program interpreter: /lib/ld.so.1]
LOAD 0x000000 0x10000000 0x10000000 0x03110 0x03110 R E 0x10000
LOAD 0x003110 0x10013110 0x10013110 0x0010c 0x012bc RWE 0x10000
readelf: Error: no .dynamic section in the dynamic segment DYNAMIC 0x003134 0x10013134 0x10013134 0x000c8 0x000c8 RW 0x4
NOTE 0x000164 0x10000164 0x10000164 0x00020 0x00020 R 0x4
GNU_EH_FRAME 0x003094 0x10003094 0x10003094 0x0001c 0x0001c R 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4
Section to Segment mapping:
Segment Sections...
readelf: ../../binutils/readelf.c:3374: process_program_headers: Assertion `string_table != ((void *)0)' failed.
Aborted
----- Original Message ----
From: Bart Van Assche <bar...@gm...>
To: g_n...@ya...
Cc: val...@li...
Sent: Monday, May 11, 2009 2:24:20 AM
Subject: Re: [Valgrind-developers] cross compiling valgrind
On Sat, May 9, 2009 at 9:53 PM, <g_n...@ya...> wrote:
> I understand the logic behind the --prefix option. I am purposely running the valgrind
> executable off of a different path to test if it atleast gives the "unable to locate memcheck
> library" error. After that passes that then I will copy/link directly on target. I will try the
> command that you suggest and check if valgrind is linked properly. Thanks for the info.
Something else you could check is whether there are any undefined
symbols in the Valgrind executable (nm ... | grep ' U '). To my
surprise, I noticed yesterday that it is possible on PPC to create
executables that contain an undefined symbol. When starting such an
executable the result is a segmentation fault.
Bart.
|