This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
Re: coping with PT_PHDR not being in loaded segment
- To: drepper@cygnus.com (Ulrich Drepper), Ulrich Drepper <drepper@cygnus.com>
- Subject: Re: coping with PT_PHDR not being in loaded segment
- From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
- Date: Mon, 10 May 1999 22:56:10 +0200
- Cc: Roland McGrath <roland@frob.com>, GNU libc hacker <libc-hacker@gnu.org>, ian@cygnus.com
- References: <r2iua1ym1g.fsf@happy.cygnus.com>
Am Mon, 10 May 1999 schrieb Ulrich Drepper:
>Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
>
>> Has anyone successfully verified on any platform that the fix works? I
>> still get the FAIL "FAIL: shared (non PIC, load offset)" in the
>> ld-testsuite of gas-990418 on powerpc-linux-gnu. But now the testcase
>> segfaults instead of printing "BUG in dynamic linker".
>
>Please run the debugger. You can use the dynamic loader just like a
>program.
I wish it was that easy on PPC. gdb is nearly useless in debugging ld.so on
PPC. Nevertheless, with some hairy debugging I was able to narrow it down to
the following code in do-lookup.h, around line 76:
/* Search the appropriate hash bucket in this object's symbol table
for a definition for the same symbol name. */
for (symidx = map->l_buckets[hash % map->l_nbuckets];
symidx != STN_UNDEF;
symidx = map->l_chain[symidx])
{
sym = &symtab[symidx];
It seems to segfault because map->l_nbuckets is zero and so the modulo operation
produces an invalid (undefined) index for the map->l_buckets[] array.
Franz.