|
From: Jeremy F. <je...@go...> - 2005-02-15 10:31:48
|
On Mon, 2005-02-07 at 12:36 +0600, Evgeny Baskakov wrote:
> Hello.
>
> I think there is a bug in valgrind. There is a small pre-compiled
> program attached.
> It has been produced by our own compiler and linker tools. This
> program (which prints
> "Hello world!" on the console) works fine on all Linux distros (Red
> Hat 8, 9, FC1, 2, 3,
> SuSe 8, 9, etc.) But when I try to run it with valgrind, the latter
> crashes.
>
> Valgrind seems to be a great tool, so it would be extremely fine if it
> could work with
> our executables. The manual says that it works with all Linux/x86
> executables, but
> it appeared that not all executables are supported...
>
> If there is no way to fix valgrind core, could you tell us what we
> should change in our
> linker to produce proper executables?
Your executable just flat out doesn't work for me. It dumps core as
soon as I run it natively, as well as causing Valgrind to crash
instantly. ldd doesn't work on it.
Oh, I see your problem:
readelf -hl shows:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000000 0x08048000 0x08048000 0x002a7 0x01000 R 0x1000
^^^^^^^ ^^^^^^^ ^
LOAD 0x001000 0x08049000 0x08049000 0x1333f 0x14000 R E 0x1000
LOAD 0x015000 0x0805d000 0x0805d000 0x0151c 0x02000 RW 0x1000
LOAD 0x017000 0x0805f000 0x0805f000 0x00000 0x1b000 RW 0x1000
Your filesize is < your memsize, so the loader is required to pad the
difference with zeros, but your mappings are read-only, so it dies when
it tries. You should set the filesize to be the same as your memsize
unless you want this behaviour, in which case you should make the
mapping writable.
J
|