This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g77 pic case vs. binutils & readelf
- To: robertl at sco dot com
- Subject: Re: g77 pic case vs. binutils & readelf
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Fri, 4 Jun 1999 09:33:10 -0700
- CC: egcs at egcs dot cygnus dot com
Hi Robert,
: Sometime in mid-april several of the -fPIC g77 testcases started
: aborting on OpenServer. Last night, I found that it was the dynamic
: linker that was dropping core. [ Details in that message. ] I just
: fed one of the offending binaries to 'readelf -a' from the binutils
: snapshots. Since binutils is dropping core when reading the binary, I
: assume the binary (for whatever reason) is malformed.
:
: (gdb)
: Continuing.
: 0805586c 02b06 R_386_GLOB_DAT 08048ab4 ungetc
: 00000000 00000 R_386_NONE
:
: Breakpoint 2, dump_relocations (file=0x452b28, rel_offset=40, rel_size=4,
: symtab=0x806ca38, strtab=0x806c6c0 "", is_rela=0)
: at /play/binutils/binutils/readelf.c:577
: 577 psym = symtab + symtab_index;
: (gdb) s
: 579 printf (" %08lx ", (unsigned long) psym->st_value);
: (gdb)
:
: Program received signal SIGSEGV, Segmentation fault.
The most likely things is going wrong here is that 'symtab_index' is
some stupid value (ppossibly negative). It is extracted from the
'info' field of the reloc with the macro ELF32_R_SYM(). My guess is
that this field is not being initialised correctly when the reloc is
being created.
Cheers
Nick