Problem in rtld.c with gcc-2.95pre
Franz Sirl
Franz.Sirl-kernel@lauterbach.com
Sat Jun 12 03:53:00 GMT 1999
Am Sat, 12 Jun 1999 schrieb Geoff Keating:
>> Mailing-List: contact libc-alpha-help@sourceware.cygnus.com; run by ezmlm
>> From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
>> Date: Sat, 12 Jun 1999 11:23:10 +0200
>> Cc: libc-alpha@sourceware.cygnus.com
>
>> Hmm, so is this a bug in gcc or in glibc? Or in both? Wouldn't it be
>> better to just split out the end of _dl_start into a separate
>> function/file? This should be a portable solution for all platforms.
>>
>> FYI, both splitting out the end of _dl_start and using asm volatile("" : : :
>> "r30") solves the problem and the resulting gcc-2.95pre built library passes
>> all tests.
>
>It's certainly a gcc bug; if you say that "memory" was clobbered, gcc
>shouldn't cache the contents of any memory. Otherwise, all sorts of
>tricks become impossible, like switching address spaces mid-program.
I'm not so sure about that. Why should gcc consider read-only memory like the
the GOT as clobberable at all? It's not part of the "user" address space viewed
from gcc, otherwise a simple asm volatile("" : "=m" (&_dl_rtld_map) : : ) would
do the trick. But my knowledge might be to vague here.
>Splitting _dl_start would be one way to make it work on ppc; I don't know
>about on other platforms. Clobbering r30 is likely to stop working
>in future.
Splitting _dl_start should work on all platforms, at least until compilers are
able to inline functions across separate .c files.
Another way would be to force gcc to output something like a gen_blockage(),
but I don't know if that is possible.
Franz.
More information about the Libc-alpha
mailing list