From aj@suse.de Mon Apr 1 07:56:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Mon, 01 Apr 2002 07:56:00 -0000 Subject: multiple definition of `__malloc_initialize_hook' Message-ID: Building a static only glibc for i686-linux I get this error with glibc mainline: /builds/glibc/static/libc.a(malloc.o): In function `malloc_init_state': /usr/src/cvs/libc/malloc/malloc.c:2188: multiple definition of `__malloc_initialize_hook' /builds/glibc/static/locale/localedef.o:/usr/src/cvs/libc/locale/programs/localedef.c:151: first defined here collect2: ld returned 1 exit status make[2]: *** [/builds/glibc/static/locale/localedef] Error 1 How can we fix this? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From jakub@redhat.com Tue Apr 2 10:02:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 02 Apr 2002 10:02:00 -0000 Subject: [PATCH] Fix ether/netgroup/publikey nss lookups Message-ID: <20020402200204.V32482@sunsite.ms.mff.cuni.cz> Hi! 2002-03-15 patch added internal_function to DB_LOOKUP_FCT, but unfortunately some __nss_*_lookup calls are not done from within getXXbyYY_r.c, so we ended up with crashes because caller put arguments on the stack while callee expected them in registers. 2002-04-02 Jakub Jelinek * inet/ether_ntoh.c (__nss_ethers_lookup): Add internal_function. * inet/ether_hton.c (__nss_ethers_lookup): Likewise. * inet/getnetgrent_r.c (__nss_netgroup_lookup): Likewise. * sunrpc/netname.c (__nss_publickey_lookup): Likewise. * sunrpc/publickey.c (__nss_publickey_lookup): Likewise. --- libc/inet/ether_ntoh.c.jj Thu Aug 23 18:47:43 2001 +++ libc/inet/ether_ntoh.c Tue Apr 2 19:56:41 2002 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -31,7 +31,7 @@ typedef int (*lookup_function) (const st /* The lookup function for the first entry of this service. */ extern int __nss_ethers_lookup (service_user **nip, const char *name, - void **fctp); + void **fctp) internal_function; int --- libc/inet/getnetgrent_r.c.jj Fri Feb 8 12:04:02 2002 +++ libc/inet/getnetgrent_r.c Tue Apr 2 20:01:20 2002 @@ -38,7 +38,7 @@ static struct __netgrent dataset; /* The lookup function for the first entry of this service. */ extern int __nss_netgroup_lookup (service_user **nip, const char *name, - void **fctp); + void **fctp) internal_function; /* Set up NIP to run through the services. If ALL is zero, use NIP's --- libc/inet/ether_hton.c.jj Thu Aug 23 18:47:43 2001 +++ libc/inet/ether_hton.c Tue Apr 2 19:55:52 2002 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1999, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -30,7 +30,7 @@ typedef int (*lookup_function) (const ch /* The lookup function for the first entry of this service. */ extern int __nss_ethers_lookup (service_user **nip, const char *name, - void **fctp); + void **fctp) internal_function; int --- libc/sunrpc/netname.c.jj Mon Jul 23 12:56:01 2001 +++ libc/sunrpc/netname.c Tue Apr 2 20:03:35 2002 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk , 1997. @@ -135,7 +135,7 @@ typedef int (*netname2user_function) (co uid_t *, gid_t *, int *, gid_t *); /* The lookup function for the first entry of this service. */ extern int __nss_publickey_lookup (service_user ** nip, const char *name, - void **fctp); + void **fctp) internal_function; int netname2user (const char netname[MAXNETNAMELEN + 1], uid_t * uidp, gid_t * gidp, --- libc/sunrpc/publickey.c.jj Mon Jul 23 12:56:01 2001 +++ libc/sunrpc/publickey.c Tue Apr 2 20:04:11 2002 @@ -1,5 +1,5 @@ /* Get public or secret key from key server. - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -33,7 +33,7 @@ typedef int (*secret_function) (const ch /* The lookup function for the first entry of this service. */ extern int __nss_publickey_lookup (service_user **nip, const char *name, - void **fctp); + void **fctp) internal_function; int Jakub From jakub@redhat.com Tue Apr 2 10:22:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 02 Apr 2002 10:22:00 -0000 Subject: [PATCH] Fix Message-ID: <20020402202207.W32482@sunsite.ms.mff.cuni.cz> Hi! echo '#include ' | gcc -std=c99 -xc - fails because has: /* Now add the thread types. */ #if defined __USE_POSIX199506 || defined __USE_UNIX98 # include #endif so for ISO C99 _pthread_fastlock is not defined. Below is one solution (assuming semaphore.h can bring in pthread types), alternatively something like #ifdef _PTHREAD_FASTLOCK_DEFINED could be used). 2002-04-02 Jakub Jelinek * semaphore.h: Include bits/pthreadtypes.h. --- libc/linuxthreads/semaphore.h.jj Mon Jun 25 10:34:10 2001 +++ libc/linuxthreads/semaphore.h Tue Apr 2 20:25:27 2002 @@ -21,6 +21,7 @@ # define __need_timespec # include #endif +#include #ifndef _PTHREAD_DESCR_DEFINED /* Thread descriptors. Needed for `sem_t' definition. */ Jakub From aj@suse.de Tue Apr 2 10:22:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Tue, 02 Apr 2002 10:22:00 -0000 Subject: Remove sysdeps/mips/dec sysdeps/mips/mips3 sysdeps/mips/p40 Message-ID: The directories sysdeps/mips/dec sysdeps/mips/mips3 sysdeps/mips/p40 are only used for some old architecture with totally unsupported OSes. configure selects these supdirs with: mips*) base_machine=mips case "`uname -m`" in IP22) machine=mips/mips3 ;; *) machine=mips/$machine ;; esac ;; But under Linux we always get "mips" as result of "uname -m". Hartvig Ekner suggested to remove this, Ralf B??chle agreed to it - and I'm also convinced that we can get rid of these. Ok to commit the patch that removes those subdirs and adjusts configure for it? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Tue Apr 2 10:35:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 02 Apr 2002 10:35:00 -0000 Subject: Remove sysdeps/mips/dec sysdeps/mips/mips3 sysdeps/mips/p40 In-Reply-To: References: Message-ID: <1017772527.2844.51.camel@myware.mynet> On Tue, 2002-04-02 at 10:22, Andreas Jaeger wrote: > Ok to commit the patch that removes those subdirs and adjusts > configure for it? Yes. I somebody really needs then s/he can add them again. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From roland@frob.com Tue Apr 2 12:05:00 2002 From: roland@frob.com (Roland McGrath) Date: Tue, 02 Apr 2002 12:05:00 -0000 Subject: Remove sysdeps/mips/dec sysdeps/mips/mips3 sysdeps/mips/p40 In-Reply-To: Andreas Jaeger's message of Tue, 2 April 2002 20:22:15 +0200 Message-ID: <20020402200535.A95251B9C4@perdition.linnaean.org> Regardless, that use of `uname' is dead wrong. The selection must be made based on the configuration tuple. From drepper@redhat.com Tue Apr 2 14:30:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 02 Apr 2002 14:30:00 -0000 Subject: [PATCH] MEMORY_BARRIER default In-Reply-To: <15519.24920.656980.732584@napali.hpl.hp.com> References: <20020321204602.X32482@sunsite.ms.mff.cuni.cz> <1016742904.5188.166.camel@myware.mynet> <20020322092754.A32482@sunsite.ms.mff.cuni.cz> <15519.24920.656980.732584@napali.hpl.hp.com> Message-ID: <1017786600.2848.71.camel@myware.mynet> On Mon, 2002-03-25 at 09:41, David Mosberger wrote: > It seems to me that on ia64, MEMORY_BARRIER should expand into: > > asm volatile ("mf" ::: "memory") Yes, and I've added an appropriate change. I'm not entirely clear how the mf.a form comes into play. We have separate READ_MEMORY_BARRIER and WRITE_MEMORY_BARRIER macros and mf.a might fit for one of them. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From davidm@napali.hpl.hp.com Tue Apr 2 14:40:00 2002 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Tue, 02 Apr 2002 14:40:00 -0000 Subject: [PATCH] MEMORY_BARRIER default In-Reply-To: <1017786600.2848.71.camel@myware.mynet> References: <20020321204602.X32482@sunsite.ms.mff.cuni.cz> <1016742904.5188.166.camel@myware.mynet> <20020322092754.A32482@sunsite.ms.mff.cuni.cz> <15519.24920.656980.732584@napali.hpl.hp.com> <1017786600.2848.71.camel@myware.mynet> Message-ID: <15530.13130.141433.493025@napali.hpl.hp.com> >>>>> On 02 Apr 2002 14:30:00 -0800, Ulrich Drepper said: Uli> On Mon, 2002-03-25 at 09:41, David Mosberger wrote: >> It seems to me that on ia64, MEMORY_BARRIER should expand into: >> >> asm volatile ("mf" ::: "memory") Uli> Yes, and I've added an appropriate change. I'm not entirely Uli> clear how the mf.a form comes into play. We have separate Uli> READ_MEMORY_BARRIER and WRITE_MEMORY_BARRIER macros and mf.a Uli> might fit for one of them. Oh, no, that's not the intended use of mf.a. It's basically intended for implemented IN/OUT instruction emulation. It forces "device acceptance", which adds an off-chip roundtrip. Very bad for performance. In contrast, mf is fairly light-weight (doesn't cause any pipeline disruption; just forces ordering). It would be nice to have a way to take advantage of ia64's acquire/release model, since there are cases where this is much closer to what an application really wants. Hans and I briefly discussed this, but neither of us has had the time to really pursue this. --david From drepper@redhat.com Tue Apr 2 16:23:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 02 Apr 2002 16:23:00 -0000 Subject: [PATCH] i386 and sparc64 fabs In-Reply-To: <20020329215246.O32482@sunsite.ms.mff.cuni.cz> References: <20020329215246.O32482@sunsite.ms.mff.cuni.cz> Message-ID: <1017793384.2848.75.camel@myware.mynet> On Fri, 2002-03-29 at 12:52, Jakub Jelinek wrote: > Hi! > > No need to generate quite lengthy code for fabs* on these arches: Thanks, I've applied the patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From drepper@redhat.com Tue Apr 2 16:29:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 02 Apr 2002 16:29:00 -0000 Subject: [PATCH] Don't die on unknown dynamic tags In-Reply-To: <20020330190206.S32482@sunsite.ms.mff.cuni.cz> References: <20020330190206.S32482@sunsite.ms.mff.cuni.cz> Message-ID: <1017793781.2844.77.camel@myware.mynet> On Sat, 2002-03-30 at 10:02, Jakub Jelinek wrote: > > 2002-03-30 Jakub Jelinek > > * elf/dynamic-link.h (elf_get_dynamic_info): Don't abort on unknown > dynamic tags. OK, I've applied the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From drepper@redhat.com Tue Apr 2 16:32:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 02 Apr 2002 16:32:00 -0000 Subject: [PATCH] Fix ether/netgroup/publikey nss lookups In-Reply-To: <20020402200204.V32482@sunsite.ms.mff.cuni.cz> References: <20020402200204.V32482@sunsite.ms.mff.cuni.cz> Message-ID: <1017793970.2849.79.camel@myware.mynet> On Tue, 2002-04-02 at 10:02, Jakub Jelinek wrote: > 2002-03-15 patch added internal_function to DB_LOOKUP_FCT, but unfortunately > some __nss_*_lookup calls are not done from within getXXbyYY_r.c, so > we ended up with crashes because caller put arguments on the stack while > callee expected them in registers. OK, I've applied the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From drepper@redhat.com Tue Apr 2 16:34:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 02 Apr 2002 16:34:00 -0000 Subject: [PATCH] Fix In-Reply-To: <20020402202207.W32482@sunsite.ms.mff.cuni.cz> References: <20020402202207.W32482@sunsite.ms.mff.cuni.cz> Message-ID: <1017794054.2849.81.camel@myware.mynet> On Tue, 2002-04-02 at 10:22, Jakub Jelinek wrote: > so for ISO C99 _pthread_fastlock is not defined. Which is OK since is no C99 header. Code which uses the POSIX header must add the appropriate feature select macros. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From schwab@suse.de Wed Apr 3 07:36:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Wed, 03 Apr 2002 07:36:00 -0000 Subject: make install-headers missing files Message-ID: When doing make install-headers some headers are not installed. gnu/stubs.h is still not installed since that depends on a full library build, but for bootstrapping purpose an empty file will do. Andreas. 2002-04-03 Andreas Schwab * Makefile (headers): Add gnu/lib-names.h here instead of install-others. ($(inst_includedir)/gnu/lib-names.h): Remove explicit installation rule. (install-headers): Add dependency on install-headers-nosubdir. * stdio-common/Makefile (headers): Add bits/stdio_lim.h here instead of install-others. ($(inst_includedir)/bits/stdio_lim.h): Remove explicit installation rule. Index: Makefile =================================================================== RCS file: /cvs/glibc/libc/Makefile,v retrieving revision 1.210.2.1 diff -u -a -r1.210.2.1 Makefile --- Makefile 2002/01/08 21:43:50 1.210.2.1 +++ Makefile 2002/04/03 14:57:44 @@ -78,7 +78,7 @@ install-bin-script = glibcbug ifeq (yes,$(build-shared)) -install-others += $(inst_includedir)/gnu/lib-names.h +headers += gnu/lib-names.h endif include Makerules @@ -90,6 +90,9 @@ # Install from subdirectories too. install: subdir_install +# Explicit dependency so that `make install-headers' works +install-headers: install-headers-nosubdir + # Make sure that the dynamic linker is installed before libc. $(inst_slibdir)/libc-$(version).so: elf/ldso_install @@ -154,12 +157,6 @@ then echo 'stubs.h unchanged'; \ else $(INSTALL_DATA) $(objpfx)stubs.h $@; fi rm -f $(objpfx)stubs.h - -ifeq (yes,$(build-shared)) - -$(inst_includedir)/gnu/lib-names.h: $(common-objpfx)gnu/lib-names.h $(+force) - $(do-install) -endif # The `glibcbug' script contains the version number and it shall be rebuild # whenever this changes or the `glibcbug.in' file. Index: stdio-common/Makefile =================================================================== RCS file: /cvs/glibc/libc/stdio-common/Makefile,v retrieving revision 1.67 diff -u -a -r1.67 stdio-common/Makefile --- stdio-common/Makefile 2001/08/16 05:20:07 1.67 +++ stdio-common/Makefile 2002/04/03 15:00:28 @@ -21,7 +21,7 @@ # subdir := stdio-common -headers := printf.h stdio_ext.h +headers := printf.h stdio_ext.h bits/stdio_lim.h routines := \ ctermid cuserid \ @@ -42,8 +42,6 @@ routines += vfwprintf vfwscanf endif -install-others := $(inst_includedir)/bits/stdio_lim.h - aux := errlist siglist distribute := _itoa.h _itowa.h _i18n_number.h \ printf-parse.h stdio_lim.h.in tst-unbputc.sh tst-printf.sh @@ -84,9 +82,6 @@ tst-sscanf-ENV = LOCPATH=$(common-objpfx)localedata tst-swprintf-ENV = LOCPATH=$(common-objpfx)localedata test-vfprintf-ENV = LOCPATH=$(common-objpfx)localedata - -$(inst_includedir)/bits/stdio_lim.h: $(common-objpfx)bits/stdio_lim.h - $(do-install) ifeq ($(stdio),libio) ifneq (,$(filter %REENTRANT, $(defines))) -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N??rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From drepper@redhat.com Wed Apr 3 09:38:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 03 Apr 2002 09:38:00 -0000 Subject: make install-headers missing files In-Reply-To: References: Message-ID: <1017855529.26458.55.camel@akkadia.org> On Wed, 2002-04-03 at 07:32, Andreas Schwab wrote: > When doing make install-headers some headers are not installed. > gnu/stubs.h is still not installed since that depends on a full library > build, but for bootstrapping purpose an empty file will do. What exactly are you trying to do? What commands do you run? -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From schwab@suse.de Wed Apr 3 12:25:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Wed, 03 Apr 2002 12:25:00 -0000 Subject: make install-headers missing files In-Reply-To: <1017855529.26458.55.camel@akkadia.org> (Ulrich Drepper's message of "03 Apr 2002 09:38:49 -0800") References: <1017855529.26458.55.camel@akkadia.org> Message-ID: Ulrich Drepper writes: |> On Wed, 2002-04-03 at 07:32, Andreas Schwab wrote: |> > When doing make install-headers some headers are not installed. |> > gnu/stubs.h is still not installed since that depends on a full library |> > build, but for bootstrapping purpose an empty file will do. |> |> What exactly are you trying to do? What commands do you run? As I wrote above: make install-headers. This is supposed to install the headers to do initial bootstrapping for an otherwise empty system. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N??rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From jakub@redhat.com Wed Apr 3 13:09:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 03 Apr 2002 13:09:00 -0000 Subject: [PATCH] Skip DT_RELACOUNT relocs on ia-64/alpha if l_addr == 0 Message-ID: <20020403230906.H32482@sunsite.ms.mff.cuni.cz> Hi! As both alpha and ia64 never use addend when relocating relative relocs (ie. they do M += L) and as prelink -r libc.so.6 saved 15% startup time on IA-32 for programs using solely -lc, I think this patch might be useful for IA-64 and Alpha. BTW: Have you looked at the dl-{s,}brk patch I posted (http://sources.redhat.com/ml/libc-hacker/2002-03/msg00100.html)? 2002-04-03 Jakub Jelinek * elf/do-rel.h (elf_dynamic_do_rel): Skip relative relocs if l_addr == 0 and ELF_MACHINE_REL_RELATIVE. * sysdeps/alpha/dl-machine.h (ELF_MACHINE_REL_RELATIVE): Define. * sysdeps/ia64/dl-machine.h (ELF_MACHINE_REL_RELATIVE): Define. --- libc/elf/do-rel.h.jj Mon Feb 4 17:34:51 2002 +++ libc/elf/do-rel.h Wed Apr 3 22:47:19 2002 @@ -83,11 +83,12 @@ elf_dynamic_do_rel (struct link_map *map weak_extern (GL(dl_rtld_map)); # endif if (map != &GL(dl_rtld_map)) /* Already done in rtld itself. */ -# ifndef DO_RELA +# if !defined DO_RELA || defined ELF_MACHINE_REL_RELATIVE /* Rela platforms get the offset from r_addend and this must be copied in the relocation address. Therefore we can skip the relative relocations only if this is for rel - relocations... */ + relocations or rela relocations if they are computed as + memory_loc += l_addr... */ if (l_addr != 0) # else /* ...or we know the object has been prelinked. */ --- libc/sysdeps/alpha/dl-machine.h.jj Sat Mar 23 11:51:04 2002 +++ libc/sysdeps/alpha/dl-machine.h Wed Apr 3 22:49:24 2002 @@ -577,6 +577,10 @@ elf_machine_rela (struct link_map *map, } } +/* Let do-rel.h know that on Alpha if l_addr is 0, all RELATIVE relocs + can be skipped. */ +#define ELF_MACHINE_REL_RELATIVE 1 + static inline void elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc, Elf64_Addr *const reloc_addr) --- libc/sysdeps/ia64/dl-machine.h.jj Sat Mar 23 11:51:45 2002 +++ libc/sysdeps/ia64/dl-machine.h Wed Apr 3 22:50:02 2002 @@ -577,6 +577,10 @@ elf_machine_rela (struct link_map *map, assert (! "unexpected dynamic reloc format"); } +/* Let do-rel.h know that on IA-64 if l_addr is 0, all RELATIVE relocs + can be skipped. */ +#define ELF_MACHINE_REL_RELATIVE 1 + static inline void elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc, Elf64_Addr *const reloc_addr) Jakub From drepper@redhat.com Wed Apr 3 18:30:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 03 Apr 2002 18:30:00 -0000 Subject: multiple definition of `__malloc_initialize_hook' In-Reply-To: References: Message-ID: <1017887397.26729.103.camel@akkadia.org> On Mon, 2002-04-01 at 07:56, Andreas Jaeger wrote: > How can we fix this? I've checked in a patch. The problem was that weak_variable was assumed to be defined by the glibc headers which isn't the case. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From davidm@napali.hpl.hp.com Wed Apr 3 20:04:00 2002 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Wed, 03 Apr 2002 20:04:00 -0000 Subject: libc build problem Message-ID: <200204040404.g3444rcu015341@napali.hpl.hp.com> Is the current libc CVS tree supposed to build on ia64 linux? I'm getting: gcc -nostdlib -nostartfiles -r -o /usr/src/misc/libc-build/elf/librtld.os '-Wl,-(' /usr/src/misc/libc-build/elf/dl-allobjs.os /usr/src/misc/libc-build/libc_pic.a -lgcc '-Wl,-)' /usr/src/misc/libc-build/libc_pic.a(brk.os): In function `brk': brk.os(.text+0x0): multiple definition of `__brk' /usr/src/misc/libc-build/elf/dl-allobjs.os(.text+0x1d1b0): first defined here /opt/gcc3.1/lib/gcc-lib/ia64-hp-linux/3.1/../../../../ia64-hp-linux/bin/ld: Warning: size of symbol `__brk' changed from 80 to 48 in /usr/src/misc/libc-build/libc_pic.a(brk.os) collect2: ld returned 1 exit status make[2]: *** [/usr/src/misc/libc-build/elf/librtld.os] Error 1 make[2]: Leaving directory `/data1/src/misc/libc/elf' make[1]: *** [elf/subdir_lib] Error 2 make[1]: Leaving directory `/data1/src/misc/libc' make: *** [all] Error 2 At first I thought it's due to an old binutils, but the above error also occurs with the latest binutils + gcc3.1. --david From drepper@redhat.com Wed Apr 3 20:13:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 03 Apr 2002 20:13:00 -0000 Subject: libc build problem In-Reply-To: <200204040404.g3444rcu015341@napali.hpl.hp.com> References: <200204040404.g3444rcu015341@napali.hpl.hp.com> Message-ID: <1017893624.26458.105.camel@akkadia.org> On Wed, 2002-04-03 at 20:04, David Mosberger wrote: > Is the current libc CVS tree supposed to build on ia64 linux? I'm getting: Known problem. Will be fixed soon. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From davidm@napali.hpl.hp.com Wed Apr 3 20:37:00 2002 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Wed, 03 Apr 2002 20:37:00 -0000 Subject: unwind info for sysdeps/ia64/dl-machine.h Message-ID: Here is a patch to add unwind info for sysdeps/ia64/dl-machine.h. Since I can't build glibc at the moment, this is untested. However, I did inspect the directives and code with readelf -u/objdump -d and the results look sane. The patch also fixes a RAW dependency violation. --david ChangeLog 2002-04-03 David Mosberger * sysdeps/ia64/dl-machine.h (TRAMPOLINE_TEMPLATE): Add unwind info. (RTLD_START): Ditto. (__ia64_init_bootstrap_fdesc_table): Insert stop bit to avoid RAW dependency violation. Index: sysdeps/ia64/dl-machine.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/ia64/dl-machine.h,v retrieving revision 1.18 diff -u -r1.18 dl-machine.h --- sysdeps/ia64/dl-machine.h 2002/02/28 22:36:27 1.18 +++ sysdeps/ia64/dl-machine.h 2002/04/04 04:33:32 @@ -61,7 +61,7 @@ Elf64_Addr *boot_table; /* careful: this will be called before got has been relocated... */ - asm ("addl %0 = @gprel (__ia64_boot_fptr_table), gp" : "=r"(boot_table)); + asm (";; addl %0 = @gprel (__ia64_boot_fptr_table), gp" : "=r"(boot_table)); map->l_mach.fptr_table_len = IA64_BOOT_FPTR_TABLE_LEN; map->l_mach.fptr_table = boot_table; @@ -179,13 +179,18 @@ " .proc " #tramp_name "#\n" \ #tramp_name ":\n" \ " { .mmi\n" \ +" .prologue\n" \ +" .save ar.pfs, r40\n" \ " alloc loc0 = ar.pfs, 8, 6, 3, 0\n" \ " adds r2 = -144, r12\n" \ " adds r3 = -128, r12\n" \ " }\n" \ " { .mii\n" \ +" .fframe 160\n" \ " adds r12 = -160, r12\n" \ +" .save rp, r41\n" \ " mov loc1 = b0\n" \ +" .body\n" \ " mov out2 = b0 /* needed by fixup_profile */\n" \ " ;;\n" \ " }\n" \ @@ -249,6 +254,7 @@ " { .mmi\n" \ " ldf.fill f14 = [r2], 32\n" \ " ldf.fill f15 = [r3], 32\n" \ +" .restore sp /* pop the unwind frame state */\n" \ " adds r12 = 160, r12\n" \ " ;;\n" \ " }\n" \ @@ -265,6 +271,8 @@ " /* An alloc is needed for the break system call to work.\n" \ " We don't care about the old value of the pfs register. */\n" \ " { .mmb\n" \ +" .prologue\n" \ +" .body\n" \ " alloc r2 = ar.pfs, 0, 0, 8, 0\n" \ " br.sptk.many b6\n" \ " ;;\n" \ @@ -292,7 +300,11 @@ " .proc _start#\n" \ "_start:\n" \ "0: { .mii\n" \ +" .prologue\n" \ +" .save ar.pfs, r32\n" \ +" .save rp, r0\n" \ " alloc loc0 = ar.pfs, 0, 3, 4, 0\n" \ +" .body\n" \ " mov r2 = ip\n" \ " addl r3 = @gprel(0b), r0\n" \ " ;;\n" \ @@ -319,6 +331,10 @@ " .global _dl_start_user#\n" \ " .proc _dl_start_user#\n" \ "_dl_start_user:\n" \ +" .prologue\n" \ +" .save ar.pfs, r32\n" \ +" .save rp, r0\n" \ +" .body\n" \ " { .mii\n" \ " /* Save the pointer to the user entry point fptr in loc2. */\n" \ " mov loc2 = ret0\n" \ From jakub@redhat.com Fri Apr 5 04:36:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 05 Apr 2002 04:36:00 -0000 Subject: [PATCH] Fix mktime Message-ID: <20020405143604.O32482@sunsite.ms.mff.cuni.cz> Hi! ISO C99ism which older GCCs (< 3.0, or < 3.1?) don't cope with: 2002-04-05 Jakub Jelinek * time/mktime.c (__mktime_internal): Move check for year < 70 below all variable declarations. --- libc/time/mktime.c.jj Fri Apr 5 14:34:22 2002 +++ libc/time/mktime.c Fri Apr 5 14:36:38 2002 @@ -246,10 +246,6 @@ __mktime_internal (struct tm *tp, int mon_years = mon / 12 - negative_mon_remainder; int year = year_requested + mon_years; - /* Only years after 1970 are defined. */ - if (year < 70) - return -1; - /* The other values need not be in range: the remaining code handles minor overflows correctly, assuming int and time_t arithmetic wraps around. @@ -271,6 +267,10 @@ __mktime_internal (struct tm *tp, sec = 59; #endif + /* Only years after 1970 are defined. */ + if (year < 70) + return -1; + /* Invert CONVERT by probing. First assume the same offset as last time. Then repeatedly use the error to improve the guess. */ Jakub From drepper@redhat.com Fri Apr 5 08:45:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 05 Apr 2002 08:45:00 -0000 Subject: [PATCH] Fix mktime In-Reply-To: <20020405143604.O32482@sunsite.ms.mff.cuni.cz> References: <20020405143604.O32482@sunsite.ms.mff.cuni.cz> Message-ID: <1018025114.26729.208.camel@akkadia.org> On Fri, 2002-04-05 at 04:36, Jakub Jelinek wrote: > 2002-04-05 Jakub Jelinek > > * time/mktime.c (__mktime_internal): Move check for year < 70 below > all variable declarations. I've applied the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From jakub@redhat.com Fri Apr 5 09:01:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 05 Apr 2002 09:01:00 -0000 Subject: [PATCH] Fix ms_MY typo Message-ID: <20020405190057.P32482@sunsite.ms.mff.cuni.cz> Hi! Here is a typo fix for ms_MY. Besides this, I'm still seeing lots of warnings/errors on current locales: - ar_SD, be_BY, es_EC, sr_YU don't have int_curr_symbol following ISO 4217, unfortunately I have really now idea what the monetary symbols really should be (e.g. whether Sudan uses Dinars or Pounds, found both in google). - nl_BE/oc_FR LC_MONETARY: unknown character in field `currency_symbol' Really don't know what's going on here and why is not transliterated, it works e.g. for plain fr_BE and fr_FR which these two include - sr_YU@cyrillic: cannot add already read locale `sr_YU' a second time sr_YU works just fine, this one is just copy "sr_YU" most of the time - pt_PT, wa_BE: circular dependencies between locale definitions - sv_FI: lots of errors, while fi_FI works just fine and sv_FI mostly includes it Any ideas? 2002-04-05 Jakub Jelinek * locales/ms_MY (day): Fix a typo. --- libc/localedata/locales/ms_MY.jj Mon Dec 10 19:16:14 2001 +++ libc/localedata/locales/ms_MY Fri Apr 5 18:04:58 2002 @@ -97,7 +97,7 @@ abday "";"";"";/ - "";"";"";/ "";"";/ "" % Jakub From jakub@redhat.com Fri Apr 5 13:26:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 05 Apr 2002 13:26:00 -0000 Subject: [PATCH] pthread_mutexattr_*{kind_np,type} in man pages Message-ID: <20020405232634.Q32482@sunsite.ms.mff.cuni.cz> Hi! As pthread_mutexattr_?etkind_np are deprecated, it should be said in the man pages. 2002-04-05 Jakub Jelinek * man/pthread_mutexattr_init.man (pthread_mutexattr_settype): Document instead of pthread_mutexattr_setkind_np. (pthread_mutexattr_gettype): Similarly. * man/pthread_mutexattr_setkind_np.man: New. * man/Makefile (SOURCES): Add pthread_mutexattr_setkind_np.man. --- libc/linuxthreads/man/pthread_mutexattr_init.man.jj Wed Mar 11 13:42:23 1998 +++ libc/linuxthreads/man/pthread_mutexattr_init.man Fri Apr 5 23:24:24 2002 @@ -1,11 +1,11 @@ .TH PTHREAD_MUTEXATTR 3 LinuxThreads .XREF pthread_mutexattr_destroy -.XREF pthread_mutexattr_setkind_np -.XREF pthread_mutexattr_getkind_np +.XREF pthread_mutexattr_settype +.XREF pthread_mutexattr_gettype .SH NAME -pthread_mutexattr_init, pthread_mutexattr_destroy, pthread_mutexattr_setkind_np, pthread_mutexattr_getkind_np \- mutex creation attributes +pthread_mutexattr_init, pthread_mutexattr_destroy, pthread_mutexattr_settype, pthread_mutexattr_gettype \- mutex creation attributes .SH SYNOPSIS #include @@ -14,9 +14,9 @@ int pthread_mutexattr_init(pthread_mutex int pthread_mutexattr_destroy(pthread_mutexattr_t *attr); -int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind); +int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind); -int pthread_mutexattr_getkind_np(const pthread_mutexattr_t *attr, int *kind); +int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *kind); .SH DESCRIPTION @@ -53,23 +53,23 @@ returns to the unlocked state. The default mutex kind is ``fast'', that is, !PTHREAD_MUTEX_FAST_NP!. -!pthread_mutexattr_setkind_np! sets the mutex kind attribute in |attr| +!pthread_mutexattr_settype! sets the mutex kind attribute in |attr| to the value specified by |kind|. -!pthread_mutexattr_getkind_np! retrieves the current value of the +!pthread_mutexattr_gettype! retrieves the current value of the mutex kind attribute in |attr| and stores it in the location pointed to by |kind|. .SH "RETURN VALUE" !pthread_mutexattr_init!, !pthread_mutexattr_destroy! and -!pthread_mutexattr_getkind_np! always return 0. +!pthread_mutexattr_gettype! always return 0. -!pthread_mutexattr_setkind_np! returns 0 on success and a non-zero +!pthread_mutexattr_settype! returns 0 on success and a non-zero error code on error. .SH ERRORS -On error, !pthread_mutexattr_setkind_np! returns the following error code: +On error, !pthread_mutexattr_settype! returns the following error code: .TP !EINVAL! |kind| is neither !PTHREAD_MUTEX_FAST_NP! nor !PTHREAD_MUTEX_RECURSIVE_NP! --- libc/linuxthreads/man/pthread_mutexattr_setkind_np.man.jj Fri Apr 5 23:24:42 2002 +++ libc/linuxthreads/man/pthread_mutexattr_setkind_np.man Fri Apr 5 23:27:56 2002 @@ -0,0 +1,39 @@ +.TH PTHREAD_MUTEXATTR_SETKIND_NP 3 LinuxThreads + +.XREF pthread_mutexattr_getkind_np + +.SH NAME +pthread_mutexattr_setkind_np, pthread_mutexattr_getkind_np \- deprecated mutex creation attributes + +.SH SYNOPSIS +#include + +int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind); + +int pthread_mutexattr_getkind_np(const pthread_mutexattr_t *attr, int *kind); + +.SH DESCRIPTION + +These functions are deprecated, use !pthread_mutexattr_settype!(3) +and !pthread_mutexattr_gettype!(3) instead. + +.SH "RETURN VALUE" +!pthread_mutexattr_getkind_np! always returns 0. + +!pthread_mutexattr_setkind_np! returns 0 on success and a non-zero +error code on error. + +.SH ERRORS + +On error, !pthread_mutexattr_setkind_np! returns the following error code: +.TP +!EINVAL! +|kind| is neither !PTHREAD_MUTEX_FAST_NP! nor !PTHREAD_MUTEX_RECURSIVE_NP! +nor !PTHREAD_MUTEX_ERRORCHECK_NP! + +.SH AUTHOR +Xavier Leroy + +.SH "SEE ALSO" +!pthread_mutexattr_settype!(3), +!pthread_mutexattr_gettype!(3). --- libc/linuxthreads/man/Makefile.jj Wed Mar 11 13:42:23 1998 +++ libc/linuxthreads/man/Makefile Fri Apr 5 23:28:47 2002 @@ -5,7 +5,7 @@ SOURCES=pthread_atfork.man pthread_attr_ pthread_key_create.man pthread_mutex_init.man \ pthread_mutexattr_init.man pthread_once.man pthread_self.man \ pthread_setschedparam.man pthread_sigmask.man sem_init.man \ - pthread_kill_other_threads_np.man + pthread_kill_other_threads_np.man pthread_mutexattr_setkind_np.man MANPAGES=$(SOURCES:.man=.3thr) Jakub From drepper@redhat.com Fri Apr 5 15:28:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 05 Apr 2002 15:28:00 -0000 Subject: unwind info for sysdeps/ia64/dl-machine.h In-Reply-To: References: Message-ID: <1018049296.26458.243.camel@akkadia.org> On Wed, 2002-04-03 at 20:37, David Mosberger wrote: > 2002-04-03 David Mosberger > > * sysdeps/ia64/dl-machine.h (TRAMPOLINE_TEMPLATE): Add unwind info. > (RTLD_START): Ditto. > (__ia64_init_bootstrap_fdesc_table): Insert stop bit to avoid RAW > dependency violation. I've applied this patch now. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From drepper@redhat.com Fri Apr 5 16:33:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 05 Apr 2002 16:33:00 -0000 Subject: [PATCH] Skip DT_RELACOUNT relocs on ia-64/alpha if l_addr == 0 In-Reply-To: <20020403230906.H32482@sunsite.ms.mff.cuni.cz> References: <20020403230906.H32482@sunsite.ms.mff.cuni.cz> Message-ID: <1018053199.26458.245.camel@akkadia.org> On Wed, 2002-04-03 at 13:09, Jakub Jelinek wrote: > As both alpha and ia64 never use addend when relocating relative relocs > (ie. they do M += L) and as prelink -r libc.so.6 saved 15% startup time > on IA-32 for programs using solely -lc, I think this patch might be useful > for IA-64 and Alpha. Looks OK, I've applied it. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From drepper@redhat.com Fri Apr 5 17:07:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 05 Apr 2002 17:07:00 -0000 Subject: [PATCH] pthread_mutexattr_*{kind_np,type} in man pages In-Reply-To: <20020405232634.Q32482@sunsite.ms.mff.cuni.cz> References: <20020405232634.Q32482@sunsite.ms.mff.cuni.cz> Message-ID: <1018055217.26458.249.camel@akkadia.org> On Fri, 2002-04-05 at 13:26, Jakub Jelinek wrote: > As pthread_mutexattr_?etkind_np are deprecated, it should be said > in the man pages. I've applied the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From drepper@redhat.com Fri Apr 5 17:08:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 05 Apr 2002 17:08:00 -0000 Subject: [PATCH] Fix ms_MY typo In-Reply-To: <20020405190057.P32482@sunsite.ms.mff.cuni.cz> References: <20020405190057.P32482@sunsite.ms.mff.cuni.cz> Message-ID: <1018055290.26458.252.camel@akkadia.org> On Fri, 2002-04-05 at 09:00, Jakub Jelinek wrote: > Here is a typo fix for ms_MY. Thanks, I've applied it. > Any ideas [about the other errors] ? No. I don't want to put any wrong information in there so we should just leave it as it is. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From drepper@redhat.com Fri Apr 5 17:13:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 05 Apr 2002 17:13:00 -0000 Subject: make install-headers missing files In-Reply-To: References: Message-ID: <1018055602.26458.254.camel@akkadia.org> On Wed, 2002-04-03 at 07:32, Andreas Schwab wrote: > When doing make install-headers some headers are not installed. > gnu/stubs.h is still not installed since that depends on a full library > build, but for bootstrapping purpose an empty file will do. I cannot see anything obviously wrong with the patch and I assume you've tested it. If something break we know who to blame :-). Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From drepper@redhat.com Fri Apr 5 17:35:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 05 Apr 2002 17:35:00 -0000 Subject: [PATCH] dl-*brk.c breakage (take 2) In-Reply-To: <20020323234034.R32482@sunsite.ms.mff.cuni.cz> References: <20020323232732.Q32482@sunsite.ms.mff.cuni.cz> <20020323234034.R32482@sunsite.ms.mff.cuni.cz> Message-ID: <1018056939.26458.256.camel@akkadia.org> On Sat, 2002-03-23 at 14:40, Jakub Jelinek wrote: > Here is the second alternative. I've finally decided to go with the second variant. The problem is not restricted to Linux so the first patch isn't OK. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From drepper@redhat.com Fri Apr 5 21:10:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 05 Apr 2002 21:10:00 -0000 Subject: framestate.c vs --enable-oldest-abi=2.2.5 In-Reply-To: <20020321002758.6ADD01BA02@perdition.linnaean.org> References: <20020321002758.6ADD01BA02@perdition.linnaean.org> Message-ID: <1018069407.26458.264.camel@akkadia.org> On Wed, 2002-03-20 at 16:27, Roland McGrath wrote: > 2002-03-20 Roland McGrath > > * sysdeps/generic/framestate.c [EXPORT_UNWIND_FIND_FDE]: > Conditionalize contents on this. What was the outcome of the discussion of this patch? -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From roland@frob.com Fri Apr 5 21:15:00 2002 From: roland@frob.com (Roland McGrath) Date: Fri, 05 Apr 2002 21:15:00 -0000 Subject: framestate.c vs --enable-oldest-abi=2.2.5 In-Reply-To: Ulrich Drepper's message of , 5 April 2002 21:03:24 -0800 <1018069407.26458.264.camel@akkadia.org> Message-ID: <20020406051506.EC3111BA1A@perdition.linnaean.org> > On Wed, 2002-03-20 at 16:27, Roland McGrath wrote: > > > 2002-03-20 Roland McGrath > > > > * sysdeps/generic/framestate.c [EXPORT_UNWIND_FIND_FDE]: > > Conditionalize contents on this. > > What was the outcome of the discussion of this patch? That was superceded by the makefile changes with log entry dated 2002-03-23. From aj@suse.de Sun Apr 7 03:24:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Sun, 07 Apr 2002 03:24:00 -0000 Subject: asm constraints on i686-linux and GCC 3.2 CVS Message-ID: Richard, I guess your recent changes to GCC mainline CVS introduced a number of problems while compiling inline asms in glibc CVS on i686-linux-gnu. I get this failure: spinlock.c: In function `__pthread_lock': spinlock.c:113: inconsistent operand constraints in an `asm' The line is: __asm __volatile ("" : "=m" (lock->__status) : "0" (lock->__status)); and lots of warnings like: ../sysdeps/i386/i486/atomicity.h:31: warning: asm operand 1 probably doesn't match constraints ../sysdeps/i386/i486/atomicity.h:31: warning: asm operand 3 probably doesn't match constraints ../sysdeps/i386/i486/atomicity.h:40: warning: asm operand 0 probably doesn't match constraints ../sysdeps/i386/i486/atomicity.h:40: warning: asm operand 2 probably doesn't match constraints ../sysdeps/i386/i486/atomicity.h:51: warning: asm operand 1 probably doesn't match constraints ../sysdeps/i386/i486/atomicity.h:51: warning: asm operand 4 probably doesn't match constraints where the asms are: __asm__ __volatile__ ("lock; xaddl %0,%1" : "=r" (result), "=m" (*mem) : "0" (val), "1" (*mem)); __asm__ __volatile__ ("lock; addl %1,%0" : "=m" (*mem) : "ir" (val), "0" (*mem)); __asm__ __volatile__ ("lock; cmpxchgl %3, %1; sete %0" : "=q" (ret), "=m" (*p), "=a" (readval) : "r" (newval), "1" (*p), "a" (oldval)); ../sysdeps/i386/fpu/bits/mathinline.h:492: warning: asm operand 0 probably doesn't match constraints ../sysdeps/i386/fpu/bits/mathinline.h:503: warning: asm operand 0 probably doesn't match constraints with these lines: __inline_mathcodeNP (floor, __x, \ register long double __value; \ __volatile unsigned short int __cw; \ __volatile unsigned short int __cwtmp; \ __asm __volatile ("fnstcw %0" : "=m" (__cw)); \ __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */ \ __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); \ __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); \ __asm __volatile ("fldcw %0" : : "m" (__cw)); \ return __value) __inline_mathcodeNP (ceil, __x, \ register long double __value; \ __volatile unsigned short int __cw; \ __volatile unsigned short int __cwtmp; \ __asm __volatile ("fnstcw %0" : "=m" (__cw)); \ __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */ \ __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); \ __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); \ __asm __volatile ("fldcw %0" : : "m" (__cw)); \ return __value) What's wrong here and how can this get fixed? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From roland@frob.com Sun Apr 7 13:52:00 2002 From: roland@frob.com (Roland McGrath) Date: Sun, 07 Apr 2002 13:52:00 -0000 Subject: asm constraints on i686-linux and GCC 3.2 CVS In-Reply-To: Andreas Jaeger's message of Sun, 7 April 2002 12:24:38 +0200 Message-ID: <20020407205220.BB37D1BA1C@perdition.linnaean.org> I have been seeing that for the Alpha target too. From kkojima@rr.iij4u.or.jp Sun Apr 7 17:13:00 2002 From: kkojima@rr.iij4u.or.jp (kaz Kojima) Date: Sun, 07 Apr 2002 17:13:00 -0000 Subject: TLS support for SH Message-ID: <200204080013.g380DJA22075@r-rr.iij4u.or.jp> Hi, Sorry, this is a report rather than a patch, though it looks like so. I've tried the TLS support for SH. Now it passes all TLS tests in elf directory. I wrote a small text for the experimental TLS ABI for SH as http://www.rr.iij4u.or.jp/~kkojima/tls-sh-memo.txt and put the binutils part (not yet posted) http://www.rr.iij4u.or.jp/~kkojima/src-tls-sh-020407.diff which is a diff for the recent CVS + Jakub's TLS patch: http://sources.redhat.com/ml/binutils/2002-02/msg00410.html Any suggestions would be helpful. BTW, I use the variant II and found a few typos in generic code. Please see the patch for elf/rtld.c and sysdeps/generic/dl-tls.c. Regards, kaz -- * elf/elf.h : Define R_SH_TLS_xxx macros. * elf/rtld.c: Replace #if with #ifdef. Remove an extra parenthesis. * elf/tls-macros.h: Define SH version TLS_LE, TLS_IE, TLS_LD and TLS_GD macros. * linuxthreads/sysdeps/sh/pt-machine.h: Define _PT_MACHINE_H if it isn't defined yet. (FLOATING_STACKS, EARCH_STACK_MAX_SIZE): Defined. (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC): Likewise. * sysdeps/generic/dl-tls.c: Add a missing semi-colon. * sysdeps/sh/dl-lookupcfg.h: New file. * sysdeps/sh/dl-tls.h: Likewise. * linuxthreads/sysdeps/sh/tls.h: Likewise. * sysdeps/sh/dl-machine.h (elf_machine_type_class): Set ELF_RTYPE_CLASS_PLT also for the three TLS relocations. (elf_machine_rela): Handle R_SH_TLS_DTPMOD32, R_SH_TLS_DTPOFF32 and R_SH_TLS_TPOFF32 relocations. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.#* --exclude=*.texi libc-orig/elf/elf.h libc/elf/elf.h --- libc-orig/elf/elf.h Sat Mar 2 18:01:36 2002 +++ libc/elf/elf.h Thu Apr 4 11:26:57 2002 @@ -2123,6 +2123,21 @@ #define R_SH_SWITCH8 33 #define R_SH_GNU_VTINHERIT 34 #define R_SH_GNU_VTENTRY 35 +#define R_SH_TLS_GD_32 128 +#define R_SH_TLS_LD_32 129 +#define R_SH_TLS_LDO_32 130 +#define R_SH_TLS_IE_32 131 +#define R_SH_TLS_LE_32 132 +#define R_SH_TLS_DTPMOD32 133 +#define R_SH_TLS_DTPOFF32 134 +#define R_SH_TLS_TPOFF32 135 +#define R_SH_TLS_GD_MOV 136 +#define R_SH_TLS_GD_CALLMOV 137 +#define R_SH_TLS_LDM_MOV 138 +#define R_SH_TLS_LDO_MOV 139 +#define R_SH_TLS_LD_CALLMOV 140 +#define R_SH_TLS_IE_MOV 141 +#define R_SH_TLS_LE_MOV 142 #define R_SH_GOT32 160 #define R_SH_PLT32 161 #define R_SH_COPY 162 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.#* --exclude=*.texi libc-orig/elf/rtld.c libc/elf/rtld.c --- libc-orig/elf/rtld.c Fri Mar 15 14:14:54 2002 +++ libc/elf/rtld.c Wed Apr 3 13:00:49 2002 @@ -252,7 +252,7 @@ HP_TIMING_NOW (GL(dl_cpuclock_offset)); #endif -#if USE_TLS +#ifdef USE_TLS /* Get the dynamic linkers program header. */ ehdr = (ElfW(Ehdr) *) GL(dl_rtld_map).l_map_start; phdr = (ElfW(Phdr) *) (GL(dl_rtld_map).l_map_start + ehdr->e_phoff); @@ -303,7 +303,7 @@ # elif TLS_DTV_AT_TP GL(dl_rtld_map).l_tls_offset = roundup (TLS_INIT_TCB_SIZE, GL(dl_rtld_map).l_tls_align); - initdtv[2].pointer = (char *) tlsblock + GL(dl_rtld_map).l_tls_offset); + initdtv[2].pointer = (char *) tlsblock + GL(dl_rtld_map).l_tls_offset; # else # error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined" # endif diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.#* --exclude=*.texi libc-orig/elf/tls-macros.h libc/elf/tls-macros.h --- libc-orig/elf/tls-macros.h Wed Feb 13 16:37:05 2002 +++ libc/elf/tls-macros.h Thu Apr 4 10:51:57 2002 @@ -95,6 +95,84 @@ __l; }) # endif +#elif defined __sh__ +# define TLS_LE(x) \ + ({ int *__l; void *__tp; \ + asm ("stc gbr,%1\n\t" \ + "mov.l 1f,%0\n\t" \ + "bra 2f\n\t" \ + " add %1,%0\n\t" \ + ".align 2\n\t" \ + "1: .long " #x "@tpoff\n\t" \ + "2:" \ + : "=r" (__l), "=r" (__tp)); \ + __l; }) + +# define TLS_IE(x) \ + ({ int *__l; void *__tp; \ + asm ("mova 0f,r0\n\t" \ + "mov.l 0f,r12\n\t" \ + "add r0,r12\n\t" \ + "mov.l 1f,r0\n\t" \ + "stc gbr,%1\n\t" \ + "mov.l @(r0,r12),%0\n\t" \ + "bra 2f\n\t" \ + " add %1,%0\n\t" \ + ".align 2\n\t" \ + "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \ + "1: .long " #x "@gottpoff\n\t" \ + "2:" \ + : "=r" (__l), "=r" (__tp) : : "r0", "r12"); \ + __l; }) + +# define TLS_LD(x) \ + ({ int *__l; \ + asm ("mova 0f,r0\n\t" \ + "mov.l 0f,r12\n\t" \ + "add r0,r12\n\t" \ + "mov.l 1f,r4\n\t" \ + "add r12,r4\n\t" \ + "mova 2f,r0\n\t" \ + "mov.l 2f,r1\n\t" \ + "add r0,r1\n\t" \ + "jsr @r1\n\t" \ + " nop\n\t" \ + "mov.l 3f,%0\n\t" \ + "bra 4f\n\t" \ + " add r0,%0\n\t" \ + ".align 2\n\t" \ + "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \ + "1: .long " #x "@tlsldm\n\t" \ + "2: .long __tls_get_addr@plt\n\t" \ + "3: .long " #x "@dtpoff\n\t" \ + "4:" \ + : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ + "r12", "pr", "t"); \ + __l; }) + +# define TLS_GD(x) \ + ({ int *__l; \ + asm ("mova 0f,r0\n\t" \ + "mov.l 0f,r12\n\t" \ + "add r0,r12\n\t" \ + "mov.l 1f,r4\n\t" \ + "add r12,r4\n\t" \ + "mova 2f,r0\n\t" \ + "mov.l 2f,r1\n\t" \ + "add r0,r1\n\t" \ + "jsr @r1\n\t" \ + " nop\n\t" \ + "bra 3f\n\t" \ + " mov r0,%0\n\t" \ + ".align 2\n\t" \ + "0: .long _GLOBAL_OFFSET_TABLE_\n\t" \ + "1: .long " #x "@tlsgd\n\t" \ + "2: .long __tls_get_addr@plt\n\t" \ + "3:" \ + : "=r" (__l) : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ + "r12", "pr", "t"); \ + __l; }) + #else # error "No support for this architecture so far." #endif diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.#* --exclude=*.texi libc-orig/linuxthreads/sysdeps/sh/pt-machine.h libc/linuxthreads/sysdeps/sh/pt-machine.h --- libc-orig/linuxthreads/sysdeps/sh/pt-machine.h Sun Mar 17 21:10:01 2002 +++ libc/linuxthreads/sysdeps/sh/pt-machine.h Sat Mar 23 14:09:27 2002 @@ -19,6 +19,9 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _PT_MACHINE_H +#define _PT_MACHINE_H 1 + #ifndef PT_EI # define PT_EI extern inline #endif @@ -42,6 +45,11 @@ return (ret == 0); } +/* We want the OS to assign stack addresses. */ +#define FLOATING_STACKS 1 + +/* Maximum size of the stack if the rlimit is unlimited. */ +#define ARCH_STACK_MAX_SIZE 32*1024*1024 /* Get some notion of the current stack. Need not be exactly the top of the stack, just something somewhere in the current frame. */ @@ -57,3 +65,11 @@ /* Initialize the thread-unique value. */ #define INIT_THREAD_SELF(descr, nr) \ ({ __asm__ __volatile__("ldc %0,gbr" : : "r" (descr));}) + +/* Access to data in the thread descriptor is easy. */ +#define THREAD_GETMEM(descr, member) THREAD_SELF->member +#define THREAD_GETMEM_NC(descr, member) THREAD_SELF->member +#define THREAD_SETMEM(descr, member, value) THREAD_SELF->member = (value) +#define THREAD_SETMEM_NC(descr, member, value) THREAD_SELF->member = (value) + +#endif /* pt-machine.h */ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.#* --exclude=*.texi libc-orig/linuxthreads/sysdeps/sh/tls.h libc/linuxthreads/sysdeps/sh/tls.h --- libc-orig/linuxthreads/sysdeps/sh/tls.h Thu Jan 1 09:00:00 1970 +++ libc/linuxthreads/sysdeps/sh/tls.h Tue Apr 2 09:58:10 2002 @@ -0,0 +1,111 @@ +/* Definition for thread-local data handling. linuxthreads/SH version. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _TLS_H +#define _TLS_H + +#include + +#include + +/* Type for the dtv. */ +typedef union dtv +{ + size_t counter; + void *pointer; +} dtv_t; + + +typedef struct +{ + void *tcb; /* Pointer to the TCB. Not necessary the + thread descriptor used by libpthread. */ + dtv_t *dtv; + void *self; /* Pointer to the thread descriptor. */ +} tcbhead_t; + + +/* We can support TLS only if the floating-stack support is available. */ +#if defined FLOATING_STACKS && defined HAVE_TLS_SUPPORT + +/* Get system call information. */ +# include + +/* Signal that TLS support is available. */ +# define USE_TLS 1 + + +/* Get the thread descriptor definition. */ +# include + +/* This is the size of the initial TCB. */ +# define TLS_INIT_TCB_SIZE sizeof (tcbhead_t) + +/* Alignment requirements for the initial TCB. */ +# define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) + +/* This is the size of the TCB. */ +# define TLS_TCB_SIZE sizeof (struct _pthread_descr_struct) + +/* Alignment requirements for the TCB. */ +# define TLS_TCB_ALIGN __alignof__ (struct _pthread_descr_struct) + +/* The TLS blocks start right after the TCB. */ +# define TLS_DTV_AT_TP 1 + + +/* Install the dtv pointer. The pointer passed is to the element with + index -1 which contain the length. */ +# define INSTALL_DTV(descr, dtvp) \ + ((tcbhead_t *) descr)->dtv = dtvp + 1 + +/* Install new dtv for current thread. */ +# define INSTALL_NEW_DTV(dtv) \ + ({ struct _pthread_descr_struct *__descr; \ + THREAD_SETMEM (__descr, p_header.data.dtvp, dtv); }) + +/* Return dtv of given thread descriptor. */ +# define GET_DTV(descr) \ + (((tcbhead_t *) descr)->dtv) + +/* Code to initially initialize the thread pointer. This might need + special attention since 'errno' is not yet available and if the + operation can cause a failure 'errno' must not be touched. */ +# define TLS_INIT_TP(descr) \ + do { \ + void *_descr = (descr); \ + int result; \ + tcbhead_t *head = _descr; \ + \ + head->tcb = _descr; \ + /* For now the thread descriptor isat the same address. */ \ + head->self = _descr; \ + \ + asm ("ldc %0,gbr" : : "r" (_descr)); \ + } while (0) + + +/* Return the address of the dtv for the current thread. */ +# define THREAD_DTV() \ + ({ struct _pthread_descr_struct *__descr; \ + THREAD_GETMEM (__descr, p_header.data.dtvp); }) + +#endif /* FLOATING_STACKS && HAVE_TLS_SUPPORT */ + +#endif /* tls.h */ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.#* --exclude=*.texi libc-orig/sysdeps/generic/dl-tls.c libc/sysdeps/generic/dl-tls.c --- libc-orig/sysdeps/generic/dl-tls.c Sat Feb 23 16:56:54 2002 +++ libc/sysdeps/generic/dl-tls.c Mon Mar 25 21:44:32 2002 @@ -174,7 +174,7 @@ slotinfo = GL(dl_tls_dtv_slotinfo_list)->slotinfo; if (slotinfo[1].map != NULL) { - size_t prev_size + size_t prev_size; offset = roundup (offset, slotinfo[1].map->l_tls_align); slotinfo[1].map->l_tls_offset = offset; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.#* --exclude=*.texi libc-orig/sysdeps/sh/dl-lookupcfg.h libc/sysdeps/sh/dl-lookupcfg.h --- libc-orig/sysdeps/sh/dl-lookupcfg.h Thu Jan 1 09:00:00 1970 +++ libc/sysdeps/sh/dl-lookupcfg.h Wed Apr 3 11:47:27 2002 @@ -0,0 +1,28 @@ +/* Configuration of lookup functions. SH version. + Copyright (C) 2000, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include + +/* Some platforms need more information from the symbol lookup function + than just the address. For x86 we need it when we support TLS. */ +#ifdef USE_TLS +# define DL_LOOKUP_RETURNS_MAP +#else +# undef DL_LOOKUP_RETURNS_MAP +#endif diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.#* --exclude=*.texi libc-orig/sysdeps/sh/dl-machine.h libc/sysdeps/sh/dl-machine.h --- libc-orig/sysdeps/sh/dl-machine.h Fri Mar 1 18:43:37 2002 +++ libc/sysdeps/sh/dl-machine.h Sun Apr 7 14:27:33 2002 @@ -396,13 +396,22 @@ .previous\n\ "); -/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so - PLT entries should not be allowed to define the value. +/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or + TLS variable, so undefined references should not be allowed to + define the value. ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one of the main executable's symbols, as for a COPY reloc. */ +#ifdef USE_TLS +# define elf_machine_type_class(type) \ + ((((type) == R_SH_JMP_SLOT || (type) == R_SH_TLS_DTPMOD32 \ + || (type) == R_SH_TLS_DTPOFF32 || (type) == R_SH_TLS_TPOFF32) \ + * ELF_RTYPE_CLASS_PLT) \ + | (((type) == R_SH_COPY) * ELF_RTYPE_CLASS_COPY)) +#else #define elf_machine_type_class(type) \ ((((type) == R_SH_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ | (((type) == R_SH_COPY) * ELF_RTYPE_CLASS_COPY)) +#endif /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ #define ELF_MACHINE_JMP_SLOT R_SH_JMP_SLOT @@ -497,13 +506,21 @@ else { const Elf32_Sym *const refsym = sym; +#if defined USE_TLS && !defined RTLD_BOOTSTRAP + struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type); + + value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value; +#else - value = RESOLVE (&sym, version, ELF32_R_TYPE (reloc->r_info)); - if (sym) + value = RESOLVE (&sym, version, r_type); +# ifndef RTLD_BOOTSTRAP + if (sym != NULL) +# endif value += sym->st_value; +#endif value += reloc->r_addend; - switch (ELF32_R_TYPE (reloc->r_info)) + switch (r_type) { case R_SH_COPY: if (sym == NULL) @@ -529,6 +546,44 @@ /* These addresses are always aligned. */ *reloc_addr = value; break; +#ifdef USE_TLS + /* XXX Remove TLS relocations which are not needed. */ + case R_SH_TLS_DTPMOD32: +# ifdef RTLD_BOOTSTRAP + /* During startup the dynamic linker is always the module + with index 1. + XXX If this relocation is necessary move before RESOLVE + call. */ + *reloc_addr = 1; +# else + /* Get the information from the link map returned by the + resolv function. */ + if (sym_map != NULL) + *reloc_addr = sym_map->l_tls_modid; +# endif + break; + case R_SH_TLS_DTPOFF32: +# ifndef RTLD_BOOTSTRAP + /* During relocation all TLS symbols are defined and used. + Therefore the offset is already correct. */ + if (sym != NULL) + *reloc_addr = sym->st_value; +# endif + break; + case R_SH_TLS_TPOFF32: + /* The offset is positive, afterward from the thread pointer. */ +# ifdef RTLD_BOOTSTRAP + *reloc_addr = GL(dl_rtld_map).l_tls_offset + sym->st_value; +# else + /* We know the offset of object the symbol is contained is. + It is a positive value which will be added to the thread + pointer. To get the variable position in the TLS block + we add the offset from that of the TLS block. */ + if (sym_map != NULL && sym != NULL) + *reloc_addr = sym_map->l_tls_offset + sym->st_value; +# endif + break; +#endif /* use TLS */ case R_SH_DIR32: { #ifndef RTLD_BOOTSTRAP @@ -557,7 +612,7 @@ COPY_UNALIGNED_WORD (value, *reloc_addr, (int) reloc_addr & 3); break; default: - _dl_reloc_bad_type (map, ELF32_R_TYPE (reloc->r_info), 0); + _dl_reloc_bad_type (map, r_type, 0); break; } } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.#* --exclude=*.texi libc-orig/sysdeps/sh/dl-tls.h libc/sysdeps/sh/dl-tls.h --- libc-orig/sysdeps/sh/dl-tls.h Thu Jan 1 09:00:00 1970 +++ libc/sysdeps/sh/dl-tls.h Fri Mar 22 08:05:54 2002 @@ -0,0 +1,33 @@ +/* Thread-local storage handling in the ELF dynamic linker. SH version. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + + +/* Type used for the representation of TLS information in the GOT. */ +typedef struct +{ + unsigned long int ti_module; + unsigned long int ti_offset; +} tls_index; + + +#ifdef SHARED +/* This is the prototype for the GNU version. */ +extern void *__tls_get_addr (tls_index *ti) + __attribute__ ((__regparm__ (1))); +#endif From aj@suse.de Sun Apr 7 22:54:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Sun, 07 Apr 2002 22:54:00 -0000 Subject: asm constraints on i686-linux and GCC 3.2 CVS In-Reply-To: <20020407223650.B7063@redhat.com> (Richard Henderson's message of "Sun, 7 Apr 2002 22:36:50 -0700") References: <20020407223650.B7063@redhat.com> Message-ID: Richard Henderson writes: > On Sun, Apr 07, 2002 at 12:24:38PM +0200, Andreas Jaeger wrote: >> I guess your recent changes to GCC mainline CVS introduced a number of >> problems while compiling inline asms in glibc CVS on i686-linux-gnu. > > I don't know what the problem is off-hand. Probably some bit of > fragility that got pushed the other way. > > Maybe I'll get around to it this week, but I'll probably be focused > on getting 3.1 finalized. If it's causing actual failures, feel free > to back out my patch in the meantime. It is causing a failure. Which patch exactly should I try to back out? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Mon Apr 8 02:03:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 08 Apr 2002 02:03:00 -0000 Subject: more complex Makefiles Message-ID: <1018256449.26458.382.camel@akkadia.org> I've just checked in some patches which make the Makefiles even more complicated. One feature which was missing so far was the possibility to select code based on the library the code ends up in. This is normally no problem for normal code but it is a problem for headers. As an example you can see the change to include/libintl.h. It defines _() differently for code used in libc itself. With this change we hopefully can avoid most INTDEF/INTUSE changes. It should be possible to cover most cases with special macros in the header in the include/ subdir. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From jakub@redhat.com Mon Apr 8 06:24:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 08 Apr 2002 06:24:00 -0000 Subject: [PATCH] Fix debugging of threaded processes using trunk -lpthread Message-ID: <20020408152424.V32482@sunsite.ms.mff.cuni.cz> Hi! gdb was dying when debugging threaded apps: [New Thread 1024 (LWP 10933)] Searching for the number = 10933... [New Thread 2049 (LWP 10940)] Can't attach LWP 10940: Operation not permitted The problem is that thread manager segfaulted, thus task->mm in pthread_attach was NULL and kernel returned -EPERM. The reason for the segfault was that __pthread_manager_event passed a void * variable to INIT_THREAD_SELF and i386/useldt.h relied on it being pthread_descr type. Below is a fix, actually only one of the 2 patched files is enough to fix this (doesn't matter which one), but I think it won't hurt to change both places for robustness. 2002-04-08 Jakub Jelinek * manager.c (__pthread_manager_event): Use self instead of arg for INIT_THREAD_SELF. * sysdeps/i386/useldt.h (INIT_THREAD_SELF): Use sizeof (struct _pthread_descr_struct) instead of sizeof (*descr). --- libc/linuxthreads/manager.c.jj Thu Feb 28 12:31:50 2002 +++ libc/linuxthreads/manager.c Mon Apr 8 15:12:02 2002 @@ -244,15 +244,16 @@ __pthread_manager(void *arg) int __pthread_manager_event(void *arg) { + pthread_descr self = arg; /* If we have special thread_self processing, initialize it. */ #ifdef INIT_THREAD_SELF - INIT_THREAD_SELF(arg, 1); + INIT_THREAD_SELF(self, 1); #endif /* Get the lock the manager will free once all is correctly set up. */ - __pthread_lock (THREAD_GETMEM(((pthread_descr) arg), p_lock), NULL); + __pthread_lock (THREAD_GETMEM(self, p_lock), NULL); /* Free it immediately. */ - __pthread_unlock (THREAD_GETMEM(((pthread_descr) arg), p_lock)); + __pthread_unlock (THREAD_GETMEM(self, p_lock)); return __pthread_manager(arg); } --- libc/linuxthreads/sysdeps/i386/useldt.h.jj Mon Jul 23 10:35:31 2001 +++ libc/linuxthreads/sysdeps/i386/useldt.h Mon Apr 8 15:20:13 2002 @@ -64,7 +64,8 @@ extern int __modify_ldt (int, struct mod #define INIT_THREAD_SELF(descr, nr) \ { \ struct modify_ldt_ldt_s ldt_entry = \ - { nr, (unsigned long int) descr, sizeof (*descr), 1, 0, 0, 0, 0, 1, 0 }; \ + { nr, (unsigned long int) descr, sizeof (struct _pthread_descr_struct), \ + 1, 0, 0, 0, 0, 1, 0 }; \ if (__modify_ldt (1, &ldt_entry, sizeof (ldt_entry)) != 0) \ abort (); \ __asm__ __volatile__ ("movw %w0, %%gs" : : "q" (nr * 8 + 7)); \ Jakub From jakub@redhat.com Mon Apr 8 06:46:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 08 Apr 2002 06:46:00 -0000 Subject: [PATCH] Fix libSegFault.so Message-ID: <20020408154630.W32482@sunsite.ms.mff.cuni.cz> Hi! libSegFault.so is broken ATM, since it has unresolved SHN_UNDEF reference to _itoa_lower_digits_internal. These arrays are only defined in ld.so (16 chars) and libc (36 chars), not in libSegFault.so nor any other library. Thus IMHO _itoa.h should only use the internal definitions if in libc or ld.so. While at it, I think using IS_IN_RTLD instead of _RTLD_LOCAL would be good for consistency with your recent Makefile changes for other libs. 2002-04-08 Jakub Jelinek * elf/Makefile (CFLAGS-.os): Define NOT_IN_LIBC and IS_IN_RTLD instead of _RTLD_LOCAL. * elf/dl-dst.h: Use IS_IN_RTLD instead of _RTLD_LOCAL. * include/unistd.h: Likewise. * sysdeps/generic/ldsodefs.h: Likewise. * stdio-common/_itoa.h (_itoa_word): Only use internal digit arrays if in libc or ld.so. --- libc/elf/dl-dst.h.jj Sat Mar 23 11:50:26 2002 +++ libc/elf/dl-dst.h Mon Apr 8 15:44:17 2002 @@ -64,7 +64,7 @@ extern size_t _dl_dst_count_internal (co extern const char *_dl_get_origin (void); extern const char *_dl_get_origin_internal (void); -#ifdef _RTLD_LOCAL +#ifdef IS_IN_RTLD # define _dl_get_origin INTUSE(_dl_get_origin) #endif --- libc/elf/Makefile.jj Sat Mar 23 11:50:25 2002 +++ libc/elf/Makefile Mon Apr 8 15:47:21 2002 @@ -250,7 +250,7 @@ CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D' CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) CFLAGS-cache.c = $(SYSCONF-FLAGS) -CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-D_RTLD_LOCAL) +CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_LIBC -DIS_IN_RTLD) test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names)))) generated += $(addsuffix .so,$(strip $(modules-names))) --- libc/include/unistd.h.jj Sat Mar 23 11:50:27 2002 +++ libc/include/unistd.h Mon Apr 8 15:44:49 2002 @@ -98,7 +98,7 @@ extern void *__sbrk (intptr_t __delta); and some functions contained in the C library ignore various environment variables that normally affect them. */ extern int __libc_enable_secure; -#ifdef _RTLD_LOCAL +#ifdef IS_IN_RTLD /* XXX The #ifdef should go. */ extern int __libc_enable_secure_internal attribute_hidden; #endif --- libc/stdio-common/_itoa.h.jj Sat Mar 23 11:50:55 2002 +++ libc/stdio-common/_itoa.h Mon Apr 8 15:45:45 2002 @@ -39,8 +39,14 @@ _itoa_word (unsigned long value, char *b unsigned int base, int upper_case) { const char *digits = (upper_case +#if !defined NOT_IN_LIBC || defined IS_IN_RTLD ? INTUSE(_itoa_upper_digits) - : INTUSE(_itoa_lower_digits)); + : INTUSE(_itoa_lower_digits) +#else + ? _itoa_upper_digits + : _itoa_lower_digits +#endif + ); switch (base) { --- libc/sysdeps/generic/ldsodefs.h.jj Sat Mar 23 11:51:05 2002 +++ libc/sysdeps/generic/ldsodefs.h Mon Apr 8 15:46:54 2002 @@ -199,7 +199,7 @@ typedef void (*receiver_fct) (int, const # define GL(name) _##name #else # define EXTERN -# ifdef _RTLD_LOCAL +# ifdef IS_IN_RTLD # define GL(name) _rtld_local._##name # else # define GL(name) _rtld_global._##name @@ -375,7 +375,7 @@ struct rtld_global #ifdef SHARED }; extern struct rtld_global _rtld_global; -# ifdef _RTLD_LOCAL +# ifdef IS_IN_RTLD # ifdef HAVE_VISIBILITY_ATTRIBUTE # ifdef HAVE_SDATA_SECTION # define __rtld_local_attribute__ \ @@ -394,7 +394,7 @@ extern struct rtld_global _rtld_local __ /* Parameters passed to the dynamic linker. */ extern int _dl_argc attribute_hidden; extern char **_dl_argv; -#ifdef _RTLD_LOCAL +#ifdef IS_IN_RTLD extern char **_dl_argv_internal attribute_hidden; # define rtld_progname (INTUSE(_dl_argv)[0]) #else @@ -403,7 +403,7 @@ extern char **_dl_argv_internal attribut /* The array with message we print as a last resort. */ extern const char _dl_out_of_memory[]; -#ifdef _RTLD_LOCAL +#ifdef IS_IN_RTLD /* XXX #ifdef should go away. */ extern const char _dl_out_of_memory_internal[] attribute_hidden; #endif Jakub From aj@suse.de Mon Apr 8 06:56:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Mon, 08 Apr 2002 06:56:00 -0000 Subject: asm constraints on i686-linux and GCC 3.2 CVS In-Reply-To: <20020407225626.A7094@redhat.com> (Richard Henderson's message of "Sun, 7 Apr 2002 22:56:26 -0700") References: <20020407223650.B7063@redhat.com> <20020407225626.A7094@redhat.com> Message-ID: Richard Henderson writes: > On Mon, Apr 08, 2002 at 07:54:10AM +0200, Andreas Jaeger wrote: >> It is causing a failure. Which patch exactly should I try to back out? > > 2002-04-04 Richard Henderson > > PR middle-end/5099 > * stmt.c (expand_asm_operands): Validate outputs vs asm_operand_ok. > Support copies into and out of memory. Don't accept allows_reg > and allows_mem as gospel. > Reverting that patch fixes indeed the failure and the warnings. Shall I revert that in the GCC CVS archive? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Mon Apr 8 12:55:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 08 Apr 2002 12:55:00 -0000 Subject: [PATCH] Fix libSegFault.so In-Reply-To: <20020408154630.W32482@sunsite.ms.mff.cuni.cz> References: <20020408154630.W32482@sunsite.ms.mff.cuni.cz> Message-ID: <1018295672.26458.420.camel@akkadia.org> On Mon, 2002-04-08 at 06:46, Jakub Jelinek wrote: > Thus IMHO _itoa.h should only use the internal definitions if in libc or > ld.so. While at it, I think using IS_IN_RTLD instead of _RTLD_LOCAL would > be good for consistency with your recent Makefile changes for other libs. I've added the patch after some minor editing. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From drepper@redhat.com Mon Apr 8 13:18:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 08 Apr 2002 13:18:00 -0000 Subject: [PATCH] Fix debugging of threaded processes using trunk -lpthread In-Reply-To: <20020408152424.V32482@sunsite.ms.mff.cuni.cz> References: <20020408152424.V32482@sunsite.ms.mff.cuni.cz> Message-ID: <1018297082.26458.422.camel@akkadia.org> On Mon, 2002-04-08 at 06:24, Jakub Jelinek wrote: > 2002-04-08 Jakub Jelinek > > * manager.c (__pthread_manager_event): Use self instead of arg > for INIT_THREAD_SELF. > * sysdeps/i386/useldt.h (INIT_THREAD_SELF): Use sizeof (struct > _pthread_descr_struct) instead of sizeof (*descr). I've applied the patch. Thanks for tracking this down. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From drepper@redhat.com Mon Apr 8 14:06:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 08 Apr 2002 14:06:00 -0000 Subject: TLS support for SH In-Reply-To: <200204080013.g380DJA22075@r-rr.iij4u.or.jp> References: <200204080013.g380DJA22075@r-rr.iij4u.or.jp> Message-ID: <1018299909.26458.432.camel@akkadia.org> On Sun, 2002-04-07 at 17:04, kaz Kojima wrote: > Sorry, this is a report rather than a patch, though it looks like > so. I've tried the TLS support for SH. Now it passes all TLS tests > in elf directory. The patch looks good as does the ABI. I've applied the patch. Thanks also for fixing the problems in the so-far unused TLS code. You'll see that I made a few corrections. If you see any problems let me know. There is only one strange thing left: in sysdeps/sh/dl-tls.h you use the regparms attribute with __tls_get_addr. Is this attribute defined for SH? Or is it a copy&paste left-over from the x86 code. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From kkojima@rr.iij4u.or.jp Mon Apr 8 15:32:00 2002 From: kkojima@rr.iij4u.or.jp (kaz Kojima) Date: Mon, 08 Apr 2002 15:32:00 -0000 Subject: TLS support for SH In-Reply-To: Your message of "08 Apr 2002 14:05:08 -0700" <1018299909.26458.432.camel@akkadia.org> References: <1018299909.26458.432.camel@akkadia.org> Message-ID: <200204082232.g38MWLA18419@r-rr.iij4u.or.jp> Ulrich Drepper wrote: >> Sorry, this is a report rather than a patch, though it looks like >> so. I've tried the TLS support for SH. Now it passes all TLS tests >> in elf directory. > > The patch looks good as does the ABI. I've applied the patch. Thanks > also for fixing the problems in the so-far unused TLS code. > > You'll see that I made a few corrections. If you see any problems let > me know. Thanks, I'll try corrected code ASAP. > There is only one strange thing left: in sysdeps/sh/dl-tls.h you use the > regparms attribute with __tls_get_addr. Is this attribute defined for > SH? Or is it a copy&paste left-over from the x86 code. Sorry, I've missed it. Yes, it's just a copy&past left-over from the x86 code. kaz From drepper@redhat.com Mon Apr 8 17:34:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 08 Apr 2002 17:34:00 -0000 Subject: TLS support for SH In-Reply-To: <200204082232.g38MWLA18419@r-rr.iij4u.or.jp> References: <1018299909.26458.432.camel@akkadia.org> <200204082232.g38MWLA18419@r-rr.iij4u.or.jp> Message-ID: <1018310590.26729.441.camel@akkadia.org> On Mon, 2002-04-08 at 15:23, kaz Kojima wrote: > Sorry, I've missed it. Yes, it's just a copy&past left-over from > the x86 code. I've removed it now. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From kukuk@suse.de Thu Apr 11 12:50:00 2002 From: kukuk@suse.de (Thorsten Kukuk) Date: Thu, 11 Apr 2002 12:50:00 -0000 Subject: glibc 2.2 cvs and gcc 3.1 last snapshot on SPARC Message-ID: <20020411215053.A6545@suse.de> Hi, I try to compile current glibc 2.2 cvs snapshot with the latest gcc 3.1 snapshot. It fails with: ../sysdeps/sparc/sparc32/__longjmp.S: Assembler messages: ../sysdeps/sparc/sparc32/__longjmp.S:41: Error: Illegal operands ../sysdeps/sparc/sparc32/__longjmp.S:43: Error: Illegal operands ../sysdeps/sparc/sparc32/__longjmp.S:48: Error: unknown pseudo-op: `.' ../sysdeps/sparc/sparc32/__longjmp.S:50: Error: Illegal operands ../sysdeps/sparc/sparc32/__longjmp.S:52: Error: Illegal operands ../sysdeps/sparc/sparc32/__longjmp.S:55: Error: unknown pseudo-op: `.' ../sysdeps/sparc/sparc32/__longjmp.S:72: Error: unknown pseudo-op: `.' ../sysdeps/sparc/sparc32/__longjmp.S:76: Error: unknown pseudo-op: `.' Is this a glibc bug or a gcc 3.1 bug? Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Deutschherrenstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B From jakub@redhat.com Thu Apr 11 13:25:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 11 Apr 2002 13:25:00 -0000 Subject: [PATCH] Re: glibc 2.2 cvs and gcc 3.1 last snapshot on SPARC In-Reply-To: <20020411215053.A6545@suse.de>; from kukuk@suse.de on Thu, Apr 11, 2002 at 09:50:53PM +0200 References: <20020411215053.A6545@suse.de> Message-ID: <20020411222529.I32482@sunsite.ms.mff.cuni.cz> On Thu, Apr 11, 2002 at 09:50:53PM +0200, Thorsten Kukuk wrote: > > Hi, > > I try to compile current glibc 2.2 cvs snapshot with the latest > gcc 3.1 snapshot. It fails with: > > ../sysdeps/sparc/sparc32/__longjmp.S: Assembler messages: > ../sysdeps/sparc/sparc32/__longjmp.S:41: Error: Illegal operands > > Is this a glibc bug or a gcc 3.1 bug? glibc bug. 2002-04-11 Jakub Jelinek * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (LOC): Don't paste in a token. * sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h (LOC): Likewise. --- libc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h.jj Thu Aug 23 18:51:33 2001 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h Thu Apr 11 22:30:51 2002 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Miguel de Icaza , January 1997. @@ -48,7 +48,7 @@ #define END(name) \ .size name, . - name -#define LOC(name) . ## L ## name +#define LOC(name) .L##name #ifdef PIC #define SYSCALL_ERROR_HANDLER \ --- libc/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h.jj Thu Aug 23 18:51:40 2001 +++ libc/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h Thu Apr 11 22:31:14 2002 @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1994, 1995, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1993,1994,1995,1997,1998,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Brendan Kehoe (brendan@zen.org). @@ -51,6 +51,6 @@ #define r1 %o1 #define MOVE(x,y) mov x, y -#define LOC(name) .##L##name +#define LOC(name) .L##name #endif /* __ASSEMBLER__ */ Jakub From drepper@redhat.com Thu Apr 11 13:43:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 11 Apr 2002 13:43:00 -0000 Subject: [PATCH] Re: glibc 2.2 cvs and gcc 3.1 last snapshot on SPARC In-Reply-To: <20020411222529.I32482@sunsite.ms.mff.cuni.cz> References: <20020411215053.A6545@suse.de> <20020411222529.I32482@sunsite.ms.mff.cuni.cz> Message-ID: <1018557812.19064.162.camel@akkadia.org> On Thu, 2002-04-11 at 13:25, Jakub Jelinek wrote: > 2002-04-11 Jakub Jelinek > > * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (LOC): Don't paste > in a token. > * sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h (LOC): Likewise. I've applied the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From kukuk@suse.de Fri Apr 12 04:43:00 2002 From: kukuk@suse.de (Thorsten Kukuk) Date: Fri, 12 Apr 2002 04:43:00 -0000 Subject: glibc 2.2 cvs on AXP: undefined symbol: atexit Message-ID: <20020412134306.A1373@suse.de> Hi, If I try to compile the current glibc 2.2 branch on Alpha, I always get this error: /usr/src/packages/BUILD/glibc-2.2/cc/sunrpc/rpcgen: relocation error: /usr/src/packages/BUILD/glibc-2.2/cc/libc.so.6.1: undefined symbol: atexit make[2]: *** [/usr/src/packages/BUILD/glibc-2.2/cc/sunrpc/xbootparam_prot.stmp] Error 127 It seems that the following patch is the reason for this. Is the fix wrong, or is there another bug on Alpha which is triggerd with this change? Thorsten 2002-04-02 Ulrich Drepper * elf/do-lookup.h (do_lookup): 2 is the first user-defined version number [PR libc/3111]. --- elf/do-lookup.h Mon Aug 27 00:24:08 2001 +++ elf/do-lookup.h Wed Apr 3 16:34:15 2002 @@ -128,7 +128,7 @@ if (verstab != NULL) { ElfW(Half) ndx = verstab[symidx] & 0x7fff; - if (ndx > 2) /* map->l_versions[ndx].hash != 0) */ + if (ndx >= 2) /* map->l_versions[ndx].hash != 0) */ { /* Don't accept hidden symbols. */ if ((verstab[symidx] & 0x8000) == 0 && num_versions++ == 0) -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Deutschherrenstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B From hjl@lucon.org Fri Apr 12 09:03:00 2002 From: hjl@lucon.org (H . J . Lu) Date: Fri, 12 Apr 2002 09:03:00 -0000 Subject: glibc 2.2 cvs on AXP: undefined symbol: atexit In-Reply-To: <20020412134306.A1373@suse.de>; from kukuk@suse.de on Fri, Apr 12, 2002 at 01:43:06PM +0200 References: <20020412134306.A1373@suse.de> Message-ID: <20020412090257.C18636@lucon.org> On Fri, Apr 12, 2002 at 01:43:06PM +0200, Thorsten Kukuk wrote: > > Hi, > > If I try to compile the current glibc 2.2 branch on Alpha, I always get > this error: > > /usr/src/packages/BUILD/glibc-2.2/cc/sunrpc/rpcgen: relocation error: /usr/src/packages/BUILD/glibc-2.2/cc/libc.so.6.1: undefined symbol: atexit > make[2]: *** [/usr/src/packages/BUILD/glibc-2.2/cc/sunrpc/xbootparam_prot.stmp] > Error 127 > atexit should be in libc_nonshared.a. Why isn't it there for alpha? H.J. From kukuk@suse.de Fri Apr 12 10:30:00 2002 From: kukuk@suse.de (Thorsten Kukuk) Date: Fri, 12 Apr 2002 10:30:00 -0000 Subject: glibc 2.2 cvs on AXP: undefined symbol: atexit In-Reply-To: <20020412090257.C18636@lucon.org> References: <20020412134306.A1373@suse.de> <20020412090257.C18636@lucon.org> Message-ID: <20020412192956.A13478@suse.de> On Fri, Apr 12, H . J . Lu wrote: > On Fri, Apr 12, 2002 at 01:43:06PM +0200, Thorsten Kukuk wrote: > > > > Hi, > > > > If I try to compile the current glibc 2.2 branch on Alpha, I always get > > this error: > > > > /usr/src/packages/BUILD/glibc-2.2/cc/sunrpc/rpcgen: relocation error: /usr/src/packages/BUILD/glibc-2.2/cc/libc.so.6.1: undefined symbol: atexit > > make[2]: *** [/usr/src/packages/BUILD/glibc-2.2/cc/sunrpc/xbootparam_prot.stmp] > > Error 127 > > > > atexit should be in libc_nonshared.a. Why isn't it there for alpha? It is there. And I can run the binary with old ld.so/libc.so. But not with the new one. For me it looks like a bug in ld.so. As I wrote, reverting the do-lookup.h change fixes the problem for me and glibc works again on Alpha. Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Deutschherrenstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B From drepper@redhat.com Fri Apr 12 10:34:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 12 Apr 2002 10:34:00 -0000 Subject: glibc 2.2 cvs on AXP: undefined symbol: atexit In-Reply-To: <20020412134306.A1373@suse.de> References: <20020412134306.A1373@suse.de> Message-ID: <1018632852.19064.340.camel@akkadia.org> On Fri, 2002-04-12 at 04:43, Thorsten Kukuk wrote: > It seems that the following patch is the reason for this. Is the fix wrong, > or is there another bug on Alpha which is triggerd with this change? THe patch isn't wrong and this is no Alpha-specific problem. I have an additional patch to handle this more gracefully and Jakub already did some limited testing with it. But I have to think a bit more about it. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From kkojima@rr.iij4u.or.jp Fri Apr 12 20:51:00 2002 From: kkojima@rr.iij4u.or.jp (kaz Kojima) Date: Fri, 12 Apr 2002 20:51:00 -0000 Subject: TLS support for SH In-Reply-To: Your message of "13 Apr 2002 00:08:38 -0300" References: Message-ID: <200204130351.g3D3pWA01883@r-rr.iij4u.or.jp> Alexandre Oliva wrote: >> +#define R_SH_TLS_GD_32 128 >> +#define R_SH_TLS_LD_32 129 >> +#define R_SH_TLS_LDO_32 130 >> +#define R_SH_TLS_IE_32 131 >> +#define R_SH_TLS_LE_32 132 >> +#define R_SH_TLS_DTPMOD32 133 >> +#define R_SH_TLS_DTPOFF32 134 >> +#define R_SH_TLS_TPOFF32 135 >> +#define R_SH_TLS_GD_MOV 136 >> +#define R_SH_TLS_GD_CALLMOV 137 >> +#define R_SH_TLS_LDM_MOV 138 >> +#define R_SH_TLS_LDO_MOV 139 >> +#define R_SH_TLS_LD_CALLMOV 140 >> +#define R_SH_TLS_IE_MOV 141 >> +#define R_SH_TLS_LE_MOV 142 > > These relocation numbers are already taken in the Object File (ELF) > Specification published by Hitachi in 1996. Hmm... We can't use these numbers if they will be used in GNU with the original meaning given by that specification. Alex, can you please recommend the new relocation numbers? Should we consider sh64 case? kaz From jakub@redhat.com Sat Apr 13 02:59:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Sat, 13 Apr 2002 02:59:00 -0000 Subject: [PATCH] Fix mktime Message-ID: <20020413115942.N32482@sunsite.ms.mff.cuni.cz> Hi! The PR libc/2738 fix was not entirely correct, since even tm with tm_year 69 is representable in certain timezones. This caused e.g. perl-Date-Calc tests to fail. Below is a fix. Years before 69 surely cannot be represented, for 69 it computes the year and checks for overflow afterwards. 2002-04-13 Jakub Jelinek * time/mktime.c (__mktime_internal): If year is 69, don't bail out early, but check whether it overflowed afterwards. * time/tst-mktime.c (main): Add new tests. --- libc/time/mktime.c.jj Sun Apr 7 17:52:27 2002 +++ libc/time/mktime.c Sat Apr 13 11:12:05 2002 @@ -259,8 +259,10 @@ __mktime_internal (struct tm *tp, int sec_requested = sec; - /* Only years after 1970 are defined. */ - if (year < 70) + /* Only years after 1970 are defined. + If year is 69, it might still be representable due to + timezone differnces. */ + if (year < 69) return -1; #if LEAP_SECONDS_POSSIBLE @@ -370,6 +372,14 @@ __mktime_internal (struct tm *tp, return -1; } + if (year == 69) + { + /* If year was 69, need to check whether the time was representable + or not. */ + if (t < 0 || t > 2 * 24 * 60 * 60) + return -1; + } + *tp = tm; return t; } --- libc/time/tst-mktime.c.jj Sat Apr 13 11:45:06 2002 +++ libc/time/tst-mktime.c Sat Apr 13 11:58:22 2002 @@ -5,7 +5,8 @@ int main (void) { - struct tm time_str; + struct tm time_str, *tm; + time_t t; char daybuf[20]; int result; @@ -29,5 +30,38 @@ main (void) result = strcmp (daybuf, "Wednesday") != 0; } + setenv ("TZ", "EST", 1); +#define EVENING69 1 * 60 * 60 + 2 * 60 + 29 + t = EVENING69; + tm = localtime (&t); + if (tm == NULL) + { + (void) puts ("localtime returned NULL"); + result = 1; + } + else + { + time_str = *tm; + t = mktime (&time_str); + if (t != EVENING69) + { + printf ("mktime returned %ld, expected %ld\n", + (long) t, EVENING69); + result = 1; + } + else + (void) puts ("Dec 31 1969 EST test passed"); + + setenv ("TZ", "CET", 1); + t = mktime (&time_str); + if (t != (time_t) -1) + { + printf ("mktime returned %ld, expected -1\n", (long) t); + result = 1; + } + else + (void) puts ("Dec 31 1969 CET test passed"); + } + return result; } Jakub From jakub@redhat.com Sun Apr 14 13:25:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Sun, 14 Apr 2002 13:25:00 -0000 Subject: [PATCH] Fix relocation dependency handling Message-ID: <20020414222546.Q32482@sunsite.ms.mff.cuni.cz> Hi! The following is an attempt to fix http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=63422 The problem is that at least if GL(dl_dynamic_weak) != 0 (but I think in STV_PROTECTED handling this might happen as well), we don't call add_dependency at all if we don't find a non-weak definition. We resolve to the first weak dependency, and if this one is in a dlopened library and that library is later on dlclosed, we end up with relocations pointing to unmapped memory. Particularly: 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=./a.out 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/usr/lib/libSDL-1.2.so.0 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/lib/i686/libpthread.so.0 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/lib/i686/libc.so.6 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/lib/i686/libm.so.6 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/usr/X11R6/lib/libX11.so.6 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/usr/X11R6/lib/libXext.so.6 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/lib/libdl.so.2 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/lib/ld-linux.so.2 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/usr/lib/libartscbackend.so.0 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/usr/lib/libartsflow.so.1 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/usr/lib/libsoundserver_idl.so.1 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/usr/lib/libkmedia2_idl.so.1 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/usr/lib/libaudiofile.so.0 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/usr/lib/libartsflow_idl.so.1 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/usr/lib/libmcop.so.1 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/lib/libresolv.so.2 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/lib/libdl.so.2 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/usr/lib/libstdc++-libc6.2-2.so.3 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/lib/i686/libm.so.6 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/lib/i686/libc.so.6 28774: symbol=_t24__default_alloc_template2b1i0._S_node_allocator_lock; lookup in file=/lib/ld-linux.so.2 28774: binding file /usr/lib/libmcop.so.1 to /usr/lib/libartscbackend.so.0: normal symbol `_t24__default_alloc_template2b1i0._S_node_allocator_lock' (note no 00746: file=/usr/lib/libartscbackend.so.0; needed by /usr/lib/libmcop.so.1 (relocation dependency) line neither here nor anywhere before this place). The patch below moves the add_dependency call and related code to the end of the functions to the point where we unconditionally return current_value as result. So far I've just lightly tested it on glibc tree from 4 days ago, ie. predating your dl-lookup.c etc. changes, and it worked for this case as expected. While forward porting it to current dl-lookup.c, I've noticed you haven't changed the last argument in the recursive calls to _dl_lookup_*symbol if add_dependency fails. Previously it was passing 0 since code above it ensured ! explicit, so it was just a more efficient way of passing explicit. But now that explicit is (flags & DL_LOOKUP_ADD_DEPENDENCY) != 0, I think we need to pass in flags, not 0 (both because of the additional bit fields and because 0 now means former !explicit. 2002-04-14 Jakub Jelinek * elf/dl-lookup.c (_dl_lookup_symbol): Move add_dependency call to the end of the function. Pass original flags to recursive call if add_dependency failed. (_dl_lookup_versioned_symbol): Likewise. --- libc/elf/dl-lookup.c.jj Sun Apr 14 22:14:09 2002 +++ libc/elf/dl-lookup.c Sun Apr 14 22:17:53 2002 @@ -228,24 +228,7 @@ _dl_lookup_symbol (const char *undef_nam for (scope = symbol_scope; *scope; ++scope) if (do_lookup (undef_name, hash, *ref, ¤t_value, *scope, 0, flags, NULL, type_class)) - { - /* We have to check whether this would bind UNDEF_MAP to an object - in the global scope which was dynamically loaded. In this case - we have to prevent the latter from being unloaded unless the - UNDEF_MAP object is also unloaded. */ - if (__builtin_expect (current_value.m->l_type == lt_loaded, 0) - /* Don't do this for explicit lookups as opposed to implicit - runtime lookups. */ - && (flags & DL_LOOKUP_ADD_DEPENDENCY) != 0 - /* Add UNDEF_MAP to the dependencies. */ - && add_dependency (undef_map, current_value.m) < 0) - /* Something went wrong. Perhaps the object we tried to reference - was just removed. Try finding another definition. */ - return INTUSE(_dl_lookup_symbol) (undef_name, undef_map, ref, - symbol_scope, type_class, 0); - - break; - } + break; if (__builtin_expect (current_value.s == NULL, 0)) { @@ -282,6 +265,21 @@ _dl_lookup_symbol (const char *undef_nam } } + /* We have to check whether this would bind UNDEF_MAP to an object + in the global scope which was dynamically loaded. In this case + we have to prevent the latter from being unloaded unless the + UNDEF_MAP object is also unloaded. */ + if (__builtin_expect (current_value.m->l_type == lt_loaded, 0) + /* Don't do this for explicit lookups as opposed to implicit + runtime lookups. */ + && (flags & DL_LOOKUP_ADD_DEPENDENCY) != 0 + /* Add UNDEF_MAP to the dependencies. */ + && add_dependency (undef_map, current_value.m) < 0) + /* Something went wrong. Perhaps the object we tried to reference + was just removed. Try finding another definition. */ + return INTUSE(_dl_lookup_symbol) (undef_name, undef_map, ref, + symbol_scope, type_class, flags); + if (__builtin_expect (GL(dl_debug_mask) & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0)) _dl_debug_bindings (undef_name, undef_map, ref, symbol_scope, @@ -395,26 +393,7 @@ _dl_lookup_versioned_symbol (const char int res = do_lookup_versioned (undef_name, hash, *ref, ¤t_value, *scope, 0, version, NULL, type_class); if (res > 0) - { - /* We have to check whether this would bind UNDEF_MAP to an object - in the global scope which was dynamically loaded. In this case - we have to prevent the latter from being unloaded unless the - UNDEF_MAP object is also unloaded. */ - if (__builtin_expect (current_value.m->l_type == lt_loaded, 0) - /* Don't do this for explicit lookups as opposed to implicit - runtime lookups. */ - && flags != 0 - /* Add UNDEF_MAP to the dependencies. */ - && add_dependency (undef_map, current_value.m) < 0) - /* Something went wrong. Perhaps the object we tried to reference - was just removed. Try finding another definition. */ - return INTUSE(_dl_lookup_versioned_symbol) (undef_name, undef_map, - ref, symbol_scope, - version, type_class, - 0); - - break; - } + break; if (__builtin_expect (res, 0) < 0) { @@ -479,6 +458,22 @@ _dl_lookup_versioned_symbol (const char } } + /* We have to check whether this would bind UNDEF_MAP to an object + in the global scope which was dynamically loaded. In this case + we have to prevent the latter from being unloaded unless the + UNDEF_MAP object is also unloaded. */ + if (__builtin_expect (current_value.m->l_type == lt_loaded, 0) + /* Don't do this for explicit lookups as opposed to implicit + runtime lookups. */ + && flags != 0 + /* Add UNDEF_MAP to the dependencies. */ + && add_dependency (undef_map, current_value.m) < 0) + /* Something went wrong. Perhaps the object we tried to reference + was just removed. Try finding another definition. */ + return INTUSE(_dl_lookup_versioned_symbol) (undef_name, undef_map, + ref, symbol_scope, + version, type_class, flags); + if (__builtin_expect (GL(dl_debug_mask) & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0)) _dl_debug_bindings (undef_name, undef_map, ref, symbol_scope, Jakub From drepper@redhat.com Sun Apr 14 23:27:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 14 Apr 2002 23:27:00 -0000 Subject: [PATCH] Fix mktime In-Reply-To: <20020413115942.N32482@sunsite.ms.mff.cuni.cz> References: <20020413115942.N32482@sunsite.ms.mff.cuni.cz> Message-ID: <1018852036.22151.30.camel@akkadia.org> On Sat, 2002-04-13 at 02:59, Jakub Jelinek wrote: > 2002-04-13 Jakub Jelinek > > * time/mktime.c (__mktime_internal): If year is 69, don't bail out > early, but check whether it overflowed afterwards. > * time/tst-mktime.c (main): Add new tests. I've applied the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From drepper@redhat.com Sun Apr 14 23:36:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 14 Apr 2002 23:36:00 -0000 Subject: [PATCH] Fix relocation dependency handling In-Reply-To: <20020414222546.Q32482@sunsite.ms.mff.cuni.cz> References: <20020414222546.Q32482@sunsite.ms.mff.cuni.cz> Message-ID: <1018852565.22151.32.camel@akkadia.org> On Sun, 2002-04-14 at 13:25, Jakub Jelinek wrote: > 2002-04-14 Jakub Jelinek > > * elf/dl-lookup.c (_dl_lookup_symbol): Move add_dependency call to > the end of the function. Pass original flags to recursive call if > add_dependency failed. > (_dl_lookup_versioned_symbol): Likewise. This patch looks OK, I've applied it. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From schwab@suse.de Mon Apr 15 01:29:00 2002 From: schwab@suse.de (Andreas Schwab) Date: Mon, 15 Apr 2002 01:29:00 -0000 Subject: [PATCH] Fix relocation dependency handling In-Reply-To: <1018852565.22151.32.camel@akkadia.org> (Ulrich Drepper's message of "14 Apr 2002 23:36:04 -0700") References: <20020414222546.Q32482@sunsite.ms.mff.cuni.cz> <1018852565.22151.32.camel@akkadia.org> Message-ID: Ulrich Drepper writes: |> On Sun, 2002-04-14 at 13:25, Jakub Jelinek wrote: |> |> > 2002-04-14 Jakub Jelinek |> > |> > * elf/dl-lookup.c (_dl_lookup_symbol): Move add_dependency call to |> > the end of the function. Pass original flags to recursive call if |> > add_dependency failed. |> > (_dl_lookup_versioned_symbol): Likewise. |> |> This patch looks OK, I've applied it. Thanks, See also http://sources.redhat.com/ml/libc-hacker/2002-02/msg00121.html. Why didn't you just check in this patch? It even contains a test! Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE GmbH, Deutschherrnstr. 15-19, D-90429 N??rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From drepper@redhat.com Mon Apr 15 10:01:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 15 Apr 2002 10:01:00 -0000 Subject: [PATCH] Fix relocation dependency handling In-Reply-To: References: <20020414222546.Q32482@sunsite.ms.mff.cuni.cz> <1018852565.22151.32.camel@akkadia.org> Message-ID: <1018890053.11427.44.camel@akkadia.org> On Mon, 2002-04-15 at 01:29, Andreas Schwab wrote: > See also http://sources.redhat.com/ml/libc-hacker/2002-02/msg00121.html. > Why didn't you just check in this patch? It even contains a test! I don't have this mail anywhere in my mail folders. Fact is that I get far too much mail and this unfortunately sometimes means that something gets lost. Especially if it's sent in a time when I'm away or working on something without allowing distractions. If you cannot understand this you might want collect the references to your outstanding mails and resend this list regularly. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From kukuk@suse.de Wed Apr 17 02:03:00 2002 From: kukuk@suse.de (Thorsten Kukuk) Date: Wed, 17 Apr 2002 02:03:00 -0000 Subject: NSS not longer exporting parser Message-ID: <20020417110303.A30134@suse.de> Hi, the libnss_files.so.2 library does not export any longer the parsers. All Parsers are now "GLIBC_PRIVATE". As result, most other NSS modules (even the one from glibc), which uses the files parser, does not work any longer. Is the current solution really to duplicate the functions for every NSS module? Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Deutschherrenstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B From kukuk@suse.de Wed Apr 17 05:22:00 2002 From: kukuk@suse.de (Thorsten Kukuk) Date: Wed, 17 Apr 2002 05:22:00 -0000 Subject: [PATCH] Fix mktime In-Reply-To: <20020413115942.N32482@sunsite.ms.mff.cuni.cz> References: <20020413115942.N32482@sunsite.ms.mff.cuni.cz> Message-ID: <20020417142145.A9522@suse.de> On Sat, Apr 13, Jakub Jelinek wrote: > Hi! > > The PR libc/2738 fix was not entirely correct, since even tm with tm_year 69 > is representable in certain timezones. This caused e.g. perl-Date-Calc tests > to fail. Below is a fix. Years before 69 surely cannot be represented, for > 69 it computes the year and checks for overflow afterwards. > > 2002-04-13 Jakub Jelinek > > * time/mktime.c (__mktime_internal): If year is 69, don't bail out > early, but check whether it overflowed afterwards. > * time/tst-mktime.c (main): Add new tests. make check does not longer pass for me with this. Output of tst-mktime.out is: Wednesday Dec 31 1969 EST test passed mktime returned 3749, expected -1 Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Deutschherrenstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B From jakub@redhat.com Wed Apr 17 05:45:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Wed, 17 Apr 2002 05:45:00 -0000 Subject: [PATCH] tst-mktime.c In-Reply-To: <20020417142145.A9522@suse.de>; from kukuk@suse.de on Wed, Apr 17, 2002 at 02:21:46PM +0200 References: <20020413115942.N32482@sunsite.ms.mff.cuni.cz> <20020417142145.A9522@suse.de> Message-ID: <20020417144507.Y32482@sunsite.ms.mff.cuni.cz> On Wed, Apr 17, 2002 at 02:21:46PM +0200, Thorsten Kukuk wrote: > On Sat, Apr 13, Jakub Jelinek wrote: > > > Hi! > > > > The PR libc/2738 fix was not entirely correct, since even tm with tm_year 69 > > is representable in certain timezones. This caused e.g. perl-Date-Calc tests > > to fail. Below is a fix. Years before 69 surely cannot be represented, for > > 69 it computes the year and checks for overflow afterwards. > > > > 2002-04-13 Jakub Jelinek > > > > * time/mktime.c (__mktime_internal): If year is 69, don't bail out > > early, but check whether it overflowed afterwards. > > * time/tst-mktime.c (main): Add new tests. > > make check does not longer pass for me with this. Output of > tst-mktime.out is: > > Wednesday > Dec 31 1969 EST test passed > mktime returned 3749, expected -1 Weird, I get Wednesday Dec 31 1969 EST test passed Dec 31 1969 CET test passed on all arches I've bootstrapped it (i386,i686,ia64,alpha,alphaev6). Looks like tst-mktime cannot find the CET zone file on your box. Does the following work for you? Passes for me with current glibc, fails with: Wednesday mktime returned -1, expected 3749 Dec 31 1969 CET test passed with glibc before my mktime patch (expected). 2002-04-17 Jakub Jelinek * time/tst-mktime.c: Include . Use %d, not %ld format for EVENING69. Include offsets in TZ environment variable. --- libc/time/tst-mktime.c.jj Wed Apr 17 14:34:34 2002 +++ libc/time/tst-mktime.c Wed Apr 17 14:48:32 2002 @@ -1,3 +1,4 @@ +#include #include #include #include @@ -30,7 +31,7 @@ main (void) result = strcmp (daybuf, "Wednesday") != 0; } - setenv ("TZ", "EST", 1); + setenv ("TZ", "EST+5", 1); #define EVENING69 1 * 60 * 60 + 2 * 60 + 29 t = EVENING69; tm = localtime (&t); @@ -45,14 +46,14 @@ main (void) t = mktime (&time_str); if (t != EVENING69) { - printf ("mktime returned %ld, expected %ld\n", + printf ("mktime returned %ld, expected %d\n", (long) t, EVENING69); result = 1; } else (void) puts ("Dec 31 1969 EST test passed"); - setenv ("TZ", "CET", 1); + setenv ("TZ", "CET-1", 1); t = mktime (&time_str); if (t != (time_t) -1) { Jakub From kukuk@suse.de Wed Apr 17 06:48:00 2002 From: kukuk@suse.de (Thorsten Kukuk) Date: Wed, 17 Apr 2002 06:48:00 -0000 Subject: [PATCH] tst-mktime.c In-Reply-To: <20020417144507.Y32482@sunsite.ms.mff.cuni.cz> References: <20020413115942.N32482@sunsite.ms.mff.cuni.cz> <20020417142145.A9522@suse.de> <20020417144507.Y32482@sunsite.ms.mff.cuni.cz> Message-ID: <20020417154851.A19579@suse.de> On Wed, Apr 17, Jakub Jelinek wrote: > > make check does not longer pass for me with this. Output of > > tst-mktime.out is: > > > > Wednesday > > Dec 31 1969 EST test passed > > mktime returned 3749, expected -1 > > Weird, I get > Wednesday > Dec 31 1969 EST test passed > Dec 31 1969 CET test passed > > on all arches I've bootstrapped it (i386,i686,ia64,alpha,alphaev6). > Looks like tst-mktime cannot find the CET zone file on your box. Arg, ok, this was it. On this machine was really no timezone data installed :( Thanks for the hint, Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Deutschherrenstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B From drepper@redhat.com Thu Apr 18 20:24:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 18 Apr 2002 20:24:00 -0000 Subject: NSS not longer exporting parser In-Reply-To: <20020417110303.A30134@suse.de> References: <20020417110303.A30134@suse.de> Message-ID: <1019186656.29427.169.camel@akkadia.org> On Wed, 2002-04-17 at 02:03, Thorsten Kukuk wrote: > As result, most other NSS modules (even the one from glibc), which > uses the files parser, does not work any longer. Which NSS module doesn't work? All modules from glibc are linked against the new NSS DSOs and therefore should pick up the GLIBC_PRIVATE symbols and record the version. No other module should use these parsers so GLIBC_PRIVATE is exactly the right version. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From kukuk@suse.de Thu Apr 18 23:14:00 2002 From: kukuk@suse.de (Thorsten Kukuk) Date: Thu, 18 Apr 2002 23:14:00 -0000 Subject: NSS not longer exporting parser In-Reply-To: <1019186656.29427.169.camel@akkadia.org> References: <20020417110303.A30134@suse.de> <1019186656.29427.169.camel@akkadia.org> Message-ID: <20020419081438.A19529@suse.de> On Thu, Apr 18, Ulrich Drepper wrote: > On Wed, 2002-04-17 at 02:03, Thorsten Kukuk wrote: > > > As result, most other NSS modules (even the one from glibc), which > > uses the files parser, does not work any longer. > > Which NSS module doesn't work? For example the libnss_db module, which we splitt of from glibc. Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Deutschherrenstr. 15-19 D-90429 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 240 bytes Desc: not available URL: From drepper@redhat.com Thu Apr 18 23:44:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 18 Apr 2002 23:44:00 -0000 Subject: NSS not longer exporting parser In-Reply-To: <20020419081438.A19529@suse.de> References: <20020417110303.A30134@suse.de> <1019186656.29427.169.camel@akkadia.org> <20020419081438.A19529@suse.de> Message-ID: <1019198675.29427.172.camel@akkadia.org> On Thu, 2002-04-18 at 23:14, Thorsten Kukuk wrote: > For example the libnss_db module, which we splitt of from glibc. If was released for 2.2 again. There is no harm in requiring somebody to install a new binary. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From drepper@redhat.com Sat Apr 20 13:38:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 20 Apr 2002 13:38:00 -0000 Subject: new Makefile target Message-ID: <1019335079.22151.290.camel@akkadia.org> I've just added support for a new Makefile target: xcheck (also xtests). This target is a superset of check but it will also run tests defined using the xtests variables (instead of tests). The goal is to define using xtests some tests which cannot generally be run because they assume a "sane" environment. As a first test in this category I've added the test Zack provided for the RPC problem. This test certainly cannot be run in general but everybody here should be able to run it. This means that everybody here should from now on use make && make xcheck instead of make && make check Let me know if you find any problems. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From hjl@lucon.org Sat Apr 20 16:37:00 2002 From: hjl@lucon.org (H . J . Lu) Date: Sat, 20 Apr 2002 16:37:00 -0000 Subject: new Makefile target In-Reply-To: <1019335079.22151.290.camel@akkadia.org>; from drepper@redhat.com on Sat, Apr 20, 2002 at 01:37:57PM -0700 References: <1019335079.22151.290.camel@akkadia.org> Message-ID: <20020420163742.A4307@lucon.org> On Sat, Apr 20, 2002 at 01:37:57PM -0700, Ulrich Drepper wrote: > I've just added support for a new Makefile target: xcheck (also > xtests). This target is a superset of check but it will also run tests > defined using the xtests variables (instead of tests). > > The goal is to define using xtests some tests which cannot generally be > run because they assume a "sane" environment. > > As a first test in this category I've added the test Zack provided for > the RPC problem. This test certainly cannot be run in general but > everybody here should be able to run it. > > This means that everybody here should from now on use > > make && make xcheck > > instead of > > make && make check > > Let me know if you find any problems. It doesn't work for me: make -j 4 -C manual xtests make[4]: Entering directory `/home/hjl/work/gnu/src/glibc/libc/manual' make[4]: warning: -jN forced in submake: disabling jobserver mode. make[4]: *** No rule to make target `xtests'. Stop. make[4]: Leaving directory `/home/hjl/work/gnu/src/glibc/libc/manual' make[3]: *** [manual/xtests] Error 2 make[3]: Leaving directory `/home/hjl/work/gnu/src/glibc/libc' make[2]: *** [xcheck] Error 2 make[2]: Leaving directory `/export/build/gnu/glibc/build-i686-linux' H.J. From drepper@redhat.com Sat Apr 20 17:47:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 20 Apr 2002 17:47:00 -0000 Subject: new Makefile target In-Reply-To: <20020420163742.A4307@lucon.org> References: <1019335079.22151.290.camel@akkadia.org> <20020420163742.A4307@lucon.org> Message-ID: <1019350026.11427.294.camel@akkadia.org> On Sat, 2002-04-20 at 16:37, H . J . Lu wrote: > It doesn't work for me: Should work now. There was one more Makefile to fix. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From aj@suse.de Wed Apr 24 11:50:00 2002 From: aj@suse.de (Andreas Jaeger) Date: Wed, 24 Apr 2002 11:50:00 -0000 Subject: --prefix Message-ID: A common problem on the glibc mailing lists is that unexperienced people try to install glibc without giving it a prefix - and glibc ends in /usr/local. This causes lots of troubles since now you have two glibc and the dynamic linker is used from the old installation but the shared libs from the new one. I propose to change the prefix to something else than /usr/local/. What do you think? Or is there a problem with autoconf? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj From drepper@redhat.com Wed Apr 24 12:01:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 24 Apr 2002 12:01:00 -0000 Subject: --prefix In-Reply-To: References: Message-ID: <1019674894.7816.269.camel@akkadia.org> On Wed, 2002-04-24 at 11:50, Andreas Jaeger wrote: > I propose to change the prefix to something else than /usr/local/. > What do you think? Or is there a problem with autoconf? Changing the default prefix isn't good. But you could add some code in sysdeps/unix/sysv/linux/configure.in which warns if the prefix != /usr. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From jakub@redhat.com Fri Apr 26 03:45:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Fri, 26 Apr 2002 03:45:00 -0000 Subject: [PATCH] sparc-linux semctl fix Message-ID: <20020426120601.E32482@sunsite.ms.mff.cuni.cz> Hi! The following patch fixes semctl on sparc32. The problem is that on arches which pass unions (whatever size) indirectly, if e.g. semctl (semid, 0, IPC_RMID); is called, then it segfaults, while would work if semctl (semid, 0, IPC_RMID, (union semun) { 0 } ); was called (which is not required by standards though). I think PPC and maybe some other arches which pass word-size unions to vararg functions indirectly need the same fix (but AFAIC ppc uses the generic linux semctl.c, not i386 one, so needs to have its own copy again; or maybe the generic code should have something which works everywhere and architectures which can optimize could optimize). It works on i386 because unions are passed directly on the stack, it works on sparc64 and ia64 because unions are passed directly in registers (in sparc64 case actually only unions <= 2*wordsize). 2002-04-26 Jakub Jelinek * sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c: Copied from i386/semctl.c. (__old_semctl, __new_semctl): Only use va_arg if the argument will be used. --- libc/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c.jj Fri Feb 11 20:44:42 2000 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c Thu Apr 25 22:52:00 2002 @@ -1 +1,205 @@ -#include +/* Semctl for architectures where word sized unions are passed indirectly + Copyright (C) 1995, 1997, 1998, 2000, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "kernel-features.h" +#include + +struct __old_semid_ds +{ + struct __old_ipc_perm sem_perm; /* operation permission struct */ + __time_t sem_otime; /* last semop() time */ + __time_t sem_ctime; /* last time changed by semctl() */ + struct sem *__sembase; /* ptr to first semaphore in array */ + struct sem_queue *__sem_pending; /* pending operations */ + struct sem_queue *__sem_pending_last; /* last pending operation */ + struct sem_undo *__undo; /* ondo requests on this array */ + unsigned short int sem_nsems; /* number of semaphores in set */ +}; + +/* Define a `union semun' suitable for Linux here. */ +union semun +{ + int val; /* value for SETVAL */ + struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ + unsigned short int *array; /* array for GETALL & SETALL */ + struct seminfo *__buf; /* buffer for IPC_INFO */ +}; + +#include +#include /* definition of CHECK_SEMCTL needs union semum */ + +#ifdef __NR_getuid32 +# if __ASSUME_32BITUIDS == 0 +/* This variable is shared with all files that need to check for 32bit + uids. */ +extern int __libc_missing_32bit_uids; +# endif +#endif + +/* Return identifier for array of NSEMS semaphores associated with + KEY. */ +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2) +int __old_semctl (int semid, int semnum, int cmd, ...); +#endif +int __new_semctl (int semid, int semnum, int cmd, ...); + +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2) +int +__old_semctl (int semid, int semnum, int cmd, ...) +{ + union semun arg; + va_list ap; + + /* Get the argument only if required. */ + arg.buf = NULL; + switch (cmd) + { + case SETVAL: /* arg.val */ + case GETALL: /* arg.array */ + case SETALL: + case IPC_STAT: /* arg.buf */ + case IPC_SET: + case SEM_STAT: + case IPC_INFO: /* arg.__buf */ + case SEM_INFO: + va_start (ap, cmd); + arg = va_arg (ap, union semun); + va_end (ap); + break; + } + + return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd, + CHECK_SEMCTL (&arg, semid, cmd)); +} +compat_symbol (libc, __old_semctl, semctl, GLIBC_2_0); +#endif + +int +__new_semctl (int semid, int semnum, int cmd, ...) +{ + union semun arg; + va_list ap; + + /* Get the argument only if required. */ + arg.buf = NULL; + switch (cmd) + { + case SETVAL: /* arg.val */ + case GETALL: /* arg.array */ + case SETALL: + case IPC_STAT: /* arg.buf */ + case IPC_SET: + case SEM_STAT: + case IPC_INFO: /* arg.__buf */ + case SEM_INFO: + va_start (ap, cmd); + arg = va_arg (ap, union semun); + va_end (ap); + break; + } + +#if __ASSUME_32BITUIDS > 0 + return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64, + CHECK_SEMCTL (&arg, semid, cmd | __IPC_64)); +#else + switch (cmd) { + case SEM_STAT: + case IPC_STAT: + case IPC_SET: + break; + default: + return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd, + CHECK_SEMCTL (&arg, semid, cmd)); + } + + { + int result; + struct __old_semid_ds old; + struct semid_ds *buf; + +#ifdef __NR_getuid32 + if (__libc_missing_32bit_uids <= 0) + { + if (__libc_missing_32bit_uids < 0) + { + int save_errno = errno; + + /* Test presence of new IPC by testing for getuid32 syscall. */ + result = INLINE_SYSCALL (getuid32, 0); + if (result == -1 && errno == ENOSYS) + __libc_missing_32bit_uids = 1; + else + __libc_missing_32bit_uids = 0; + __set_errno(save_errno); + } + if (__libc_missing_32bit_uids <= 0) + { + result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64, + CHECK_SEMCTL (&arg, semid, cmd | __IPC_64)); + return result; + } + } +#endif + + buf = arg.buf; + arg.buf = (struct semid_ds *)&old; + if (cmd == IPC_SET) + { + old.sem_perm.uid = buf->sem_perm.uid; + old.sem_perm.gid = buf->sem_perm.gid; + old.sem_perm.mode = buf->sem_perm.mode; + if (old.sem_perm.uid != buf->sem_perm.uid || + old.sem_perm.gid != buf->sem_perm.gid) + { + __set_errno (EINVAL); + return -1; + } + } + result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd, + CHECK_SEMCTL (&arg, semid, cmd)); + if (result != -1 && cmd != IPC_SET) + { + memset(buf, 0, sizeof(*buf)); + buf->sem_perm.__key = old.sem_perm.__key; + buf->sem_perm.uid = old.sem_perm.uid; + buf->sem_perm.gid = old.sem_perm.gid; + buf->sem_perm.cuid = old.sem_perm.cuid; + buf->sem_perm.cgid = old.sem_perm.cgid; + buf->sem_perm.mode = old.sem_perm.mode; + buf->sem_perm.__seq = old.sem_perm.__seq; + buf->sem_otime = old.sem_otime; + buf->sem_ctime = old.sem_ctime; + buf->sem_nsems = old.sem_nsems; + } + return result; + } +#endif +} + +versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_2); Jakub From drepper@redhat.com Fri Apr 26 13:36:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 26 Apr 2002 13:36:00 -0000 Subject: [PATCH] sparc-linux semctl fix In-Reply-To: <20020426120601.E32482@sunsite.ms.mff.cuni.cz> References: <20020426120601.E32482@sunsite.ms.mff.cuni.cz> Message-ID: <1019853389.32336.18.camel@akkadia.org> On Fri, 2002-04-26 at 03:06, Jakub Jelinek wrote: > The following patch fixes semctl on sparc32. Thanks, I've applied the patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From roland@frob.com Sun Apr 28 12:54:00 2002 From: roland@frob.com (Roland McGrath) Date: Sun, 28 Apr 2002 12:54:00 -0000 Subject: "defined but not used" warning for .gnu.warning symbols Message-ID: <20020428195431.8B9EB1BA15@perdition.linnaean.org> I'm using gcc from today's cvs to build current libc and for every stub_warning it gives me a warning like this one: ../sysdeps/generic/shmctl.c:35: warning: `__evoke_link_warning_shmctl' defined but not used Should we add the `unused' attribute to the symbol? Is there something that guarantees us gcc won't optimize out these defns entirely? From drepper@redhat.com Sun Apr 28 14:27:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 28 Apr 2002 14:27:00 -0000 Subject: "defined but not used" warning for .gnu.warning symbols In-Reply-To: <20020428195431.8B9EB1BA15@perdition.linnaean.org> References: <20020428195431.8B9EB1BA15@perdition.linnaean.org> Message-ID: <1020029053.32336.83.camel@akkadia.org> On Sun, 2002-04-28 at 12:54, Roland McGrath wrote: > Should we add the `unused' attribute to the symbol? Is there something > that guarantees us gcc won't optimize out these defns entirely? Probably. If that actually helps, that is. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From roland@frob.com Mon Apr 29 00:47:00 2002 From: roland@frob.com (Roland McGrath) Date: Mon, 29 Apr 2002 00:47:00 -0000 Subject: "defined but not used" warning for .gnu.warning symbols In-Reply-To: Ulrich Drepper's message of , 28 April 2002 14:24:12 -0700 <1020029053.32336.83.camel@akkadia.org> Message-ID: <20020429074656.A31061BA17@perdition.linnaean.org> > On Sun, 2002-04-28 at 12:54, Roland McGrath wrote: > > > Should we add the `unused' attribute to the symbol? Is there something > > that guarantees us gcc won't optimize out these defns entirely? > > Probably. If that actually helps, that is. It does. I put it in. From drepper@redhat.com Mon Apr 29 14:35:00 2002 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 29 Apr 2002 14:35:00 -0000 Subject: ia-64 test problem Message-ID: <1020116130.31922.136.camel@akkadia.org> Just for the records: testing the cvs trunk currently will not succeed on IA-64 (localedef aborts). The problem is in the kernel. ld.so is placed at a very unfortunate address which prevents larger allocation of memory. David will fix it. But we'll have to live with it for now. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part URL: From davidm@napali.hpl.hp.com Mon Apr 29 14:42:00 2002 From: davidm@napali.hpl.hp.com (David Mosberger) Date: Mon, 29 Apr 2002 14:42:00 -0000 Subject: ia-64 test problem In-Reply-To: <1020116130.31922.136.camel@akkadia.org> References: <1020116130.31922.136.camel@akkadia.org> Message-ID: <15565.48687.510257.900238@napali.hpl.hp.com> >>>>> On 29 Apr 2002 14:35:29 -0700, Ulrich Drepper said: Ulrich> Just for the records: testing the cvs trunk currently will Ulrich> not succeed on IA-64 (localedef aborts). The problem is in Ulrich> the kernel. ld.so is placed at a very unfortunate address Ulrich> which prevents larger allocation of memory. David will fix Ulrich> it. But we'll have to live with it for now. I should have cc'd libc-hacker. Sorry about that. --david -------------------------------------------------------------- From: David Mosberger Sender: ia64_rd-admin@ldl.fc.hp.com To: linux-ia64@linuxia64.com Subject: [ia64 R&D] [patch] small but important change Date: Mon, 29 Apr 2002 14:40:32 -0700 Reply-To: davidm@hpl.hp.com X-URL: http://www.hpl.hp.com/personal/David_Mosberger/ Attached below is a one-liner that you may need to successfully build glibc. Without this change, you may see "make check" in the glibc build fail with "out of memory" error messages. The problem is due to the fact that ld.so, when invoked directly, had only 16MB of virtual memory available before bumping into the ld.so image. Eventually, this would cause brk() to fail. The fix below is to increase ELF_ET_DYN_BASE to give up to 32GB of virtual memory. Of course, you can still come up with test cases where there would be a conflict, but in practice, 32GB should carry us for a long time (and the fundamental problem is inherent in the UNIX process model). An alternative would be to place a directly-invoked loader in a different region, but I want to avoid that to minimize the number of user regions that the kernel requires for proper operation. Note that this issue comes up only when invoking relocatable ELF binaries (such as ld.so). With normal binaries, this issue won't occur because the break value ends up in region 3. NOTE TO DISTRIBUTORS: I'd like to encourage all distributions to include this change in the kernel used for the next distro release. It should be completely safe and avoids confusing errors during glibc builds (there may be other cases where this pops up, though I'm not aware of any). --david --- include/asm-ia64/elf.h~ Mon Apr 22 19:54:07 2002 +++ include/asm-ia64/elf.h Mon Apr 29 14:03:34 2002 @@ -39,7 +39,7 @@ * the way of the program that it will "exec", and that there is * sufficient room for the brk. */ -#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x1000000) +#define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x800000000) /* _______________________________________________ ia64_rd mailing list ia64_rd@ldl.fc.hp.com http://ldl.fc.hp.com/cgi-bin/mailman/listinfo/ia64_rd From jakub@redhat.com Tue Apr 30 08:32:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 30 Apr 2002 08:32:00 -0000 Subject: [PATCH] locarchive.c nested macros Message-ID: <20020430173141.T32482@sunsite.ms.mff.cuni.cz> Hi! I have only 256MB of RAM on my workstation and compiling locarchive.c takes lots of memory at least with gcc 2.96-RH (230MB before I killed it), with gcc 3.1 it is slightly better (~ 100MB) but anyway building glibc with -j3 is problematic then. The thing is that stpcpy is extremely huge macro (we need to do something for gcc 3.2, so that stpcpy is properly optimized by the compiler and we don't have to do all this), and nesting it 5 times means the resulting preprocessed source is ~6MB and the early compiler passes are fed lots of data till most of it is optimized away. After following patch, locarchive.i is ~ 730KB and compiling it eats way less memory. At least with gcc-3.1, the generated code is identical. 2002-04-30 Jakub Jelinek * locale/programs/locarchive.c (add_locales_to_archive): Don't nest too many stpcpy macros. --- libc/locale/programs/locarchive.c.jj Thu Apr 18 09:55:47 2002 +++ libc/locale/programs/locarchive.c Tue Apr 30 17:34:05 2002 @@ -711,11 +711,8 @@ add_locales_to_archive (nlist, list, rep directory and it therefore must contain a regular file with the same name except a "SYS_" prefix. */ - strcpy (stpcpy (stpcpy (stpcpy (stpcpy (fullname, - fname), - "/"), - d->d_name), - "/SYS_"), + char *t = stpcpy (stpcpy (fullname, fname), "/"); + strcpy (stpcpy (stpcpy (t, d->d_name), "/SYS_"), d->d_name); if (stat64 (fullname, &st) == -1) @@ -765,11 +762,10 @@ add_locales_to_archive (nlist, list, rep if (S_ISDIR (st.st_mode)) { + char *t; close (fd); - strcpy (stpcpy (stpcpy (stpcpy (stpcpy (fullname, fname), - "/"), - locnames[cnt]), - "/SYS_"), + t = stpcpy (stpcpy (fullname, fname), "/"); + strcpy (stpcpy (stpcpy (t, locnames[cnt]), "/SYS_"), locnames[cnt]); fd = open64 (fullname, O_RDONLY); Jakub From jakub@redhat.com Tue Apr 30 09:53:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 30 Apr 2002 09:53:00 -0000 Subject: [PATCH] Fix x86_64 libpthread Message-ID: <20020430185244.W32482@sunsite.ms.mff.cuni.cz> Hi! The recent s390x patch backout reminded me that x86_64 has /usr/lib64/crti.o in specs like sparc64. Wonder how libpthread works on x86_64 then (it cannot) because __pthread_initialize_minimal cannot be called when the standard crti.o is used to link libpthread.so. gcc 3.2 will hopefully solve all this for good in gcc driver (see Alan Modra's patch), but till then... This is what sparc64 does too to make it work. 2002-04-30 Jakub Jelinek * sysdeps/unix/sysv/linux/x86_64/Makefile: New file. --- libc/linuxthreads/sysdeps/unix/sysv/linux/x86_64/Makefile.jj Tue Apr 30 18:54:01 2002 +++ libc/linuxthreads/sysdeps/unix/sysv/linux/x86_64/Makefile Wed Apr 25 12:39:42 2001 @@ -0,0 +1,9 @@ +ifeq ($(subdir),linuxthreads) +# gcc -m64 has /usr/lib64/crti.o hardcoded in the specs file, because otherwise +# it would normally find 32bit crti.o. +LDFLAGS-pthread.so += -specs=$(objpfx)specs +before-compile += $(objpfx)specs +generated += specs +$(objpfx)specs: + $(CC) $(CFLAGS) $(CPPFLAGS) -dumpspecs | sed 's_/usr/lib64/crti.o_crti.o_g' > $@ +endif Jakub From jakub@redhat.com Tue Apr 30 10:45:00 2002 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 30 Apr 2002 10:45:00 -0000 Subject: [PATCH] Honour --prefix in localedef for locale archives Message-ID: <20020430194541.X32482@sunsite.ms.mff.cuni.cz> Hi! localedef should honour --prefix option for locale archive filename (was wondering why make install-locales doesn't work and it just made /usr/lib/locale/locale-archive...). 2002-04-30 Jakub Jelinek * locale/programs/locarchive.c (create_archive): Add archivefname argument, create fname from it. (enlarge_archive): Honour output_prefix. (open_archive): Likewise. --- libc/locale/programs/locarchive.c.jj Tue Apr 30 17:34:05 2002 +++ libc/locale/programs/locarchive.c Tue Apr 30 19:49:04 2002 @@ -45,8 +45,9 @@ #include "simple-hash.h" #include "localedef.h" +extern const char *output_prefix; -static const char archivefname[] = LOCALEDIR "/locale-archive"; +#define ARCHIVE_NAME LOCALEDIR "/locale-archive" static const char *locnames[] = { @@ -65,14 +66,16 @@ static const char *locnames[] = static void -create_archive (struct locarhandle *ah) +create_archive (const char *archivefname, struct locarhandle *ah) { int fd; - char fname[] = LOCALEDIR "/locale-archive.XXXXXX"; + char fname[strlen (archivefname) + sizeof (".XXXXXX")]; struct locarhead head; void *p; size_t total; + strcpy (stpcpy (fname, archivefname), ".XXXXXX"); + /* Create a temporary file in the correct directory. */ fd = mkstemp (fname); if (fd == -1) @@ -169,7 +172,6 @@ enlarge_archive (struct locarhandle *ah, { struct stat64 st; int fd; - char fname[] = LOCALEDIR "/locale-archive.XXXXXX"; struct locarhead newhead; size_t total; void *p; @@ -177,6 +179,14 @@ enlarge_archive (struct locarhandle *ah, struct namehashent *oldnamehashtab; struct locrecent *oldlocrectab; struct locarhandle new_ah; + size_t prefix_len = output_prefix ? strlen (output_prefix) : 0; + char archivefname[prefix_len + sizeof (ARCHIVE_NAME)]; + char fname[prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1]; + + if (output_prefix) + memcpy (archivefname, output_prefix, prefix_len); + strcpy (archivefname + prefix_len, ARCHIVE_NAME); + strcpy (stpcpy (fname, archivefname), ".XXXXXX"); /* Not all of the old file has to be mapped. Change this now this we will have to access the whole content. */ @@ -331,6 +341,12 @@ open_archive (struct locarhandle *ah) int fd; struct locarhead head; int retry = 0; + size_t prefix_len = output_prefix ? strlen (output_prefix) : 0; + char archivefname[prefix_len + sizeof (ARCHIVE_NAME)]; + + if (output_prefix) + memcpy (archivefname, output_prefix, prefix_len); + strcpy (archivefname + prefix_len, ARCHIVE_NAME); again: /* Open the archive. We must have exclusive write access. */ @@ -340,7 +356,7 @@ open_archive (struct locarhandle *ah) /* Maybe the file does not yet exist. */ if (errno == ENOENT) { - create_archive (ah); + create_archive (archivefname, ah); return; } else Jakub