[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Status - compiling on hppa / ld sigsegv's - glibc 2.2.93



> (gdb) set args --help
> (gdb) r
> Starting program: /mnt/flaire/src/glibc-upstream-cvs/libc-build/elf/ld.so.1 --help
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x410026a4 in _dl_start () at do-rel.h:73
> 73            r = r + MIN (nrelative, relsize / sizeof (ElfW(Rel)));
> (gdb) bt
> #0  0x410026a4 in _dl_start () at do-rel.h:73
> #1  0x4100209c in _start () at rtld.c:154
> (gdb) disassemble 
> ...
> 0x410026a4 <_dl_start+624>:     fldd 0(sr0,r1),fr22

Carlos,

Some bits of info that might be useful for sorting this out...

The relsize / sizeof(ElfW(Rel)) is translated by gcc into a series of
floating point operations (as you disassembled above). Through some test
programs, it seems like gcc's strategy for handling a code segment like
that is:

f.e. given sizeof(foo) == 12, and we want to compute bar / sizeof(foo)
put 1/12 in the data section, load that from memory into a floating
point reg, load bar into another floating point reg, and multiple them.

r1 at this point in the code should be pointing to the constant in
memory. since it is 0, we get a segfault (indeed if we replace the
sizeof() with a constant, like 8, ld.so works).

I'm guessing this means that our lp (r19) is not setup correctly when
_dl_start is called, but i haven't dug enough into the code to figure
out the details yet.

randolph
--  
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/



Reply to: