|
From: Tom H. <th...@cy...> - 2004-03-15 09:36:51
|
In message <E1B...@st...>
Tom Hughes <th...@cy...> wrote:
> gcc -DHAVE_CONFIG_H -I. -I. -I.. -I./demangle -I../include -I./x86 -DVG_LIBDIR="\"/tmp/valgrind.7607/valgrind/Inst/lib/valgrind"\" -Winline -Wall -Wshadow -O -fno-omit-frame-pointer -mpreferred-stack-boundary=2 -g -DELFSZ=32 -c `test -f 'vg_signals.c' || echo './'`vg_signals.c
> vg_signals.c: In function `fill_ehdr':
> vg_signals.c:1310: `ELFOSABI_LINUX' undeclared (first use in this function)
> vg_signals.c:1310: (Each undeclared identifier is reported only once
> vg_signals.c:1310: for each function it appears in.)
It appears that /usr/include/elf.h on RH 7.2 doesn't declare this
constant. Curiously all the programs I've looked at on my linux boxes
have the ABI set to SYSV in their header anyway...
Or maybe it just isn't set at all? Certainly the kernel doesn't
normally fill in ELFOSABI_LINUX for that value when generating a
core dump. The code in kernel/binfmt_elf.c looks like this:
memcpy(elf->e_ident, ELFMAG, SELFMAG);
elf->e_ident[EI_CLASS] = ELF_CLASS;
elf->e_ident[EI_DATA] = ELF_DATA;
elf->e_ident[EI_VERSION] = EV_CURRENT;
memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD);
So everything except the magic number, class, endianness and version
is just zero filled.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|