This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Gcc builtin functions used by glibc not available on mips
- From: "H . J . Lu" <hjl at lucon dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: GNU C Library <libc-alpha at sources dot redhat dot com>, gcc at gcc dot gnu dot org,echristo at redhat dot com
- Date: Thu, 7 Feb 2002 08:50:19 -0800
- Subject: Re: Gcc builtin functions used by glibc not available on mips
- References: <20020206222554.A5621@lucon.org> <20020207120055.A558@sunsite.ms.mff.cuni.cz>
On Thu, Feb 07, 2002 at 12:00:55PM +0100, Jakub Jelinek wrote:
> On Wed, Feb 06, 2002 at 10:25:54PM -0800, H . J . Lu wrote:
> > In glibc, there are codes
> >
> > /* Partly clean the `bootstrap_map' structure up. Don't use
> > `memset' since it might not be built in or inlined and we cannot
> > make function calls at this point. Use '__builtin_memset' if we
> > know it is available. */
> > #if __GNUC_PREREQ (2, 96)
> > __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
> > #else
> > for (cnt = 0;
> > cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info[0]);
> > ++cnt)
> > bootstrap_map.l_info[cnt] = 0;
> > #endif
> >
> > used in ld.so bootstrap. The problem is even gcc 3.1 doesn't have a
> > real __builtin_memset for mips. I am very reluctant to call it a gcc
> > bug. Maybe we should check it during the gcc configure instead of
> > depending on "#if __GNUC_PREREQ (2, 96)".
>
> Well, I think on most arches this __builtin_memset will actually expand to
> real memset, since sizeof (bootstrap_map.l_info) is more than 64 * sizeof (void *),
> ie. really big. Guess just ia-32 will expand it inline.
Shouldn't we test __builtin_memset (x, 0, 64 * sizeof (void *)) before
using it?
>
> But, memset is local symbol in ld.so, do even calls to local functions have
> to go through plt or got on mips?
I think so. It goes through local GOT. The dynamic linker still has
to adjust it.
H.J.