I compiled valgrind 3.4.1 using ./configure --build=powerpc-linux-uclibc
--host=ppc-linux-uclibc --enable-tls=no --prefix=/mnt/cflash/valgrind
Target is powerpc linux embedded device (debian base) with uclibc.
# ./valgrind /usr/bin/scp
valgrind: /usr/bin/scp: bad ELF magic number
valgrind: cannot execute binary file
It all seems to boil down to VG_(pread) (or more specifically VG_(lseek))
not working correctly on my system. Here is the relevant portion of strace:
open("/usr/bin/scp", O_RDONLY) = 3
stat64("/usr/bin/scp", {st_mode=S_IFREG|0755, st_size=40140, ...}) = 0
geteuid() = 0
fstat64(3, {st_mode=S_IFREG|0755, st_size=40140, ...}) = 0
lseek(3, 0, SEEK_SET) = 0
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\2\0\24\0\0\0\1\20\0 "..., 4096) =
4096
lseek(3, 0, SEEK_SET) = 0
read(3, "\335\335\335\335\335\335\335\335\335\335\335\335\335\335"..., 52) =
52
write(2, "valgrind: /usr/bin/scp: bad ELF "..., 45) = 45
The code does 2 calls to pread. The first one reads the correct magic number
(\177ELF), while the second reads garbish (\355\355\355\355).
Remark that all system calls return without error.
Additionally, I tried a small test C-program compiled with the same compiler
which makes direct call to pread, and it works like a charm. The same OK
result with a test program that does the same operation as valgrind (not
using the VG_() macros) : lseek, read, lseek, read. All work fine.
Any help would be greatly apreciated.
Bram.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users