From aj@suse.de Sat Jul 1 00:41:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Sat, 01 Jul 2000 00:41:00 -0000 Subject: linuxthreads broken in glibc 2.2? Message-ID: I've get now failures running the linuxthreads tests on i686-linux in the current CVS version. Can anybody confirm this? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From drepper@redhat.com Sat Jul 1 01:04:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 01 Jul 2000 01:04:00 -0000 Subject: linuxthreads broken in glibc 2.2? References: Message-ID: Andreas Jaeger writes: > I've get now failures running the linuxthreads tests on i686-linux in > the current CVS version. Can anybody confirm this? Nope, all works just fine for me. This is why I just announced the 2.1.91 test release. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Jul 1 01:09:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 01 Jul 2000 01:09:00 -0000 Subject: tagged Message-ID: The release sources from the mainline are tagged with glibc_2-1-91. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Sat Jul 1 02:48:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Sat, 01 Jul 2000 02:48:00 -0000 Subject: linuxthreads broken in glibc 2.2? References: Message-ID: >>>>> Andreas Jaeger writes: > I've get now failures running the linuxthreads tests on i686-linux in > the current CVS version. Can anybody confirm this? This happens only with static binaries (--disable-shared), the shared libraries look fine. Running linuxthreads/ex1 in gdb gives: Program received signal SIGSEGV, Segmentation fault. 0x8052fd7 in __geteuid () at ../sysdeps/unix/sysv/linux/i386/geteuid.c:47 47 int saved_errno = errno; (gdb) bt #0 0x8052fd7 in __geteuid () at ../sysdeps/unix/sysv/linux/i386/geteuid.c:47 #1 0x80546bc in __libc_init_secure () at ../sysdeps/generic/enbl-secure.c:32 #2 0x805474f in init (argc=1, argv=0xbffff7f4, envp=0xbffff7fc) at ../sysdeps/unix/sysv/linux/init-first.c:150 #3 0x804dffe in __libc_start_main (main=0x8048230
, argc=1, ubp_av=0xbffff7f4, init=0x80480b4 <_init>, fini=0x80935c0 <_fini>, rtld_fini=0, stack_end=0xbffff7ec) at ../sysdeps/generic/libc-start.c:81 (gdb) p errno $1 = 0 (gdb) p saved_errno No symbol "saved_errno" in current context. The other test programs segfault at the same place. Any ideas what's broken? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From aj@suse.de Sat Jul 1 03:28:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Sat, 01 Jul 2000 03:28:00 -0000 Subject: Patch for README.template (crypt is no-add-on anymore) Message-ID: The FAQ needs to be updated also. Which other places mention the crypt addon? Ok, to commit? Andreas ============================================================ Index: README.template --- README.template 1999/07/27 01:53:15 1.32 +++ README.template 2000/07/01 10:16:28 @@ -48,28 +48,11 @@ in doing a port, please contact the glibc maintainers by sending electronic mail to . -The GNU C library now includes Michael Glad's Ultra Fast Crypt, which -provides the Unix `crypt' function, plus some other entry points. -Because of the United States export restriction on DES -implementations, we are distributing this code separately from the -rest of the C library. There is an extra distribution tar file just -for crypt; it is called `glibc-crypt-VERSION.tar.gz'. You can just -unpack the crypt distribution along with the rest of the C library and -build; you can also build the library without getting crypt. Users -outside the USA can get the crypt distribution via anonymous FTP from -ftp.gwdg.de [134.76.11.100] in the directory pub/linux/glibc, or -another archive site outside the USA. Archive maintainers are -encouraged to copy this distribution to their archives outside the -USA. Please get it from ftp.gwdg.de; transferring this distribution -from ftp.gnu.org (or any other site in the USA) to a site outside the -USA is in violation of US export laws. - -Beside the separate crypt tar file there are some more add-ons which can be -used together with GNU libc. They are designed in a way to ease the -installation by integrating them in the libc source tree. Simply get the -add-ons you need and use the --enable-add-ons option of the `configure' -script to tell where the add-ons are found. Please read the FAQ file for -more details. +There are some add-ons which can be used together with GNU libc. They +are designed in a way to ease the installation by integrating them in +the libc source tree. Simply get the add-ons you need and use the +--enable-add-ons option of the `configure' script to tell where the +add-ons are found. Please read the FAQ file for more details. See the file INSTALL to find out how to configure, build, install, and port the GNU C library. You might also consider reading the WWW pages for the -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From kettenis@wins.uva.nl Sat Jul 1 04:04:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sat, 01 Jul 2000 04:04:00 -0000 Subject: linuxthreads broken in glibc 2.2? References: Message-ID: <200007011103.e61B3qZ00574@delius.kettenis.local> From: Andreas Jaeger Date: 01 Jul 2000 11:47:33 +0200 >>>>> Andreas Jaeger writes: > I've get now failures running the linuxthreads tests on i686-linux in > the current CVS version. Can anybody confirm this? This happens only with static binaries (--disable-shared), the shared libraries look fine. Running linuxthreads/ex1 in gdb gives: Program received signal SIGSEGV, Segmentation fault. 0x8052fd7 in __geteuid () at ../sysdeps/unix/sysv/linux/i386/geteuid.c:47 47 int saved_errno = errno; (gdb) bt #0 0x8052fd7 in __geteuid () at ../sysdeps/unix/sysv/linux/i386/geteuid.c:47 #1 0x80546bc in __libc_init_secure () at ../sysdeps/generic/enbl-secure.c:32 #2 0x805474f in init (argc=1, argv=0xbffff7f4, envp=0xbffff7fc) at ../sysdeps/unix/sysv/linux/init-first.c:150 #3 0x804dffe in __libc_start_main (main=0x8048230
, argc=1, ubp_av=0xbffff7f4, init=0x80480b4 <_init>, fini=0x80935c0 <_fini>, rtld_fini=0, stack_end=0xbffff7ec) at ../sysdeps/generic/libc-start.c:81 (gdb) p errno $1 = 0 (gdb) p saved_errno No symbol "saved_errno" in current context. The other test programs segfault at the same place. Any ideas what's broken? Yep. __pthread_initialize_minimal() hasn't been called yet. It is called from the libc constructor functions, but if you look at sysdeps/generic/libc-start.c, you'll see that __libc_init_secure() is called before __libc_init_first() which calls the constructors. I suppose that there is no problem when using the old method of getting at the per-thread errno (which is still used on everything < i686), but it fails for the stuff that uses the LDT, since the LDT hasn't been set up yet. I'm entirely not sure how to fix this. Calling __pthread_initialize_minimal from __libc_start_main() #ifndef SHARED is probably the easiest solution. Mark From aj@suse.de Sat Jul 1 06:29:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Sat, 01 Jul 2000 06:29:00 -0000 Subject: Patches for make clean Message-ID: We should properly clean up. I've tested this with static and shared builds. Ok, to commit? Andreas 2000-07-01 Andreas Jaeger * intl/Makefile (generated-dirs): New. * elf/Makefile (generated): trusted-dirs.h is always generated, move out of build-shared condition. (generated): Merge the two entries for build-shared. For localedata/ChangeLog: 2000-07-01 Andreas Jaeger * Makefile (generated-dirs): LOCALES are also generated. (generated-dirs): Remove obsolete entry. ============================================================ Index: intl/Makefile --- intl/Makefile 2000/05/24 09:31:17 1.24 +++ intl/Makefile 2000/07/01 12:36:24 @@ -34,6 +34,7 @@ install-others = $(inst_msgcatdir)/locale.alias generated = msgs.h +generated-dirs := domaindir plural.c: plural.y $(YACC) $(YFLAGS) $@ $^ @@ -91,4 +92,3 @@ endif endif - ============================================================ Index: elf/Makefile --- elf/Makefile 2000/06/30 18:10:42 1.155 +++ elf/Makefile 2000/07/01 12:36:25 @@ -49,7 +49,8 @@ include ../Makeconfig -before-compile = $(objpfx)trusted-dirs.h +before-compile = $(objpfx)trusted-dirs.h +generated := trusted-dirs.h trusted-dirs.st ifeq ($(versioning),yes) ld-map = $(common-objpfx)ld.map @@ -57,10 +58,9 @@ ifeq (yes,$(build-shared)) extra-objs = $(rtld-routines:=.os) soinit.os sofini.os interp.os -generated = librtld.os dl-allobjs.os ld.so trusted-dirs.h trusted-dirs.st +generated += librtld.os dl-allobjs.os ld.so ldd install-others = $(inst_slibdir)/$(rtld-installed-name) install-bin = ldd -generated += ldd endif others = sprof sln ============================================================ Index: localedata/Makefile --- localedata/Makefile 2000/07/01 06:31:04 1.64 +++ localedata/Makefile 2000/07/01 12:36:25 @@ -60,9 +60,8 @@ y01y10 y02n22 y22n42 y30y21 y32n31 y40y00 y42n21 generated := $(test-input) $(test-output) -generated-dirs := $(basename $(test-input)) $(ld-test-names) tt_TT \ - de_DE.437 $(addprefix tstfmon_,$(fmon-tests)) \ - en_US.ANSI_X3.4-1968 ja_JP.EUC-JP +generated-dirs := $(ld-test-names) tt_TT de_DE.437 \ + $(addprefix tstfmon_,$(fmon-tests)) \ distribute := CHECKSUMS README SUPPORTED ChangeLog \ $(charmaps) $(locales) $(repertoiremaps) \ @@ -125,6 +124,8 @@ LOCALE_SRCS := $(shell echo "$(LOCALES)"|sed 's/\([^ .]*\)[^ ]*/\1/g') CHARMAPS := $(shell echo "$(LOCALES)"|sed 's/[^ .]*[.]\([^ ]*\)/\1/g') CTYPE_FILES = $(addsuffix /LC_CTYPE,$(LOCALES)) + +generated-dirs += $(LOCALES) # Dependency for the locale files. We actually make it depend only on # one of the files. -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From aj@suse.de Sat Jul 1 06:36:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Sat, 01 Jul 2000 06:36:00 -0000 Subject: csu/abi-note.ob csu/init.ob csu/start.ob ? Message-ID: Why do I have the three *.ob files in csu? This is a normal build with static and shared libs only? $ ls csu/abi-note* csu/init.* csu/start.* csu/abi-note.d csu/abi-note.ob csu/init.o csu/start.d csu/start.ob csu/abi-note.o csu/init.d csu/init.ob csu/start.o Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From pinard@iro.umontreal.ca Sat Jul 1 07:22:00 2000 From: pinard@iro.umontreal.ca (François Pinard) Date: Sat, 01 Jul 2000 07:22:00 -0000 Subject: RMS is at it again References: Message-ID: [Ulrich Drepper] > tb@MIT.EDU (Thomas Bushnell, BSG) writes: > > Ah. Alas, digital signatures are not legally valid in the US or any > > other country that I know of. > Ehm, isn't your president signing today the digital signature act (or > however you are calling this thing)? I heard that this is limited to "smart cards". -- Fran????ois Pinard http://www.iro.umontreal.ca/~pinard From drepper@redhat.com Sat Jul 1 08:26:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 01 Jul 2000 08:26:00 -0000 Subject: linuxthreads broken in glibc 2.2? References: Message-ID: Andreas Jaeger writes: > This happens only with static binaries (--disable-shared), the shared > libraries look fine. Yes, static binaries are hosed. I know about this but don't really care in the moment. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Jul 1 08:36:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 01 Jul 2000 08:36:00 -0000 Subject: Patches for make clean References: Message-ID: Andreas Jaeger writes: > Ok, to commit? Did it already. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Jul 1 08:39:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 01 Jul 2000 08:39:00 -0000 Subject: csu/abi-note.ob csu/init.ob csu/start.ob ? References: Message-ID: Andreas Jaeger writes: > Why do I have the three *.ob files in csu? This is a normal build > with static and shared libs only? Gary, could you please address this? -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Sat Jul 1 22:58:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sat, 01 Jul 2000 22:58:00 -0000 Subject: csu/abi-note.ob csu/init.ob csu/start.ob ? References: Message-ID: Ulrich Drepper writes: > > Why do I have the three *.ob files in csu? This is a normal build > > with static and shared libs only? > > Greg, could you please address this? Will do, but might not be able to get to it until Monday. From greg@mcgary.org Sat Jul 1 23:21:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sat, 01 Jul 2000 23:21:00 -0000 Subject: csu/abi-note.ob csu/init.ob csu/start.ob ? References: Message-ID: Andreas Jaeger writes: > Why do I have the three *.ob files in csu? This is a normal build > with static and shared libs only? > > $ ls csu/abi-note* csu/init.* csu/start.* > csu/abi-note.d csu/abi-note.ob csu/init.o csu/start.d csu/start.ob > csu/abi-note.o csu/init.d csu/init.ob csu/start.o FYI, gmon-start.o and gcrt1.o are always built as well, even when build-profile=no. I'll fix that too. Greg From greg@mcgary.org Sun Jul 2 09:26:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sun, 02 Jul 2000 09:26:00 -0000 Subject: csu/abi-note.ob csu/init.ob csu/start.ob ? References: <200007020727.AAA12180@localhost.cygnus.com> Message-ID: Geoff Keating writes: > I think you need gmon-start.o for any profiling, while you only need > the libc_p.a if you actually want to profile libc. So it's probably > not a good idea to remove them. Yes. I just had that same thought this AM. By the same token, bcrt1.o is useful for any bounds-checking, even without libc_b.a. Greg From jakub@redhat.com Sun Jul 2 22:43:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Sun, 02 Jul 2000 22:43:00 -0000 Subject: putc on unbuffered FILE Message-ID: <20000703074552.Q19552@sunsite.ms.mff.cuni.cz> Hi! #include int main(void) { putc('1', stderr); putc('2', stderr); } does not work properly in glibc 2.1.91 ('2' is not printed at all). Seems like '2' is just recorded into the write buffer in _IO_putc_unlocked (glibc 2.1 does the same, I wonder though, is it right when the FILE is unbuffered?), so most probably just exit optimizes and does not flush unbuffered streams. fflush(stderr) after the last putc helps, BTW. Jakub From aj@suse.de Mon Jul 3 00:31:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Mon, 03 Jul 2000 00:31:00 -0000 Subject: One more make clean fix Message-ID: glreflib1.so glreflib2.so failtestmod.so were not removed by make clean. Ok to commit? Andreas 2000-07-03 Andreas Jaeger * dlfcn/Makefile (generated): New. ============================================================ Index: dlfcn/Makefile --- dlfcn/Makefile 2000/06/13 23:57:01 1.6 +++ dlfcn/Makefile 2000/07/03 07:26:23 @@ -37,12 +37,12 @@ endif modules-names = glreflib1 glreflib2 failtestmod extra-objs += $(modules-names:=.os) eval.os +generated := $(modules-names:=.so) include ../Rules LDFLAGS-dl.so = -Wl,-dynamic-linker,$(slibdir)/$(rtld-installed-name) -test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names))) $(test-modules): $(objpfx)%.so: $(objpfx)%.os $(build-module) -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From jakub@redhat.com Mon Jul 3 01:14:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 03 Jul 2000 01:14:00 -0000 Subject: [PATCH] libc-lock.h BP breakage Message-ID: <20000703101707.Y19552@sunsite.ms.mff.cuni.cz> Hi! libc-lock.h is public header, used by e.g. libstdc++. As such, it cannot use a non-public header (bp-sym.h). I'm not sure what's the correct fix though, this patch should make things working at least in the !__BOUNDED_POINTERS__ case. Other solutions might include distributing bp-sym.h (but in that case I'd think it would be better not to polute namespace with BP_SYM). 2000-07-03 Jakub Jelinek * sysdeps/pthread/bits/libc-lock.h: Only include bp-sym.h if in glibc, otherwise define BP_SYM(sym) to sym. --- libc/linuxthreads/sysdeps/pthread/bits/libc-lock.h.jj Thu Jun 29 23:24:11 2000 +++ libc/linuxthreads/sysdeps/pthread/bits/libc-lock.h Mon Jul 3 09:58:46 2000 @@ -246,7 +246,11 @@ extern int __pthread_atfork (void (*__pr /* Make the pthread functions weak so that we can elide them from single-threaded processes. */ #ifndef __NO_WEAK_PTHREAD_ALIASES -# include +# ifdef _LIBC +# include +# else +# define BP_SYM(sym) sym +# endif # ifdef weak_extern weak_extern (BP_SYM (__pthread_mutex_init)) weak_extern (BP_SYM (__pthread_mutex_destroy)) Jakub From schwab@suse.de Mon Jul 3 02:08:00 2000 From: schwab@suse.de (Andreas Schwab) Date: Mon, 03 Jul 2000 02:08:00 -0000 Subject: One more make clean fix References: Message-ID: <200007030907.LAA10758@hawking.suse.de> Andreas Jaeger writes: |> Index: dlfcn/Makefile |> --- dlfcn/Makefile 2000/06/13 23:57:01 1.6 |> +++ dlfcn/Makefile 2000/07/03 07:26:23 |> @@ -37,12 +37,12 @@ |> endif |> modules-names = glreflib1 glreflib2 failtestmod |> extra-objs += $(modules-names:=.os) eval.os |> +generated := $(modules-names:=.so) |> |> include ../Rules |> |> LDFLAGS-dl.so = -Wl,-dynamic-linker,$(slibdir)/$(rtld-installed-name) |> |> -test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names))) Are you sure you want to remove that line? Andreas. -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz????ckerstr. 10, D-90443 N????rnberg From aj@suse.de Mon Jul 3 02:18:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Mon, 03 Jul 2000 02:18:00 -0000 Subject: One more make clean fix References: <200007030907.LAA10758@hawking.suse.de> Message-ID: >>>>> Andreas Schwab writes: > Andreas Jaeger writes: > |> Index: dlfcn/Makefile > |> --- dlfcn/Makefile 2000/06/13 23:57:01 1.6 > |> +++ dlfcn/Makefile 2000/07/03 07:26:23 > |> @@ -37,12 +37,12 @@ > |> endif > |> modules-names = glreflib1 glreflib2 failtestmod > |> extra-objs += $(modules-names:=.os) eval.os > |> +generated := $(modules-names:=.so) > |> > |> include ../Rules > |> > |> LDFLAGS-dl.so = -Wl,-dynamic-linker,$(slibdir)/$(rtld-installed-name) > |> > |> -test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names))) > Are you sure you want to remove that line? Definitly not. Otherwise I would have written it into the ChangeLog. Thanks for noticing, here's the fixed patch. Andreas 2000-07-03 Andreas Jaeger * dlfcn/Makefile (generated): New. ============================================================ Index: dlfcn/Makefile --- dlfcn/Makefile 2000/06/13 23:57:01 1.6 +++ dlfcn/Makefile 2000/07/03 09:11:29 @@ -37,6 +37,7 @@ endif modules-names = glreflib1 glreflib2 failtestmod extra-objs += $(modules-names:=.os) eval.os +generated := $(modules-names:=.so) include ../Rules -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From jakub@redhat.com Mon Jul 3 03:39:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 03 Jul 2000 03:39:00 -0000 Subject: [PATCH] libc-lock.h BP breakage (take 2) References: <20000703101707.Y19552@sunsite.ms.mff.cuni.cz> Message-ID: <20000703124210.F19552@sunsite.ms.mff.cuni.cz> On Mon, Jul 03, 2000 at 10:17:07AM +0200, Jakub Jelinek wrote: > Hi! > > libc-lock.h is public header, used by e.g. libstdc++. As such, it cannot use > a non-public header (bp-sym.h). I'm not sure what's the correct fix though, > this patch should make things working at least in the !__BOUNDED_POINTERS__ > case. Other solutions might include distributing bp-sym.h (but in that case > I'd think it would be better not to polute namespace with BP_SYM). > Actually, it is still broken. #pragma does not expand macros, so BP_SYM cannot be used there at all. Either hardcode the bp names into the libc-lock.h file (ifdef __BOUNDED_POINTERS__, leave the current ones if not), or whatever. 2000-07-03 Jakub Jelinek * sysdeps/pthread/bits/libc-lock.h: Only include bp-sym.h if in glibc, otherwise define BP_SYM(sym) to sym. Don't use macros in #pragma weak. --- libc/linuxthreads/sysdeps/pthread/bits/libc-lock.h.jj Thu Jun 29 23:24:11 2000 +++ libc/linuxthreads/sysdeps/pthread/bits/libc-lock.h Mon Jul 3 12:22:10 2000 @@ -246,8 +246,12 @@ extern int __pthread_atfork (void (*__pr /* Make the pthread functions weak so that we can elide them from single-threaded processes. */ #ifndef __NO_WEAK_PTHREAD_ALIASES -# include # ifdef weak_extern +# ifdef _LIBC +# include +# else +# define BP_SYM(sym) sym +# endif weak_extern (BP_SYM (__pthread_mutex_init)) weak_extern (BP_SYM (__pthread_mutex_destroy)) weak_extern (BP_SYM (__pthread_mutex_lock)) @@ -272,28 +276,28 @@ weak_extern (__pthread_atfork) weak_extern (BP_SYM (_pthread_cleanup_push_defer)) weak_extern (BP_SYM (_pthread_cleanup_pop_restore)) # else -# pragma weak BP_SYM (__pthread_mutex_init) -# pragma weak BP_SYM (__pthread_mutex_destroy) -# pragma weak BP_SYM (__pthread_mutex_lock) -# pragma weak BP_SYM (__pthread_mutex_trylock) -# pragma weak BP_SYM (__pthread_mutex_unlock) -# pragma weak BP_SYM (__pthread_mutexattr_init) -# pragma weak BP_SYM (__pthread_mutexattr_destroy) -# pragma weak BP_SYM (__pthread_mutexattr_settype) -# pragma weak BP_SYM (__pthread_rwlock_destroy) -# pragma weak BP_SYM (__pthread_rwlock_rdlock) -# pragma weak BP_SYM (__pthread_rwlock_tryrdlock) -# pragma weak BP_SYM (__pthread_rwlock_wrlock) -# pragma weak BP_SYM (__pthread_rwlock_trywrlock) -# pragma weak BP_SYM (__pthread_rwlock_unlock) -# pragma weak BP_SYM (__pthread_key_create) -# pragma weak BP_SYM (__pthread_setspecific) -# pragma weak BP_SYM (__pthread_getspecific) -# pragma weak BP_SYM (__pthread_once) +# pragma weak __pthread_mutex_init +# pragma weak __pthread_mutex_destroy +# pragma weak __pthread_mutex_lock +# pragma weak __pthread_mutex_trylock +# pragma weak __pthread_mutex_unlock +# pragma weak __pthread_mutexattr_init +# pragma weak __pthread_mutexattr_destroy +# pragma weak __pthread_mutexattr_settype +# pragma weak __pthread_rwlock_destroy +# pragma weak __pthread_rwlock_rdlock +# pragma weak __pthread_rwlock_tryrdlock +# pragma weak __pthread_rwlock_wrlock +# pragma weak __pthread_rwlock_trywrlock +# pragma weak __pthread_rwlock_unlock +# pragma weak __pthread_key_create +# pragma weak __pthread_setspecific +# pragma weak __pthread_getspecific +# pragma weak __pthread_once # pragma weak __pthread_initialize # pragma weak __pthread_atfork -# pragma weak BP_SYM (_pthread_cleanup_push_defer) -# pragma weak BP_SYM (_pthread_cleanup_pop_restore) +# pragma weak _pthread_cleanup_push_defer +# pragma weak _pthread_cleanup_pop_restore # endif #endif Jakub From drepper@redhat.com Mon Jul 3 14:40:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 03 Jul 2000 14:40:00 -0000 Subject: putc on unbuffered FILE References: <20000703074552.Q19552@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > int main(void) > { > putc('1', stderr); > putc('2', stderr); > } Thanks for the test. I've added it and checked in a patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Mon Jul 3 14:54:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 03 Jul 2000 14:54:00 -0000 Subject: putc on unbuffered FILE References: <20000703074552.Q19552@sunsite.ms.mff.cuni.cz> Message-ID: <20000703235742.D19552@sunsite.ms.mff.cuni.cz> On Mon, Jul 03, 2000 at 02:40:36PM -0700, Ulrich Drepper wrote: > Jakub Jelinek writes: > > > int main(void) > > { > > putc('1', stderr); > > putc('2', stderr); > > } > > Thanks for the test. I've added it and checked in a patch. Thanks for fixing it (I got to starting debugger on it just now). Am just wondering if your tst-unbputc.sh will work: the program does not insert the trailing newline (and putting there a third putc would cause the test to pass even with glibc before your patch) and so cmp will complain. So, I'd think you might need to add something like echo >> ${common_objpfx}stdio-common/tst-unbputc.out before the cmp line. Jakub From greg@mcgary.org Mon Jul 3 16:06:00 2000 From: greg@mcgary.org (Greg McGary) Date: Mon, 03 Jul 2000 16:06:00 -0000 Subject: [PATCH] libc-lock.h BP breakage (take 2) References: <20000703101707.Y19552@sunsite.ms.mff.cuni.cz> <20000703124210.F19552@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Actually, it is still broken. > #pragma does not expand macros, so BP_SYM cannot be used there at all. > Either hardcode the bp names into the libc-lock.h file (ifdef > __BOUNDED_POINTERS__, leave the current ones if not), or whatever. I think I should do this: * make bp-sym.h a gcc-specific header, since it's gcc that defines how BP symbols are mangled. * for libc, guard inclusion of bp-sym.h with `#if__BOUNDED_POINTERS__' and define it to just return its arg otherwise. * Since gcc expands pragmas, it will know if a symbol is BP or not, so we needn't pre-mangle the name. A patch will follow later today. From drepper@redhat.com Mon Jul 3 16:13:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 03 Jul 2000 16:13:00 -0000 Subject: putc on unbuffered FILE References: <20000703074552.Q19552@sunsite.ms.mff.cuni.cz> <20000703235742.D19552@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Am just wondering if your tst-unbputc.sh will work: Right, I forgot the -n for the echo call. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Mon Jul 3 17:41:00 2000 From: greg@mcgary.org (Greg McGary) Date: Mon, 03 Jul 2000 17:41:00 -0000 Subject: PATCH: revert type of _IO_FILE._chain Message-ID: <200007040041.RAA17634@kayak.mcgary.org> No binary differences. Doesn't break build-shared or build-static. 2000-07-03 Greg McGary * libio/libio.h (_IO_FILE): Revert type of _chain to _IO_FILE*. * libio/libioP.h (_IO_ITER): Revert to type _IO_FILE*. (FILEBUF_LITERAL): Add cast for CHAIN init. * libio/genops.c (_IO_un_link, _IO_link_in, _IO_iter_begin): Add casts. (_IO_flush_all, _IO_flush_all_linebuffered, _IO_unbuffer_write): Revert type of `fp' to _IO_FILE*. (_IO_iter_file): Remove cast. (_IO_iter_next): Elide intermediate member reference. Index: libio/genops.c =================================================================== RCS file: /cvs/glibc/libc/libio/genops.c,v retrieving revision 1.39 diff -u -p -r1.39 genops.c --- genops.c 2000/07/03 21:37:02 1.39 +++ genops.c 2000/07/03 23:55:54 @@ -45,11 +45,11 @@ _IO_un_link (fp) #ifdef _IO_MTSAFE_IO _IO_lock_lock (list_all_lock); #endif - for (f = &_IO_list_all; *f != NULL; f = &(*f)->file._chain) + for (f = &_IO_list_all; *f; f = (struct _IO_FILE_plus **) &(*f)->file._chain) { if (*f == fp) { - *f = fp->file._chain; + *f = (struct _IO_FILE_plus *) fp->file._chain; break; } } @@ -70,7 +70,7 @@ _IO_link_in (fp) #ifdef _IO_MTSAFE_IO _IO_lock_lock (list_all_lock); #endif - fp->file._chain = _IO_list_all; + fp->file._chain = (_IO_FILE *) _IO_list_all; _IO_list_all = fp; #ifdef _IO_MTSAFE_IO _IO_lock_unlock (list_all_lock); @@ -746,13 +746,13 @@ int _IO_flush_all () { int result = 0; - struct _IO_FILE_plus *fp; - for (fp = _IO_list_all; fp != NULL; fp = fp->file._chain) - if (((fp->file._mode < 0 && fp->file._IO_write_ptr > fp->file._IO_write_base) - || (fp->file._vtable_offset == 0 - && fp->file._mode > 0 && (fp->file._wide_data->_IO_write_ptr - > fp->file._wide_data->_IO_write_base))) - && _IO_OVERFLOW (&fp->file, EOF) == EOF) + struct _IO_FILE *fp; + for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain) + if (((fp->_mode < 0 && fp->_IO_write_ptr > fp->_IO_write_base) + || (fp->_vtable_offset == 0 + && fp->_mode > 0 && (fp->_wide_data->_IO_write_ptr + > fp->_wide_data->_IO_write_base))) + && _IO_OVERFLOW (fp, EOF) == EOF) result = EOF; return result; } @@ -760,10 +760,10 @@ _IO_flush_all () void _IO_flush_all_linebuffered () { - struct _IO_FILE_plus *fp; - for (fp = _IO_list_all; fp != NULL; fp = fp->file._chain) - if ((fp->file._flags & _IO_NO_WRITES) == 0 && fp->file._flags & _IO_LINE_BUF) - _IO_OVERFLOW (&fp->file, EOF); + struct _IO_FILE *fp; + for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain) + if ((fp->_flags & _IO_NO_WRITES) == 0 && fp->_flags & _IO_LINE_BUF) + _IO_OVERFLOW (fp, EOF); } static void _IO_unbuffer_write __P ((void)); @@ -771,12 +771,12 @@ static void _IO_unbuffer_write __P ((voi static void _IO_unbuffer_write () { - struct _IO_FILE_plus *fp; - for (fp = _IO_list_all; fp != NULL; fp = fp->file._chain) - if (! (fp->file._flags & _IO_UNBUFFERED) - && (! (fp->file._flags & _IO_NO_WRITES) - || (fp->file._flags & _IO_IS_APPENDING))) - _IO_SETBUF (&fp->file, NULL, 0); + struct _IO_FILE *fp; + for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain) + if (! (fp->_flags & _IO_UNBUFFERED) + && (! (fp->_flags & _IO_NO_WRITES) + || (fp->_flags & _IO_IS_APPENDING))) + _IO_SETBUF (fp, NULL, 0); } int @@ -1038,7 +1038,7 @@ _IO_default_imbue (fp, locale) _IO_ITER _IO_iter_begin() { - return _IO_list_all; + return (_IO_ITER) _IO_list_all; } _IO_ITER @@ -1051,14 +1051,14 @@ _IO_ITER _IO_iter_next(iter) _IO_ITER iter; { - return iter->file._chain; + return iter->_chain; } _IO_FILE * _IO_iter_file(iter) _IO_ITER iter; { - return (_IO_FILE *) iter; + return iter; } void Index: libio/libio.h =================================================================== RCS file: /cvs/glibc/libc/libio/libio.h,v retrieving revision 1.41 diff -u -p -r1.41 libio.h --- libio.h 2000/06/29 07:16:41 1.41 +++ libio.h 2000/07/03 23:55:54 @@ -252,8 +252,6 @@ struct _IO_wide_data struct _IO_jump_t *_wide_vtable; }; -struct _IO_FILE_plus; - struct _IO_FILE { int _flags; /* High-order word is _IO_MAGIC; rest is flags. */ #define _IO_file_flags _flags @@ -275,7 +273,7 @@ struct _IO_FILE { struct _IO_marker *_markers; - struct _IO_FILE_plus *_chain; + struct _IO_FILE *_chain; int _fileno; int _blksize; @@ -311,6 +309,8 @@ struct _IO_FILE_complete #ifndef __cplusplus typedef struct _IO_FILE _IO_FILE; #endif + +struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; Index: libio/libioP.h =================================================================== RCS file: /cvs/glibc/libc/libio/libioP.h,v retrieving revision 1.42 diff -u -p -r1.42 libioP.h --- libioP.h 2000/06/29 07:16:41 1.42 +++ libioP.h 2000/07/03 23:55:54 @@ -323,7 +323,7 @@ struct _IO_cookie_file /* Iterator type for walking global linked list of _IO_FILE objects. */ -typedef struct _IO_FILE_plus *_IO_ITER; +typedef struct _IO_FILE *_IO_ITER; /* Generic functions */ @@ -708,12 +708,12 @@ extern int _IO_vscanf __P ((const char * # ifdef _IO_USE_OLD_IO_FILE # define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \ { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD, \ - 0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock } + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \ + 0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock } # else # define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \ { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \ 0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock, _IO_pos_BAD,\ NULL, WDP, 0 } # endif @@ -721,11 +721,12 @@ extern int _IO_vscanf __P ((const char * # ifdef _IO_USE_OLD_IO_FILE # define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \ { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD, 0, _IO_pos_BAD } + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \ + 0, _IO_pos_BAD } # else # define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \ { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \ 0, _IO_pos_BAD, 0, 0, { 0 }, 0, _IO_pos_BAD, \ NULL, WDP, 0 } # endif From drepper@redhat.com Mon Jul 3 17:46:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 03 Jul 2000 17:46:00 -0000 Subject: PATCH: revert type of _IO_FILE._chain References: <200007040041.RAA17634@kayak.mcgary.org> Message-ID: Greg McGary writes: > No binary differences. > Doesn't break build-shared or build-static. OK. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Mon Jul 3 18:04:00 2000 From: greg@mcgary.org (Greg McGary) Date: Mon, 03 Jul 2000 18:04:00 -0000 Subject: PATCH: Build csu/bcrt1.o only if build-bounded=yes Message-ID: <200007040104.SAA19315@kayak.mcgary.org> I decided to punt on building BP startup files unconditionally. BP startup files currently require `-fbounded-pointers' (which wasn't being passed because defining CPPFLAGS-.ob depends on build-bounded=yes), but that's not available in any production gcc. For now, it's best to just leave out all BP stuff unless someone asks for it. 2000-07-03 Greg McGary * csu/Makefile (extra-objs, install-lib): Add BP objects conditionally. ($(objpfx)b$(start-installed-name)): Add non-elf rule. Index: csu/Makefile =================================================================== RCS file: /cvs/glibc/libc/csu/Makefile,v retrieving revision 1.42 diff -u -p -r1.42 Makefile --- Makefile 2000/06/27 01:20:01 1.42 +++ Makefile 2000/07/04 00:58:39 @@ -30,12 +30,14 @@ subdir := csu routines = init-first libc-start $(libc-init) sysdep version check_fds csu-dummies = $(filter-out $(start-installed-name),crt1.o Mcrt1.o) extra-objs = start.o gmon-start.o \ - $(start-installed-name) g$(start-installed-name) b$(start-installed-name) \ - $(csu-dummies) + $(start-installed-name) g$(start-installed-name) $(csu-dummies) omit-deps = $(patsubst %.o,%,$(start-installed-name) g$(start-installed-name) \ b$(start-installed-name) $(csu-dummies)) -install-lib = $(start-installed-name) g$(start-installed-name) b$(start-installed-name) \ - $(csu-dummies) +install-lib = $(start-installed-name) g$(start-installed-name) $(csu-dummies) +ifeq (yes,$(build-bounded)) +extra-objs += b$(start-installed-name) +install-lib += b$(start-installed-name) +endif distribute = initfini.c gmon-start.c start.c defs.awk munch.awk \ abi-note.S init.c munch-tmpl.c generated = version-info.h @@ -137,6 +139,9 @@ else # The startfile is installed under different names, so we just call our # source file `start.c' and copy to the installed name after compiling. $(objpfx)$(start-installed-name): $(objpfx)start.o + rm -f $@ + ln $< $@ +$(objpfx)b$(start-installed-name): $(objpfx)start.ob rm -f $@ ln $< $@ endif From drepper@redhat.com Mon Jul 3 18:19:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 03 Jul 2000 18:19:00 -0000 Subject: PATCH: Build csu/bcrt1.o only if build-bounded=yes References: <200007040104.SAA19315@kayak.mcgary.org> Message-ID: Greg McGary writes: > For now, it's best to just leave out all BP stuff unless someone > asks for it. Agreed. The patch looks OK. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Jul 3 20:03:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 03 Jul 2000 20:03:00 -0000 Subject: [tb@MIT.EDU (Thomas Bushnell, BSG)] Re: RMS is at it again Message-ID: To : Frangois Pinard Subject : Re: RMS is at it again >From : tb at MIT dot EDU (Thomas Bushnell, BSG) Date : 03 Jul 2000 22:46:46 -0400 Cc : drepper at cygnus dot com (Ulrich Drepper), BSG at MIT dot EDU,GNU libc hacker References : < oqbt0i9bio.fsf@titan.progiciels-bpi.ca > [drepper, Please forward to the entire libc-hacker list for me ] =?ISO-8859-1?Q?Fran=E7ois_Pinard?= writes: > [Ulrich Drepper] > > tb@MIT.EDU (Thomas Bushnell, BSG) writes: > > > > Ah. Alas, digital signatures are not legally valid in the US or any > > > other country that I know of. > > > Ehm, isn't your president signing today the digital signature act (or > > however you are calling this thing)? > > I heard that this is limited to "smart cards". I checked up on the legislation. It is not limited to smart cards. It basically says that a digital signature has to be accepted as broadly as a regular pen-and-ink signature, even in the context of a law which specifies that a written signature is required. (It happens that transfer of copyright is such a law.) So you can now legally transfer copyright with a digital signature. That is unfortunately not good enough for our purposes yet. As with any signature, you have to prove that the real person signed it. Right now we do not have a good enough infrastructure for digital signatures to satisfy most courts, except for the cases where you can assert that Joe Schmoe gave you his PGP key (or fingerprint) when you met him in person. The validation problem remains; it is not clear how the courts will handle it, and until we know, it's probably better to stick with written signatures wherever possible. From aj@suse.de Tue Jul 4 01:15:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Tue, 04 Jul 2000 01:15:00 -0000 Subject: fpucw setting: Test and Question Message-ID: I've written a small program to test if the fpu control word is set correctly. On i686 the program outputs: $ cat math/test-fpucw.out control word is 0x37f but should be 0x137f. What's the right value? The kernel uses 0x37f but glibc also sets 0x1000 which seems to be a reserved bit. Why do we set this? What do you think of the appended patches? Andreas 2000-07-04 Andreas Jaeger * sysdeps/i386/fpu_control.h (_FPU_DEFAULT): Correct value. (_FPU_IEEE): Likewise. * math/Makefile (tests): Add test-fpucw. * math/test-fpucw.c (main): New file. ============================================================ Index: math/Makefile --- math/Makefile 2000/05/25 06:26:11 1.96 +++ math/Makefile 2000/07/04 08:07:58 @@ -79,7 +79,7 @@ # Rules for the test suite. tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \ - test-misc + test-misc test-fpucw # We do the `long double' tests only if this data type is available and # distinct from `double'. test-longdouble-yes = test-ldouble test-ildoubl ============================================================ Index: sysdeps/i386/fpu_control.h --- sysdeps/i386/fpu_control.h 1998/11/26 12:00:07 1.7 +++ sysdeps/i386/fpu_control.h 2000/07/04 08:07:58 @@ -1,5 +1,5 @@ /* FPU control word bits. i387 version. - Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1993, 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Olaf Flebbe. @@ -50,7 +50,7 @@ * IC: Infinity control * That is for 8087 and 80287 only. * - * The hardware default is 0x037f. I choose 0x1372. + * The hardware default is 0x037f which we use. */ #include @@ -80,10 +80,10 @@ /* The fdlibm code requires strict IEEE double precision arithmetic, and no interrupts for exceptions, rounding to nearest. */ -#define _FPU_DEFAULT 0x137f +#define _FPU_DEFAULT 0x037f /* IEEE: same as above. */ -#define _FPU_IEEE 0x137f +#define _FPU_IEEE 0x037f /* Type of the control word. */ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__))); ============================================================ Index: math/test-fpucw.c --- math/test-fpucw.c created +++ math/test-fpucw.c Tue Jul 4 09:59:49 2000 1.1 @@ -0,0 +1,40 @@ +/* Copyright (C) 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Andreas Jaeger , 2000. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + +int +main (void) +{ +#ifdef _FPU_GETCW +/* Some architectures don't have _FPU_GETCW (e.g. Linux/Alpha). */ + fpu_control_t cw; + + _FPU_GETCW (cw); + + if (cw != _FPU_DEFAULT) + printf ("control word is 0x%x but should be 0x%x.\n", cw, _FPU_DEFAULT); + + return (cw != _FPU_DEFAULT); + +#else + return 0; +#endif +} -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From greg@mcgary.org Tue Jul 4 09:14:00 2000 From: greg@mcgary.org (Greg McGary) Date: Tue, 04 Jul 2000 09:14:00 -0000 Subject: PATCH: fix BP_SYM stuff in libc-lock.h Message-ID: <200007041614.JAA21021@kayak.mcgary.org> This is an intermediate fix that will hold us until I move BP_SYM definitions out of libc and into gcc. 2000-07-04 Greg McGary * sysdeps/pthread/bits/libc-lock.h: Remove BP_SYM from pragmas. Include bp-sym.h only if _LIBC. Index: sysdeps/pthread/bits/libc-lock.h =================================================================== RCS file: /cvs/glibc/libc/linuxthreads/sysdeps/pthread/bits/libc-lock.h,v retrieving revision 1.14 diff -u -p -r1.14 libc-lock.h --- libc-lock.h 2000/06/27 17:05:42 1.14 +++ libc-lock.h 2000/07/04 16:11:01 @@ -246,8 +246,12 @@ extern int __pthread_atfork (void (*__pr /* Make the pthread functions weak so that we can elide them from single-threaded processes. */ #ifndef __NO_WEAK_PTHREAD_ALIASES -# include # ifdef weak_extern +# if _LIBC +# include +# else +# define BP_SYM (sym) sym +# endif weak_extern (BP_SYM (__pthread_mutex_init)) weak_extern (BP_SYM (__pthread_mutex_destroy)) weak_extern (BP_SYM (__pthread_mutex_lock)) @@ -272,28 +276,28 @@ weak_extern (__pthread_atfork) weak_extern (BP_SYM (_pthread_cleanup_push_defer)) weak_extern (BP_SYM (_pthread_cleanup_pop_restore)) # else -# pragma weak BP_SYM (__pthread_mutex_init) -# pragma weak BP_SYM (__pthread_mutex_destroy) -# pragma weak BP_SYM (__pthread_mutex_lock) -# pragma weak BP_SYM (__pthread_mutex_trylock) -# pragma weak BP_SYM (__pthread_mutex_unlock) -# pragma weak BP_SYM (__pthread_mutexattr_init) -# pragma weak BP_SYM (__pthread_mutexattr_destroy) -# pragma weak BP_SYM (__pthread_mutexattr_settype) -# pragma weak BP_SYM (__pthread_rwlock_destroy) -# pragma weak BP_SYM (__pthread_rwlock_rdlock) -# pragma weak BP_SYM (__pthread_rwlock_tryrdlock) -# pragma weak BP_SYM (__pthread_rwlock_wrlock) -# pragma weak BP_SYM (__pthread_rwlock_trywrlock) -# pragma weak BP_SYM (__pthread_rwlock_unlock) -# pragma weak BP_SYM (__pthread_key_create) -# pragma weak BP_SYM (__pthread_setspecific) -# pragma weak BP_SYM (__pthread_getspecific) -# pragma weak BP_SYM (__pthread_once) +# pragma weak __pthread_mutex_init +# pragma weak __pthread_mutex_destroy +# pragma weak __pthread_mutex_lock +# pragma weak __pthread_mutex_trylock +# pragma weak __pthread_mutex_unlock +# pragma weak __pthread_mutexattr_init +# pragma weak __pthread_mutexattr_destroy +# pragma weak __pthread_mutexattr_settype +# pragma weak __pthread_rwlock_destroy +# pragma weak __pthread_rwlock_rdlock +# pragma weak __pthread_rwlock_tryrdlock +# pragma weak __pthread_rwlock_wrlock +# pragma weak __pthread_rwlock_trywrlock +# pragma weak __pthread_rwlock_unlock +# pragma weak __pthread_key_create +# pragma weak __pthread_setspecific +# pragma weak __pthread_getspecific +# pragma weak __pthread_once # pragma weak __pthread_initialize # pragma weak __pthread_atfork -# pragma weak BP_SYM (_pthread_cleanup_push_defer) -# pragma weak BP_SYM (_pthread_cleanup_pop_restore) +# pragma weak _pthread_cleanup_push_defer +# pragma weak _pthread_cleanup_pop_restore # endif #endif From drepper@redhat.com Tue Jul 4 11:40:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 04 Jul 2000 11:40:00 -0000 Subject: PATCH: fix BP_SYM stuff in libc-lock.h References: <200007041614.JAA21021@kayak.mcgary.org> Message-ID: Greg McGary writes: > This is an intermediate fix that will hold us until I move > BP_SYM definitions out of libc and into gcc. OK. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@lucon.org Tue Jul 4 12:47:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Tue, 04 Jul 2000 12:47:00 -0000 Subject: Locale install error? Message-ID: <20000704124723.A5467@lucon.org> There are a few messages during locale install: locales/el_GR:25: character not in repertoire map locales/el_GR:25: character not in repertoire map locales/el_GR:25: LC_IDENTIFICATION: unknown character in field `address' locales/hu_HU:26: character not in repertoire map locales/hu_HU:26: character not in repertoire map locales/hu_HU:26: LC_IDENTIFICATION: unknown character in field `address' locales/ro_RO:26: character not in repertoire map locales/ro_RO:26: character not in repertoire map locales/ro_RO:26: LC_IDENTIFICATION: unknown character in field `address' Computing table size for character classes might take a while... done locales/ru_RU:26: character not in repertoire map locales/ru_RU:26: character not in repertoire map locales/ru_RU:26: LC_IDENTIFICATION: unknown character in field `address' Computing table size for character classes might take a while... done locales/ru_RU:26: character not in repertoire map locales/ru_RU:26: character not in repertoire map locales/ru_RU:26: LC_IDENTIFICATION: unknown character in field `address' locales/th_TH:91: LC_CTYPE: syntax error locales/th_TH:609: LC_COLLATE: syntax error locales/th_TH:610: LC_COLLATE: syntax error locales/th_TH:611: LC_COLLATE: syntax error locales/th_TH:612: LC_COLLATE: syntax error locales/th_TH:613: LC_COLLATE: syntax error locales/th_TH:616: LC_COLLATE: syntax error locales/th_TH:617: LC_COLLATE: syntax error locales/th_TH:618: LC_COLLATE: syntax error locales/th_TH:619: LC_COLLATE: syntax error locales/th_TH:620: LC_COLLATE: syntax error locales/th_TH:623: LC_COLLATE: syntax error locales/th_TH:624: LC_COLLATE: syntax error locales/th_TH:625: LC_COLLATE: syntax error locales/th_TH:626: LC_COLLATE: syntax error locales/th_TH:627: LC_COLLATE: syntax error locales/th_TH:630: LC_COLLATE: syntax error locales/th_TH:631: LC_COLLATE: syntax error locales/th_TH:632: LC_COLLATE: syntax error locales/th_TH:633: LC_COLLATE: syntax error locales/th_TH:634: LC_COLLATE: syntax error locales/th_TH:637: LC_COLLATE: syntax error locales/th_TH:638: LC_COLLATE: syntax error locales/th_TH:639: LC_COLLATE: syntax error locales/th_TH:640: LC_COLLATE: syntax error locales/th_TH:641: LC_COLLATE: syntax error locales/th_TH:644: LC_COLLATE: syntax error locales/th_TH:645: LC_COLLATE: syntax error locales/th_TH:646: LC_COLLATE: syntax error locales/th_TH:647: LC_COLLATE: syntax error locales/th_TH:648: LC_COLLATE: syntax error locales/th_TH:651: LC_COLLATE: syntax error locales/th_TH:652: LC_COLLATE: syntax error ..... H.J. From drepper@redhat.com Tue Jul 4 13:00:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 04 Jul 2000 13:00:00 -0000 Subject: Locale install error? References: <20000704124723.A5467@lucon.org> Message-ID: "H . J . Lu" writes: > There are a few messages during locale install: I've never tested installing locales. Let's go with the basics first. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Tue Jul 4 13:08:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 04 Jul 2000 13:08:00 -0000 Subject: Locale install error? References: <20000704124723.A5467@lucon.org> Message-ID: <20000704221149.H19552@sunsite.ms.mff.cuni.cz> On Tue, Jul 04, 2000 at 01:00:28PM -0700, Ulrich Drepper wrote: > "H . J . Lu" writes: > > > There are a few messages during locale install: > > I've never tested installing locales. Let's go with the basics first. I'm now working on a patch for this (minus th_TH)... Jakub From jakub@redhat.com Tue Jul 4 13:26:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 04 Jul 2000 13:26:00 -0000 Subject: Locale install error? References: <20000704124723.A5467@lucon.org> Message-ID: <20000704222958.I19552@sunsite.ms.mff.cuni.cz> On Tue, Jul 04, 2000 at 12:47:23PM -0700, H . J . Lu wrote: > There are a few messages during locale install: > > locales/el_GR:25: character not in repertoire map > locales/el_GR:25: character not in repertoire map > locales/el_GR:25: LC_IDENTIFICATION: unknown character in field `address' > locales/hu_HU:26: character not in repertoire map > locales/hu_HU:26: character not in repertoire map > locales/hu_HU:26: LC_IDENTIFICATION: unknown character in field `address' > locales/ro_RO:26: character not in repertoire map > locales/ro_RO:26: character not in repertoire map > locales/ro_RO:26: LC_IDENTIFICATION: unknown character in field `address' > Computing table size for character classes might take a while... done > locales/ru_RU:26: character not in repertoire map > locales/ru_RU:26: character not in repertoire map > locales/ru_RU:26: LC_IDENTIFICATION: unknown character in field `address' > Computing table size for character classes might take a while... done > locales/ru_RU:26: character not in repertoire map > locales/ru_RU:26: character not in repertoire map > locales/ru_RU:26: LC_IDENTIFICATION: unknown character in field `address' These should be probably changed to "o", I forgot they don't use ISO-8859-1 when doing the global address replacement. See below. > locales/th_TH:91: LC_CTYPE: syntax error > locales/th_TH:609: LC_COLLATE: syntax error I'm not sure how it should look like, so I'd prefer if someone else gave th_TH a shot. This patch changes the RAP addresses plus has a few LC_TELEPHONE tweaks based on user feedback plus some removed %fixmes from LC_PAPER/LC_MEASUREMENT where I was assured that they use A4 resp metric system. BTW: Uli, there is no documentation about the new LC categories, so I just had to guess what means what. What does measurement 2 and 3 mean exactly? I assume 1 is metric. Some of the countries below have no area codes (either 8 or 9 digit phone numbers for the whole country), so I've removed %a from the formats. 2000-07-04 Jakub Jelinek * locales/en_GR (LC_IDENTIFICATION): Don't use iso8859-1 characters in address. * locales/hu_HU (LC_IDENTIFICATION): Likewise. * locales/ro_RO (LC_IDENTIFICATION): Likewise. * locales/ru_RU (LC_IDENTIFICATION): Likewise. * locales/es_AR (LC_IDENTIFICATION): Fix address of RAP. * locales/es_BO (LC_IDENTIFICATION): Likewise. * locales/es_CL (LC_IDENTIFICATION): Likewise. * locales/es_CO (LC_IDENTIFICATION): Likewise. * locales/es_DO (LC_IDENTIFICATION): Likewise. * locales/es_EC (LC_IDENTIFICATION): Likewise. * locales/es_ES (LC_IDENTIFICATION): Likewise. * locales/es_GT (LC_IDENTIFICATION): Likewise. * locales/es_HN (LC_IDENTIFICATION): Likewise. * locales/es_MX (LC_IDENTIFICATION): Likewise. * locales/es_PA (LC_IDENTIFICATION): Likewise. * locales/es_PE (LC_IDENTIFICATION): Likewise. * locales/es_PY (LC_IDENTIFICATION): Likewise. * locales/es_SV (LC_IDENTIFICATION): Likewise. * locales/es_US (LC_IDENTIFICATION): Likewise. * locales/es_UY (LC_IDENTIFICATION): Likewise. * locales/es_VE (LC_IDENTIFICATION): Likewise. * locales/fr_CA (LC_IDENTIFICATION): Likewise. * locales/tr_TR (LC_IDENTIFICATION): Likewise. * locales/no_NO (LC_TELEPHONE): Fill in. * locales/pt_PT (LC_TELEPHONE): Fill in. * locales/sv_SE (LC_TELEPHONE): Fill in. * locales/en_GB (LC_TELEPHONE): Fill in. * locales/cs_CZ (LC_TELEPHONE): Fill in. --- libc/localedata/locales/el_GR.jj Tue Jul 4 21:41:10 2000 +++ libc/localedata/locales/el_GR Tue Jul 4 21:44:30 2000 @@ -22,7 +22,7 @@ escape_char / LC_IDENTIFICATION title "Greek locale for Greece" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jorgens Alle 8, DK-1615 Kobenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/hu_HU.jj Tue Jul 4 21:41:20 2000 +++ libc/localedata/locales/hu_HU Tue Jul 4 21:44:31 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Hungarian locale for Hungary" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jorgens Alle 8, DK-1615 Kobenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/ro_RO.jj Tue Jul 4 21:41:30 2000 +++ libc/localedata/locales/ro_RO Tue Jul 4 21:44:32 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Romanian locale for Romania" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jorgens Alle 8, DK-1615 Kobenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/ru_RU.jj Tue Jul 4 21:41:31 2000 +++ libc/localedata/locales/ru_RU Tue Jul 4 21:44:33 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Russian locale for Russia" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jorgens Alle 8, DK-1615 Kobenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_AR.jj Tue Jul 4 21:46:45 2000 +++ libc/localedata/locales/es_AR Tue Jul 4 21:46:47 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Argentina" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_BO.jj Tue Jul 4 21:46:47 2000 +++ libc/localedata/locales/es_BO Tue Jul 4 21:46:47 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Bolivia" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_CL.jj Tue Jul 4 21:46:47 2000 +++ libc/localedata/locales/es_CL Tue Jul 4 21:46:47 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Chile" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_CO.jj Tue Jul 4 21:46:47 2000 +++ libc/localedata/locales/es_CO Tue Jul 4 21:46:47 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Colombia" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_DO.jj Tue Jul 4 21:46:47 2000 +++ libc/localedata/locales/es_DO Tue Jul 4 21:46:47 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Dominican Republic" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_EC.jj Tue Jul 4 21:46:47 2000 +++ libc/localedata/locales/es_EC Tue Jul 4 21:46:47 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Equador" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_ES.jj Tue Jul 4 21:46:47 2000 +++ libc/localedata/locales/es_ES Tue Jul 4 21:46:48 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Spain" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_GT.jj Tue Jul 4 21:46:48 2000 +++ libc/localedata/locales/es_GT Tue Jul 4 21:46:48 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Guatemala" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_HN.jj Tue Jul 4 21:46:48 2000 +++ libc/localedata/locales/es_HN Tue Jul 4 21:46:48 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Honduras" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_MX.jj Tue Jul 4 21:46:48 2000 +++ libc/localedata/locales/es_MX Tue Jul 4 21:46:48 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Mexico" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_PA.jj Tue Jul 4 21:46:48 2000 +++ libc/localedata/locales/es_PA Tue Jul 4 21:46:48 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Panama" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_PE.jj Tue Jul 4 21:46:48 2000 +++ libc/localedata/locales/es_PE Tue Jul 4 21:46:48 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Peru" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_PY.jj Tue Jul 4 21:46:48 2000 +++ libc/localedata/locales/es_PY Tue Jul 4 21:46:48 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Paraguay" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_SV.jj Tue Jul 4 21:46:48 2000 +++ libc/localedata/locales/es_SV Tue Jul 4 21:46:49 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for El Salvador" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_US.jj Tue Jul 4 21:46:49 2000 +++ libc/localedata/locales/es_US Tue Jul 4 21:46:49 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for the USA" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_UY.jj Tue Jul 4 21:46:49 2000 +++ libc/localedata/locales/es_UY Tue Jul 4 21:46:49 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Uruguay" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/es_VE.jj Tue Jul 4 21:46:49 2000 +++ libc/localedata/locales/es_VE Tue Jul 4 21:46:49 2000 @@ -23,7 +23,7 @@ escape_char / LC_IDENTIFICATION title "Spanish locale for Venezuela" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/fr_CA.jj Tue Jul 4 21:46:49 2000 +++ libc/localedata/locales/fr_CA Tue Jul 4 21:46:49 2000 @@ -22,7 +22,7 @@ escape_char / LC_IDENTIFICATION title "French locale for Canada" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/tr_TR.jj Tue Jul 4 21:46:49 2000 +++ libc/localedata/locales/tr_TR Tue Jul 4 21:46:49 2000 @@ -28,7 +28,7 @@ escape_char / LC_IDENTIFICATION title "Turkish locale for Turkey" source "RAP" -address "Sankt Jorgens Alle 8, DK-1615 Kbenhavn V, Danmark" +address "Sankt Jrgens Alle 8, DK-1615 Kbenhavn V, Danmark" contact "" email "bug-glibc@gnu.org" tel "" --- libc/localedata/locales/no_NO.jj Tue Jul 4 21:41:29 2000 +++ libc/localedata/locales/no_NO Tue Jul 4 21:50:46 2000 @@ -2193,19 +2193,18 @@ noexpr "/ -" +tel_int_fmt "" +tel_dom_fmt "" +int_select "" +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT -% FIXME measurement 1 END LC_MEASUREMENT --- libc/localedata/locales/pt_PT.jj Tue Jul 4 21:41:30 2000 +++ libc/localedata/locales/pt_PT Tue Jul 4 21:52:51 2000 @@ -121,19 +121,18 @@ t_fmt_ampm "" END LC_TIME LC_PAPER -% FIXME height 297 -% FIXME width 210 END LC_PAPER LC_TELEPHONE -tel_int_fmt "/ -" +tel_int_fmt "" +tel_dom_fmt "" +int_select "" +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT -% FIXME measurement 1 END LC_MEASUREMENT --- libc/localedata/locales/sv_SE.jj Tue Jul 4 21:41:32 2000 +++ libc/localedata/locales/sv_SE Tue Jul 4 21:57:07 2000 @@ -2192,19 +2192,19 @@ noexpr "/ +tel_int_fmt "/ " +tel_dom_fmt "" +int_select "" +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT -% FIXME measurement 1 END LC_MEASUREMENT --- libc/localedata/locales/en_GB.jj Tue Jul 4 21:59:48 2000 +++ libc/localedata/locales/en_GB Tue Jul 4 22:00:49 2000 @@ -130,6 +130,7 @@ LC_TELEPHONE tel_int_fmt "/ " tel_dom_fmt "" +int_select "" int_prefix "" END LC_TELEPHONE --- libc/localedata/locales/cs_CZ.jj Tue Jul 4 21:41:09 2000 +++ libc/localedata/locales/cs_CZ Tue Jul 4 22:02:44 2000 @@ -2456,7 +2456,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " -tel_dom_fmt "" +tel_dom_fmt "" int_select "" int_prefix "" END LC_TELEPHONE Jakub From kettenis@wins.uva.nl Tue Jul 4 15:23:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 04 Jul 2000 15:23:00 -0000 Subject: Locale install error? References: <20000704124723.A5467@lucon.org> <20000704222958.I19552@sunsite.ms.mff.cuni.cz> Message-ID: <200007042222.e64MMYb00818@delius.kettenis.local> Date: Tue, 4 Jul 2000 22:29:58 +0200 From: Jakub Jelinek This patch changes the RAP addresses plus has a few LC_TELEPHONE tweaks based on user feedback plus some removed %fixmes from LC_PAPER/LC_MEASUREMENT where I was assured that they use A4 resp metric system. The Netherlands (nl_NL) uses A4 and the metric system too. Mark From greg@mcgary.org Tue Jul 4 19:01:00 2000 From: greg@mcgary.org (Greg McGary) Date: Tue, 04 Jul 2000 19:01:00 -0000 Subject: PATCH: fix typo in sysdeps/i386/bits/setjmp.h Message-ID: <200007050201.TAA29518@kayak.mcgary.org> OK? Index: sysdeps/i386/bits/setjmp.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/i386/bits/setjmp.h,v retrieving revision 1.5 diff -u -p -r1.5 setjmp.h --- setjmp.h 2000/06/29 22:55:30 1.5 +++ setjmp.h 2000/07/05 02:01:13 @@ -41,7 +41,7 @@ popl %ecx; /* jmp_buf value */ \ popl %edx; /* jmp_buf low bound */ \ pushl 0(%esp); /* jmp_buf high bound */ \ - movel $MASK, 4(%esp); \ + movl $MASK, 4(%esp); \ pushl %edx; \ pushl %ecx; \ pushl %eax From drepper@redhat.com Tue Jul 4 19:08:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 04 Jul 2000 19:08:00 -0000 Subject: PATCH: fix typo in sysdeps/i386/bits/setjmp.h References: <200007050201.TAA29518@kayak.mcgary.org> Message-ID: Greg McGary writes: > OK? Yup. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From gniibe@chroot.org Wed Jul 5 01:32:00 2000 From: gniibe@chroot.org (NIIBE Yutaka) Date: Wed, 05 Jul 2000 01:32:00 -0000 Subject: Locale install error? References: <20000704124723.A5467@lucon.org> <20000704222958.I19552@sunsite.ms.mff.cuni.cz> Message-ID: About locales of forthcoming 2.2 GNU C library, Jakub Jelinek wrote: > I'm not sure how it should look like, so I'd prefer if someone else gave > th_TH a shot. OK, here's the patch. I just formatted it. I don't speak Thai. Theppitak, could you please check it? 2000-07-05 NIIBE Yutaka * locales/th_TH: Update revision information. (LC_CTYPE: alpha): Replace ";...;" with "..". (LC_COLLATE: order): Quote with "". Index: localedata/locales/th_TH =================================================================== RCS file: /cvs/glibc/libc/localedata/locales/th_TH,v retrieving revision 1.6 diff -u -r1.6 th_TH --- th_TH 2000/06/29 19:07:29 1.6 +++ th_TH 2000/07/05 08:21:45 @@ -16,9 +16,9 @@ % E-mail: thep@links.nectec.or.th % Language: Thai % Territory: Thailand -% Charset: TIS-620:1990 -% Revision: 0.5.2 -% Date: 1995-04-02 +% Charset: TIS-620.2533:1990 +% Revision: 0.5.3 +% Date: 1999-05-28 % % @@ -88,8 +88,8 @@ ;;;;;;;;;;;;;/ ;;;;;;;;;;;;;/ ;;;;;;;;;;;;;/ - ;...;;;...;;;...;;/ - ;;;...;; + ..;..;..;/ + ;;..; % % digit = Arabic digits + Thai digits @@ -97,7 +97,7 @@ digit ;;;;;/ ;;;; % The Thai digits -% ;...; +% .. % cannot be listed here. In glibc 2.2 they'll be in indigits and % possibly outdigits. @@ -606,316 +606,316 @@ % Thai consonants, with leading vowels rearrangement % ;;; % THAI CHARACTER KO KAI - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER KHO KHAI - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER KHO KHUAT - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER KHO KHWAI - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER KHO KHON - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER KHO RAKHANG - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER NGO NGU - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER CHO CHAN - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER CHO CHING - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER CHO CHANG - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER SO SO - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER CHO CHOE - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER YO YING - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER DO CHADA - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER TO PATAK - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER THO THAN - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER THO NANGMONTHO - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER THO PHUTHAO - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER NO NEN - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER DO DEK - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER TO TAO - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER THO THUNG - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER THO THAHAN - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER THO THONG - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER NO NU - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER BO BAIMAI - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER PO PLA - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER PHO PHUNG - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER FO FA - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER PHO PHAN - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER FO FAN - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER PHO SAMPHAO - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER MO MA - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER YO YAK - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER RO RUA - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER RU ;;; % THAI CHARACTER LO LING - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER LU ;;; % THAI CHARACTER WO WAEN - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER SO SALA - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER SO RUSI - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER SO SUA - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER HO HIP - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER LO CHULA - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER O ANG - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER HO NOKHUK - ;;; - ;;; - ;;; - ;;; - ;;; + "";;; + "";;; + "";;; + "";;; + "";;; ;;; % THAI CHARACTER NIKHAHIT -- From aj@arthur.inka.de Wed Jul 5 04:53:00 2000 From: aj@arthur.inka.de (Andreas Jaeger) Date: Wed, 05 Jul 2000 04:53:00 -0000 Subject: crypt add-on dokumentation patch Message-ID: I've updated the FAQ and the install file to reflect that crypt is no longer an addon. Ok to commit? Andreas 2000-07-05 Andreas Jaeger * manual/install.texi (Installation): Update information about add-ons. (Configuring and compiling): Update for glibc 2.2. ============================================================ Index: FAQ.in --- FAQ.in 2000/04/21 03:37:35 1.102 +++ FAQ.in 2000/07/05 11:53:11 @@ -217,8 +217,8 @@ ??addon What are these `add-ons'? {UD} To avoid complications with export rules or external source code some -optional parts of the libc are distributed as separate packages (e.g., the -crypt package, see ?crypt). +optional parts of the libc are distributed as separate packages, e.g., the +linuxthreads package. To use these packages as part of GNU libc, just unpack the tarfiles in the libc source directory and tell the configuration script about them using the @@ -227,7 +227,7 @@ it doesn't, or if you want to select only a subset of the add-ons, give a comma-separated list of the add-ons to enable: - configure --enable-add-ons=crypt,linuxthreads + configure --enable-add-ons=linuxthreads for example. @@ -237,9 +237,13 @@ must be written to get everything running. Most add-ons are tightly coupled to a specific GNU libc version. Please -check that the add-ons work with the GNU libc. For example the crypt and -linuxthreads add-ons have the same numbering scheme as the libc and will in -general only work with the corresponding libc. +check that the add-ons work with the GNU libc. For example the linuxthreads +add-on has the same numbering scheme as the libc and will in general only +work with the corresponding libc. + +{AJ} With glibc 2.2 the crypt add-on and with glibc 2.1 the localedata +add-on have been integrated into the normal glibc distribution, crypt and +localedata are therefore not anymore add-ons. ?? My XXX kernel emulates a floating-point coprocessor for me. Should I enable --with-fp? @@ -472,20 +476,8 @@ `crypt' and `setkey'. Why aren't these functions in the libc anymore? -{UD} The US places restrictions on exporting cryptographic programs and -source code. Until this law gets abolished we cannot ship the cryptographic -functions together with glibc. - -The functions are available, as an add-on (see ?addon). People in the US -may get it from the same place they got GNU libc from. People outside the -US should get the code from ftp.gwdg.de [134.76.11.100] in the directory -pub/linux/glibc, or another archive site outside the USA. The README explains -how to install the sources. - -If you already have the crypt code on your system the reason for the failure -is probably that you did not link with -lcrypt. The crypto functions are in -a separate library to make it possible to export GNU libc binaries from the -US. + +Removed. Does not apply anymore. ?? When I use GNU libc on my Linux system by linking against the libc.so which comes with glibc all I get is a core dump. ============================================================ Index: manual/install.texi --- manual/install.texi 2000/04/21 03:42:25 1.41 +++ manual/install.texi 2000/07/05 11:53:13 @@ -15,9 +15,9 @@ separate tarfiles which you unpack into the top level of the source tree. Then you give @code{configure} the @samp{--enable-add-ons} option to activate them, and they will be compiled into the library. As of the -2.1 release, two important components of glibc are distributed as -``official'' add-ons. Unless you are doing an unusual installation, you -should get them both. +2.2 release, one important component of glibc is distributed as +``official'' add-ons: the linuxthreads add-on. Unless you are doing an +unusual installation, you should get this. Support for POSIX threads is maintained by someone else, so it's in a separate package. It is only available for Linux systems, but this will @@ -43,7 +43,7 @@ GNU libc can be compiled in the source directory, but we strongly advise to build it in a separate build directory. For example, if you have unpacked -the glibc sources in @file{/src/gnu/glibc-2.1.0}, create a directory +the glibc sources in @file{/src/gnu/glibc-2.2.0}, create a directory @file{/src/gnu/glibc-build} to put the object files in. This allows removing the whole build directory in case an error occurs, which is the safest way to get a fresh start and should always be done. @@ -52,7 +52,7 @@ at the top level of the source tree. In the scenario above, you'd type @smallexample -$ ../glibc-2.1.0/configure @var{args...} +$ ../glibc-2.2.0/configure @var{args...} @end smallexample Please note that even if you're building in a separate build directory, -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From aj@arthur.inka.de Wed Jul 5 06:24:00 2000 From: aj@arthur.inka.de (Andreas Jaeger) Date: Wed, 05 Jul 2000 06:24:00 -0000 Subject: Some warnings fixed Message-ID: FYI: I've commited the appended patch to fix these warnings: fnmatch_loop.c:383: warning: unused variable `len' ../sysdeps/generic/rawmemchr.c: In function `__rawmemchr': ../sysdeps/generic/rawmemchr.c:93: warning: implicit declaration of function `abort' ../sysdeps/generic/strchrnul.c: In function `__strchrnul': ../sysdeps/generic/strchrnul.c:69: warning: implicit declaration of function `abort' Andreas 2000-07-05 Andreas Jaeger * posix/fnmatch_loop.c (FCT): Only declare len if !WIDE_CHAR_VERSION to silence GCC. * sysdeps/generic/rawmemchr.c: Include for abort prototype. * sysdeps/generic/strchrnul.c: Likewise. ============================================================ Index: posix/fnmatch_loop.c --- posix/fnmatch_loop.c 2000/07/04 23:26:24 1.9 +++ posix/fnmatch_loop.c 2000/07/05 13:17:31 @@ -380,7 +380,9 @@ /* We found a table entry. Now see whether the character we are currently at has the same equivalance class value. */ +# if !WIDE_CHAR_VERSION int len = weights[idx]; +# endif int32_t idx2; const UCHAR *np = (const UCHAR *) n; ============================================================ Index: sysdeps/generic/rawmemchr.c --- sysdeps/generic/rawmemchr.c 1999/06/14 09:25:07 1.2 +++ sysdeps/generic/rawmemchr.c 2000/07/05 13:17:31 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1996, 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1991,93,96,97,99,2000 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), with help from Dan Sahlin (dan@sics.se) and commentary by Jim Blandy (jimb@ai.mit.edu); @@ -34,6 +34,7 @@ #if defined (_LIBC) # include # include +# include #else # define reg_char char #endif ============================================================ Index: sysdeps/generic/strchrnul.c --- sysdeps/generic/strchrnul.c 1999/06/14 09:25:09 1.2 +++ sysdeps/generic/strchrnul.c 2000/07/05 13:17:31 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 93, 94, 95, 96, 97, 99 Free Software Foundation, Inc. +/* Copyright (C) 1991,93,94,95,96,97,99,2000 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), with help from Dan Sahlin (dan@sics.se) and bug fix and commentary by Jim Blandy (jimb@ai.mit.edu); @@ -22,6 +22,7 @@ #include #include +#include #undef __strchrnul #undef strchrnul -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From drepper@redhat.com Wed Jul 5 15:17:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 05 Jul 2000 15:17:00 -0000 Subject: fpucw setting: Test and Question References: Message-ID: Andreas Jaeger writes: > On i686 the program outputs: > > $ cat math/test-fpucw.out > control word is 0x37f but should be 0x137f. > > What's the right value? The kernel uses 0x37f but glibc also sets > 0x1000 which seems to be a reserved bit. Why do we set this? It doesn't matter. The 0x1000 bit is only interesting for 8087 and 80287. We can go to 0x37f. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Jul 5 15:26:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 05 Jul 2000 15:26:00 -0000 Subject: Locale install error? References: <20000704124723.A5467@lucon.org> <20000704222958.I19552@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > This patch changes the RAP addresses plus has a few LC_TELEPHONE tweaks > based on user feedback plus some removed %fixmes from > LC_PAPER/LC_MEASUREMENT where I was assured that they use A4 resp metric > system. Thanks, I've applied the patch. > BTW: Uli, there is no documentation about the new LC categories, I've started writing but it takes a while... > so I just had to guess what means what. What does measurement 2 and > 3 mean exactly? 1 means metric, 2 means the US system, 3 everything else. This is weak, I know, and we can certainly change it. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Jul 5 15:28:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 05 Jul 2000 15:28:00 -0000 Subject: Locale install error? References: <20000704124723.A5467@lucon.org> <20000704222958.I19552@sunsite.ms.mff.cuni.cz> Message-ID: NIIBE Yutaka writes: > OK, here's the patch. I just formatted it. I don't speak Thai. Thanks, I've added it. We can change it later if necessary. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Jul 5 15:28:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 05 Jul 2000 15:28:00 -0000 Subject: crypt add-on dokumentation patch References: Message-ID: Andreas Jaeger writes: > I've updated the FAQ and the install file to reflect that crypt is no > longer an addon. > > Ok to commit? I just did. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Wed Jul 5 16:48:00 2000 From: greg@mcgary.org (Greg McGary) Date: Wed, 05 Jul 2000 16:48:00 -0000 Subject: PATCH: syscall thunk rewrite Message-ID: <200007052348.QAA31385@kayak.mcgary.org> Syscall BP thunks now do full checks. The following don't get auto-gen'ed thunks because no libc header files contain their prototype decls (I'll handle that later): capget capset get_kernel_syms modify_ldt nfsservctl query_module uselib The following don't get auto-gen'ed thunks because they have complex interfaces that require hand-written code to handle properly (I'll write them later): ioctl fnctl No build-time regressions for build-shared & build-static on i686. No binary differences for non-BP. OK? 2000-07-05 Greg McGary * sysdeps/generic/bp-checks.h: New file. * sysdeps/generic/bp-thunks.h: Replace generic thunk definitions with list of #include files. * sysdeps/unix/make-syscalls.sh: Handle new arg signature keyletters a, b, B, f, n, N, P, v, V. Fixup some indentation. Don't generate BP thunk if `V' appears in signature. Generate thunks with complete bounds checks. * sysdeps/unix/syscalls.list: Refine signatures using new keyletters. * sysdeps/unix/inet/syscalls.list: Likewise. * sysdeps/unix/mman/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/powerpc/syscalls.list: Likewise. Index: sysdeps/generic/bp-checks.h =================================================================== RCS file: bp-checks.h diff -N bp-checks.h --- /dev/null Tue May 5 13:32:27 1998 +++ bp-checks.h Wed Jul 5 16:32:10 2000 @@ -0,0 +1,98 @@ +/* Bounded-pointer checking macros for C. + Copyright (C) 2000 Free Software Foundation, Inc. + Contributed by Greg McGary + + This file is part of the GNU C Library. Its master source is NOT part of + the C library, however. The master source lives in the GNU MP Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _bp_checks_h_ +# define _bp_checks_h_ 1 + +# if !__ASSEMBLER__ + +# if __BOUNDED_POINTERS__ + +/* GKM FIXME: when gcc is ready, add real bounds checks */ +# define BOUNDS_VIOLATED (__builtin_trap (), 0) +extern int __ubp_memchr (const char *__unbounded, int, unsigned); + +/* Verify that pointer's value >= low. Return pointer value. */ +# define CHECK_BOUNDS_LOW(ARG) \ + (((__ptrvalue (ARG) < __ptrlow (ARG)) && BOUNDS_VIOLATED), \ + __ptrvalue (ARG)) + +/* Verify that pointer's value < high. Return pointer value. */ +# define CHECK_BOUNDS_HIGH(ARG) \ + (((__ptrvalue (ARG) > __ptrhigh (ARG)) && BOUNDS_VIOLATED), \ + __ptrvalue (ARG)) + +/* Check bounds of a pointer seated to a single object. */ +# define CHECK_1(ARG) CHECK_N ((ARG), 1) + +/* Same as CHECK_1, but tolerate ARG == NULL. */ +# define CHECK_1opt(ARG) CHECK_Nopt ((ARG), 1) + +/* Check bounds of a pointer seated to an array of N objects. */ +# define CHECK_N(ARG, N) \ + (((__ptrvalue (ARG) < __ptrlow (ARG) \ + || __ptrvalue (ARG) + (N) > __ptrhigh (ARG)) \ + && BOUNDS_VIOLATED), __ptrvalue (ARG)) + +/* Same as CHECK_N, but tolerate ARG == NULL. */ +# define CHECK_Nopt(ARG, N) \ + (((__ptrvalue (ARG) \ + && (__ptrvalue (ARG) < __ptrlow (ARG) \ + || __ptrvalue (ARG) + (N) > __ptrhigh (ARG))) \ + && BOUNDS_VIOLATED), __ptrvalue (ARG)) + +/* Check for NUL-terminator within string's bounds. */ +# define CHECK_STRING(ARG) \ + (((__ptrvalue (ARG) < __ptrlow (ARG) \ + || !__ubp_memchr (__ptrvalue (ARG), '\0', \ + (__ptrhigh (ARG) - __ptrvalue (ARG)))) \ + && BOUNDS_VIOLATED), \ + __ptrvalue (ARG)) + +# else /* !__BOUNDED_POINTERS__ */ + +/* Do nothing if not compiling with -fbounded-pointers. */ + +# define BOUNDS_VIOLATED +# define CHECK_BOUNDS_LOW(ARG) (ARG) +# define CHECK_BOUNDS_HIGH(ARG) (ARG) +# define CHECK_1(ARG) (ARG) +# define CHECK_1opt(ARG) (ARG) +# define CHECK_N(ARG, N) (ARG) +# define CHECK_Nopt(ARG, N) (ARG) +# define CHECK_STRING(ARG) (ARG) + +# endif /* !__BOUNDED_POINTERS__ */ + +# if defined (_IOC_SIZESHIFT) && defined (_IOC_SIZEBITS) + +/* Extract the size of the ioctl parameter argument and check its bounds. */ +# define CHECK_IOCTL(ARG, CMD) \ + CHECK_N ((ARG), (((CMD) >> _IOC_SIZESHIFT) & ((1 << _IOC_SIZEBITS) - 1))) + +# else +# define CHECK_IOCTL(ARG, CMD) __ptrvalue (ARG) +# endif + +# endif /* !__ASSEMBLER__ */ + +#endif /* _bp_checks_h_ */ Index: sysdeps/generic/bp-thunks.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/generic/bp-thunks.h,v retrieving revision 1.1 diff -u -p -r1.1 bp-thunks.h --- bp-thunks.h 2000/06/13 07:30:58 1.1 +++ bp-thunks.h 2000/07/05 23:32:10 @@ -1,4 +1,4 @@ -/* Bounded-pointer thunk definitions. +/* Bounded-pointer syscall thunk support. Copyright (C) 2000 Free Software Foundation, Inc. Contributed by Greg McGary @@ -23,203 +23,39 @@ #ifndef _bpthunks_h_ #define _bpthunks_h_ -#include - -#define BP_ALIAS(STRONG, ALIAS) weak_alias (__BP_##STRONG, __BP_##ALIAS) +/* This header is included by the syscall BP thunks defined in + sysd-syscalls, as created by sysdeps/unix/make-syscalls.sh. It + includes all headers that contain prototype declarations for system + call functions. */ -#define PV(P) __ptrvalue (P) -#define SV(S) __ptrvalue (S) -#define PB(P) __ptrlow (P) -#define PE(P) __ptrhigh (P) -#define voidp void *__bounded -#define charp char *__bounded - -/* GKM FIXME: Add code to check bounds. Right now, they only strip bounds, */ - -#define BP_THUNK_i_iiip(NAME) __unbounded { \ - extern int NAME (int, int, int, void *); \ - int __BP_##NAME (int i0, int i1, int i2, voidp p3) \ - { return NAME (i0, i1, i2, PV (p3)); } } - -#define BP_THUNK_i_iiipi(NAME) __unbounded { \ - extern int NAME (int, int, int, void *, int); \ - int __BP_##NAME (int i0, int i1, int i2, voidp p3, int i4) \ - { return NAME (i0, i1, i2, PV (p3), i4); } } - -#define BP_THUNK_i_iiipp(NAME) __unbounded { \ - extern int NAME (int, int, int, void *, void *); \ - int __BP_##NAME (int i0, int i1, int i2, voidp p3, voidp p4) \ - { return NAME (i0, i1, i2, PV (p3), PV (p4)); } } - -#define BP_THUNK_i_iip(NAME) __unbounded { \ - extern int NAME (int, int, void *); \ - int __BP_##NAME (int i0, int i1, voidp p2) \ - { return NAME (i0, i1, PV (p2)); } } - -#define BP_THUNK_i_iipi(NAME) __unbounded { \ - extern int NAME (int, int, void *, int); \ - int __BP_##NAME (int i0, int i1, voidp p2, int i3) \ - { return NAME (i0, i1, PV (p2), i3); } } - -#define BP_THUNK_i_iipp(NAME) __unbounded { \ - extern int NAME (int, int, void *, void *); \ - int __BP_##NAME (int i0, int i1, voidp p2, voidp p3) \ - { return NAME (i0, i1, PV (p2), PV (p3)); } } - -#define BP_THUNK_i_ip(NAME) __unbounded { \ - extern int NAME (int, void *); \ - int __BP_##NAME (int i0, voidp p1) \ - { return NAME (i0, PV (p1)); } } - -#define BP_THUNK_i_ipi(NAME) __unbounded { \ - extern int NAME (int, void *, int); \ - int __BP_##NAME (int i0, voidp p1, int i2) \ - { return NAME (i0, PV (p1), i2); } } - -#define BP_THUNK_i_ipii(NAME) __unbounded { \ - extern int NAME (int, void *, int, int); \ - int __BP_##NAME (int i0, voidp p1, int i2, int i3) \ - { return NAME (i0, PV (p1), i2, i3); } } - -#define BP_THUNK_i_ipiii(NAME) __unbounded { \ - extern int NAME (int, void *, int, int, int); \ - int __BP_##NAME (int i0, voidp p1, int i2, int i3, int i4) \ - { return NAME (i0, PV (p1), i2, i3, i4); } } - -#define BP_THUNK_i_ipiipi(NAME) __unbounded { \ - extern int NAME (int, void *, int, int, void *, int); \ - int __BP_##NAME (int i0, voidp p1, int i2, int i3, voidp p4, int i5) \ - { return NAME (i0, PV (p1), i2, i3, PV (p4), i5); } } - -#define BP_THUNK_i_ipiipp(NAME) __unbounded { \ - extern int NAME (int, void *, int, int, void *, void *); \ - int __BP_##NAME (int i0, voidp p1, int i2, int i3, voidp p4, voidp p5) \ - { return NAME (i0, PV (p1), i2, i3, PV (p4), PV (p5)); } } - -#define BP_THUNK_i_ipip(NAME) __unbounded { \ - extern int NAME (int, void *, int, void *); \ - int __BP_##NAME (int i0, voidp p1, int i2, voidp p3) \ - { return NAME (i0, PV (p1), i2, PV (p3)); } } - -#define BP_THUNK_i_ipp(NAME) __unbounded { \ - extern int NAME (int, void *, void *); \ - int __BP_##NAME (int i0, voidp p1, voidp p2) \ - { return NAME (i0, PV (p1), PV (p2)); } } - -#define BP_THUNK_i_ippi(NAME) __unbounded { \ - extern int NAME (int, void *, void *, int); \ - int __BP_##NAME (int i0, voidp p1, voidp p2, int i3) \ - { return NAME (i0, PV (p1), PV (p2), i3); } } - -#define BP_THUNK_i_ipppp(NAME) __unbounded { \ - extern int NAME (int, void *, void *, void *, void *); \ - int __BP_##NAME (int i0, voidp p1, voidp p2, voidp p3, voidp p4) \ - { return NAME (i0, PV (p1), PV (p2), PV (p3), PV (p4)); } } - -#define BP_THUNK_i_isi(NAME) __unbounded { \ - extern int NAME (int, char *, int); \ - int __BP_##NAME (int i0, charp s1, int i2) \ - { return NAME (i0, SV (s1), i2); } } - -#define BP_THUNK_i_isip(NAME) __unbounded { \ - extern int NAME (int, char *, int, void *); \ - int __BP_##NAME (int i0, charp s1, int i2, voidp p3) \ - { return NAME (i0, SV (s1), i2, PV (p3)); } } - -#define BP_THUNK_i_p(NAME) __unbounded { \ - extern int NAME (void *); \ - int __BP_##NAME (voidp p0) \ - { return NAME (PV (p0)); } } - -#define BP_THUNK_i_pi(NAME) __unbounded { \ - extern int NAME (void *, int); \ - int __BP_##NAME (voidp p0, int i1) \ - { return NAME (PV (p0), i1); } } - -#define BP_THUNK_i_pii(NAME) __unbounded { \ - extern int NAME (void *, int, int); \ - int __BP_##NAME (voidp p0, int i1, int i2) \ - { return NAME (PV (p0), i1, i2); } } - -#define BP_THUNK_i_piii(NAME) __unbounded { \ - extern int NAME (void *, int, int, int); \ - int __BP_##NAME (voidp p0, int i1, int i2, int i3) \ - { return NAME (PV (p0), i1, i2, i3); } } - -#define BP_THUNK_i_pp(NAME) __unbounded { \ - extern int NAME (void *, void *); \ - int __BP_##NAME (voidp p0, voidp p1) \ - { return NAME (PV (p0), PV (p1)); } } - -#define BP_THUNK_i_pppi(NAME) __unbounded { \ - extern int NAME (void *, void *, void *, int); \ - int __BP_##NAME (voidp p0, voidp p1, voidp p2, int i3) \ - { return NAME (PV (p0), PV (p1), PV (p2), i3); } } - -#define BP_THUNK_i_s(NAME) __unbounded { \ - extern int NAME (char *); \ - int __BP_##NAME (charp s0) \ - { return NAME (SV (s0)); } } - -#define BP_THUNK_i_si(NAME) __unbounded { \ - extern int NAME (char *, int); \ - int __BP_##NAME (charp s0, int i1) \ - { return NAME (SV (s0), i1); } } - -#define BP_THUNK_i_sii(NAME) __unbounded { \ - extern int NAME (char *, int, int); \ - int __BP_##NAME (charp s0, int i1, int i2) \ - { return NAME (SV (s0), i1, i2); } } - -#define BP_THUNK_i_sipip(NAME) __unbounded { \ - extern int NAME (char *, int, void *, int, void *); \ - int __BP_##NAME (charp s0, int i1, voidp p2, int i3, voidp p4) \ - { return NAME (SV (s0), i1, PV (p2), i3, PV (p4)); } } - -#define BP_THUNK_i_sp(NAME) __unbounded { \ - extern int NAME (char *, void *); \ - int __BP_##NAME (charp s0, voidp p1) \ - { return NAME (SV (s0), PV (p1)); } } - -#define BP_THUNK_i_spi(NAME) __unbounded { \ - extern int NAME (char *, void *, int); \ - int __BP_##NAME (charp s0, voidp p1, int i2) \ - { return NAME (SV (s0), PV (p1), i2); } } - -#define BP_THUNK_i_spp(NAME) __unbounded { \ - extern int NAME (char *, void *, void *); \ - int __BP_##NAME (charp s0, voidp p1, voidp p2) \ - { return NAME (SV (s0), PV (p1), PV (p2)); } } - -#define BP_THUNK_i_ss(NAME) __unbounded { \ - extern int NAME (char *, char *); \ - int __BP_##NAME (charp s0, charp s1) \ - { return NAME (SV (s0), s1); } } - -#define BP_THUNK_i_sssip(NAME) __unbounded { \ - extern int NAME (char *, char *, char *, int, void *); \ - int __BP_##NAME (charp s0, charp s1, charp s2, int i3, voidp p4) \ - { return NAME (SV (s0), SV (s1), SV (s2), i3, PV (p4)); } } - -/* sstk */ -#define BP_THUNK_p_i(NAME) __unbounded { \ - extern void *NAME (int); \ - voidp __BP_##NAME (int i0) \ - { charp m; PV (m) = PB (m) = NAME (i0); \ - PE (m) = PV (m) + i0; return m; } } - -/* mremap */ -#define BP_THUNK_p_piii(NAME) __unbounded { \ - extern void *NAME (void *, int, int, int); \ - voidp __BP_##NAME (voidp p0, int i1, int i2, int i3) \ - { charp m; PV (m) = PB (m) = NAME (PV (p0), i1, i2, i3); \ - PE (m) = PV (m) + i2; return m; } } - -/* mmap */ -#define BP_THUNK_p_piiiii(NAME) __unbounded { \ - extern void *NAME (void *, int, int, int, int, int); \ - voidp __BP_##NAME (voidp p0, int i1, int i2, int i3, int i4, int i5) \ - { charp m; PV (m) = PB (m) = NAME (PV (p0), i1, i2, i3, i4, i5); \ - PE (m) = PV (m) + i1; return m; } } +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif /* _bpthunks_h_ */ Index: sysdeps/unix/make-syscalls.sh =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/make-syscalls.sh,v retrieving revision 1.16 diff -u -p -r1.16 make-syscalls.sh --- make-syscalls.sh 2000/06/30 01:11:14 1.16 +++ make-syscalls.sh 2000/07/05 23:32:10 @@ -3,6 +3,37 @@ # Usage: make-syscalls.sh ../sysdeps/unix/common # Expects $sysdirs in environment. +############################################################################## + +# Syscall Signature Key Letters for BP Thunks: +# +# a: unchecked address (e.g., 1st arg to mmap) +# b: non-NULL buffer (e.g., 2nd arg to read) +# B: optionally-NULL buffer (e.g., 4th arg to getsockopt) +# f: buffer of 2 ints (e.g., 4th arg to socketpair) +# i: scalar (any signedness & size: int, long, long long, enum, whatever) +# n: scalar buffer length (e.g., 3rd arg to read) +# N: pointer to value/return scalar buffer length (e.g., 6th arg to recvfrom) +# p: pointer to typed object (e.g., any non-void* arg) +# P: pointer return value (e.g., return value from mmap) +# s: string (e.g., 1st arg to open) +# v: vararg scalar (e.g., optional 3rd arg to open) +# V: vararg pointer (e.g., 3rd arg to fcntl & ioctl) + +ptrlet='[abBfNpPs]' +argdig='[1-9]' +fixarg='[^vV]'$argdig # fixed args (declare extern) +strarg=s$argdig # string arg (check with CHECK_STRING) +twoarg=f$argdig # fd pair arg (check with CHECK_N (..., 2) +objarg=p$argdig # object arg (check with CHECK_1) +ptrarg=$ptrlet$argdig # pointer arg (toss bounds) +rtnarg='P'$argdig # pointer return value (add bounds) +bufarg='[bB]'$argdig # buffer arg (check with CHECK_N) +intarg='[inv]'$argdig # scalar arg +borarg='[iv]'$argdig # boring arg (just pass it through) + +############################################################################## + thisdir=$1; shift echo '' @@ -40,11 +71,12 @@ done` test -n "$calls" || exit 0 # Emit rules to compile the syscalls remaining in $calls. -echo "$calls" | while read file srcfile caller syscall args strong weak; do +echo "$calls" | +while read file srcfile caller syscall args strong weak; do -# Figure out if $syscall is defined with a number in syscall.h. -callnum=- -eval `{ echo "#include "; + # Figure out if $syscall is defined with a number in syscall.h. + callnum=- + eval `{ echo "#include "; echo "callnum=SYS_ify ($syscall)"; } | $asm_CPP - |sed -n -e "/^callnum=.*$syscall/d" \ -e "/^\(callnum=\)[ ]*\(.*\)/s//\1'\2'/p"` @@ -66,7 +98,9 @@ eval `{ echo "#include "; # Make sure only the first syscall rule is used, if multiple dirs # define the same syscall. - echo "#### CALL=$file NUMBER=$callnum ARGS=$args SOURCE=$srcfile" + echo '' + echo "#### CALL=$file NUMBER=$callnum ARGS=$args SOURCE=$srcfile" + case x$srcfile"$callnum" in x*-) ;; ### Do nothing for undefined callnum x-*) @@ -156,23 +190,102 @@ shared-only-routines += $file esac case x"$callnum",$srcfile,$args in - x-,-,*) ;; - x*,-,*[sp]* | x*,*.[sS],*[sp]*) + x-,-,* | x*,*.[sS],*V*) ;; + x*,-,*$ptrlet* | x*,*.[sS],*$ptrlet*) + + # find the name without leading underscores + set `echo $strong $weak |tr -s ' \t' '\12' |sed '/^_/d'` + callname=$1 + + # convert signature string to individual numbered arg names + # e.g., i:ipbN -> i0 i1 p2 b3 N4 + set `echo $args | + sed -e 's/^\(.\):\(.*\)/\2 \10/' \ + -e 's/^\([^ ]\)\(.*\)/\2 \11/' \ + -e 's/^\([^ ]\)\(.*\)/\2 \12/' \ + -e 's/^\([^ ]\)\(.*\)/\2 \13/' \ + -e 's/^\([^ ]\)\(.*\)/\2 \14/' \ + -e 's/^\([^ ]\)\(.*\)/\2 \15/' \ + -e 's/^\([^ ]\)\(.*\)/\2 \16/' \ + -e 's/^\([^ ]\)\(.*\)/\2 \17/' \ + -e 's/^\([^ ]\)\(.*\)/\2 \18/' \ + -e 's/^\([^ ]\)\(.*\)/\2 \19/'` + rtn=$1; shift + args=$* + arglist=`echo $* |sed 's/ /, /g'` + + # The best way to understand what's going on here is to examine + # the output in BUILDDIR/sysd-syscalls. + + # generate makefile envelope & rule head echo "ifeq (,\$(filter $file,\$(bp-thunks)))" - echo "bp-thunks += $file"; + echo "bp-thunks += $file" + echo "\$(objpfx)\$(bppfx)$file.ob: \$(common-objpfx)s-proto.d" + + # generate macro head & thunk prologue echo "\ -\$(objpfx)\$(bppfx)$file.ob: \$(common-objpfx)s-proto.d - (echo '#include '; \\ - echo 'BP_THUNK_`echo $args |tr : _` ($strong)'; \\" + (echo '#define $callname($arglist) r0, $rtn; \\'; \\ + echo '`echo $args | \ + sed -e 's/\('$fixarg'\)/extern \1, \1v;/g' \ + -e 's/\(v'$argdig'\)/extern int \1v;/g'` \\'; \\ + echo '__typeof (r0) BP_SYM ($strong) (`echo $args | \ + sed -e 's/ /, /g' \ + -e 's/\('$ptrarg'\)/__typeof (\1v) *__bounded \1a/g' \ + -e 's/\('$intarg'\)/__typeof (\1v) \1a/g'`) { \\'; \\ + echo ' extern __typeof (r0) ($callname) (`echo $args | \ + sed -e 's/ /, /g' \ + -e 's/\('$ptrarg'\)/__typeof (\1v) *__unbounded/g' \ + -e 's/\('$intarg'\)/__typeof (\1v)/g'`); \\'; \\" + + # generate thunk bounds checks + for arg; do + next=$2; shift + case $arg in + B$argdig) echo " echo ' __ptrvalue (${arg}a) && \\'; \\" ;; + esac + case $arg in + n$argdig) len=$arg ;; ### save for possible use with return value. + $strarg) echo " echo ' CHECK_STRING (${arg}a); \\'; \\" ;; + $objarg) echo " echo ' CHECK_1 (${arg}a); \\'; \\" ;; + $twoarg) echo " echo ' CHECK_N (${arg}a, 2); \\'; \\" ;; + $bufarg) + case $next in + n$argdig) echo " echo ' CHECK_N (${arg}a, ${next}a); \\'; \\" ;; + N$argdig) echo " echo ' CHECK_N (${arg}a, *CHECK_1 (${next}a)); \\'; \\" ;; + *) echo "### BP Thunk Error: Expected length after buffer ###" ;; + esac ;; + esac + done + # generate thunk epilogue + funcall="($callname) (`echo $args | \ + sed -e 's/ /, /g' \ + -e 's/\('$ptrarg'\)/__ptrvalue (\1a)/g' \ + -e 's/\('$intarg'\)/\1a/g'`)" + case $rtn in + P*) echo " echo '{ __typeof ($rtn) *__bounded rtn; \\'; \\ + echo ' __ptrlow (rtn) = __ptrvalue (rtn) = $funcall; \\'; \\ + echo ' __ptrhigh (rtn) = __ptrlow (rtn) + ${len}a; return rtn; } \\'; \\" ;; + *) echo " echo ' return $funcall; \\'; \\" ;; + esac + echo " echo '} \\'; \\" + + # generate thunk aliases for name in $weak; do case $name in *@*) ;; - *) echo " echo 'BP_ALIAS ($strong, $name)'; \\" ;; + *) echo " echo 'weak_alias (BP_SYM ($strong), BP_SYM ($name)) \\'; \\" ;; esac done - - echo ' ) | $(COMPILE.c) -x c -o $@ -' + # wrap up + echo "\ + echo ''; \\ + echo '#include '; \\ + ) | \$(COMPILE.c) -x c -o \$@ -" +### Use this for debugging intermediate output: +### echo ' ) >$(@:.ob=.c) +### $(subst -c,-E,$(COMPILE.c)) -o $(@:.ob=.ib) $(@:.ob=.c) +### $(COMPILE.c) -x cpp-output -o $@ $(@:.ob=.ib)' echo endif ;; esac Index: sysdeps/unix/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/syscalls.list,v retrieving revision 1.13 diff -u -p -r1.13 syscalls.list --- syscalls.list 2000/06/22 22:52:59 1.13 +++ syscalls.list 2000/07/05 23:32:10 @@ -10,7 +10,7 @@ close - close i:i __libc_close __close dup - dup i:i __dup dup dup2 - dup2 i:ii __dup2 dup2 fchdir - fchdir i:i __fchdir fchdir -fcntl - fcntl i:iip __libc_fcntl __fcntl fcntl +fcntl - fcntl i:iiV __libc_fcntl __fcntl fcntl fstatfs - fstatfs i:ip __fstatfs fstatfs fsync - fsync i:i __libc_fsync fsync getdomain - getdomainname i:si getdomainname @@ -21,15 +21,15 @@ getpid - getpid i: __getpid getpid getpriority - getpriority i:ii getpriority getrlimit - getrlimit i:ip __getrlimit getrlimit getuid - getuid i: __getuid getuid -ioctl - ioctl i:iip __ioctl ioctl +ioctl - ioctl i:iiV __ioctl ioctl kill - kill i:ii __kill kill link - link i:ss __link link lseek - lseek i:iii __libc_lseek __lseek lseek mkdir - mkdir i:si __mkdir mkdir -open - open i:sii __libc_open __open open +open - open i:siv __libc_open __open open profil - profil i:piii profil ptrace - ptrace i:iiii ptrace -read - read i:ipi __libc_read __read read +read - read i:ibn __libc_read __read read readlink - readlink i:spi __readlink readlink readv - readv i:ipi __readv readv reboot - reboot i:i reboot @@ -61,5 +61,5 @@ umask - umask i:i __umask umask uname - uname i:p uname unlink - unlink i:s __unlink unlink utimes - utimes i:sp __utimes utimes -write - write i:ipi __libc_write __write write +write - write i:ibn __libc_write __write write writev - writev i:ipi __writev writev Index: sysdeps/unix/inet/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/inet/syscalls.list,v retrieving revision 1.6 diff -u -p -r1.6 syscalls.list --- syscalls.list 2000/06/22 22:52:59 1.6 +++ syscalls.list 2000/07/05 23:32:10 @@ -1,23 +1,23 @@ # File name Caller Syscall name # args Strong name Weak names -accept - accept i:ipp __libc_accept accept +accept - accept i:ibN __libc_accept accept bind - bind i:ipi bind connect - connect i:ipi __libc_connect __connect connect gethostid - gethostid i: gethostid -gethostname - gethostname i:si __gethostname gethostname -getpeername - getpeername i:ipp getpeername -getsockname - getsockname i:ipp getsockname -getsockopt - getsockopt i:iiipp getsockopt +gethostname - gethostname i:bn __gethostname gethostname +getpeername - getpeername i:ibN getpeername +getsockname - getsockname i:ibN getsockname +getsockopt - getsockopt i:iiiBN getsockopt listen - listen i:ii listen -recv - recv i:ipii __libc_recv recv -recvfrom - recvfrom i:ipiipp __libc_recvfrom recvfrom +recv - recv i:ibni __libc_recv recv +recvfrom - recvfrom i:ibnibN __libc_recvfrom recvfrom recvmsg - recvmsg i:ipi __libc_recvmsg recvmsg -send - send i:ipii __libc_send __send send +send - send i:ibni __libc_send __send send sendmsg - sendmsg i:ipi __libc_sendmsg sendmsg -sendto - sendto i:ipiipi __libc_sendto sendto +sendto - sendto i:ibnibn __libc_sendto sendto sethostid - sethostid i:i sethostid sethostname - sethostname i:pi sethostname -setsockopt - setsockopt i:iiipi setsockopt +setsockopt - setsockopt i:iiibn setsockopt shutdown - shutdown i:ii shutdown socket - socket i:iii socket -socketpair - socketpair i:iiip socketpair +socketpair - socketpair i:iiif socketpair Index: sysdeps/unix/mman/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/mman/syscalls.list,v retrieving revision 1.7 diff -u -p -r1.7 syscalls.list --- syscalls.list 2000/06/13 07:26:45 1.7 +++ syscalls.list 2000/07/05 23:32:10 @@ -5,7 +5,7 @@ # File name Caller Syscall name # args Strong name Weak names madvise - madvise i:pii madvise -mmap - mmap p:piiiii __mmap mmap -mprotect - mprotect i:pii __mprotect mprotect -msync - msync i:pii __libc_msync msync -munmap - munmap i:pi __munmap munmap +mmap - mmap P:aniiii __mmap mmap +mprotect - mprotect i:aii __mprotect mprotect +msync - msync i:aii __libc_msync msync +munmap - munmap i:ai __munmap munmap Index: sysdeps/unix/sysv/linux/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/syscalls.list,v retrieving revision 1.78 diff -u -p -r1.78 syscalls.list --- syscalls.list 2000/06/27 00:14:44 1.78 +++ syscalls.list 2000/07/05 23:32:10 @@ -23,18 +23,18 @@ klogctl EXTRA syslog i:isi klogctl lchown - lchown i:sii __lchown lchown madvise - madvise i:pii posix_madvise madvise mincore - mincore i:iip mincore -mlock EXTRA mlock i:pi __mlock mlock +mlock EXTRA mlock i:bn __mlock mlock mlockall EXTRA mlockall i:i __mlockall mlockall -mmap - mmap p:piiiii __mmap mmap +mmap - mmap P:aniiii __mmap mmap mount EXTRA mount i:sssip __mount mount -mremap EXTRA mremap p:piii __mremap mremap -munlock EXTRA munlock i:pi __munlock munlock +mremap EXTRA mremap P:aini __mremap mremap +munlock EXTRA munlock i:ai __munlock munlock munlockall EXTRA munlockall i: __munlockall munlockall nanosleep - nanosleep i:pp __libc_nanosleep __nanosleep nanosleep nfsservctl EXTRA nfsservctl i:ipp nfsservctl pause - pause i: __libc_pause pause personality init-first personality i:i __personality personality -pipe - pipe i:p __pipe pipe +pipe - pipe i:f __pipe pipe prctl EXTRA prctl i:iiiii prctl query_module EXTRA query_module i:sipip query_module quotactl EXTRA quotactl i:isip quotactl Index: sysdeps/unix/sysv/linux/ia64/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/syscalls.list,v retrieving revision 1.3 diff -u -p -r1.3 syscalls.list --- syscalls.list 2000/06/29 19:17:26 1.3 +++ syscalls.list 2000/07/05 23:32:10 @@ -8,15 +8,15 @@ pread - pread 4 __syscall_pread __sysc pwrite - pwrite 4 __syscall_pwrite __syscall_pwrite64 __pwrite pwrite __pwrite64 pwrite64 fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64 statfs - statfs i:sp __statfs statfs statfs64 -mmap - mmap 6 __mmap mmap __mmap64 mmap64 +mmap - mmap P:aniiii __mmap mmap __mmap64 mmap64 getpeername - getpeername i:ipp __getpeername getpeername getpriority - getpriority i:ii __getpriority getpriority # semaphore and shm system calls msgctl - msgctl i:iip __msgctl msgctl msgget - msgget i:ii __msgget msgget -msgrcv - msgrcv i:ipiii __msgrcv msgrcv -msgsnd - msgsnd i:ipii __msgsnd msgsnd +msgrcv - msgrcv i:ibnii __msgrcv msgrcv +msgsnd - msgsnd i:ibni __msgsnd msgsnd shmat - shmat i:ipi __shmat shmat shmctl - shmctl i:iip __shmctl shmctl shmdt - shmdt i:s __shmdt shmdt @@ -31,18 +31,18 @@ bind - bind i:ipi __bind bind connect - connect i:ipi __libc_connect __connect connect getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname -getsockopt - getsockopt i:iiipp __getsockopt getsockopt +getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen -recv - recv i:ipii __libc_recv __recv recv -recvfrom - recvfrom i:ipiipp __libc_recvfrom __recvfrom recvfrom +recv - recv i:ibni __libc_recv __recv recv +recvfrom - recvfrom i:ibnibN __libc_recvfrom __recvfrom recvfrom recvmsg - recvmsg i:ipi __libc_recvmsg recvmsg -send - send i:ipii __libc_send __send send +send - send i:ibni __libc_send __send send sendmsg - sendmsg i:ipi __libc_sendmsg sendmsg -sendto - sendto i:ipiipi __libc_sendto __sendto sendto -setsockopt - setsockopt i:iiipi __setsockopt setsockopt +sendto - sendto i:ibnibn __libc_sendto __sendto sendto +setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket -socketpair - socketpair i:iiip __socketpair socketpair +socketpair - socketpair i:iiif __socketpair socketpair # DIG-compliant access to PCI configuration space: pciconfig_read EXTRA pciconfig_read 5 pciconfig_read @@ -57,7 +57,7 @@ getresgid - getresgid i:ppp getresgid rt_sigaction EXTRA rt_sigaction i:ippi __syscall_rt_sigaction rt_sigaction rt_sigpending EXTRA rt_sigpending i:pi __syscall_rt_sigpending rt_sigpending rt_sigprocmask EXTRA rt_sigprocmask i:ippi __syscall_rt_sigprocmask rt_sigprocmask -rt_sigqueueinfo EXTRA rt_sigqueueinfo i:iip __syscall_rt_sigqueueinfo rt_sigqueueinfo +rt_sigqueueinfo EXTRA rt_sigqueueinfo i:iip __syscall_rt_sigqueueinfo rt_sigqueueinfo rt_sigsuspend EXTRA rt_sigsuspend i:pi __syscall_rt_sigsuspend rt_sigsuspend rt_sigtimedwait EXTRA rt_sigtimedwait i:pppi __syscall_rt_sigtimedwait rt_sigtimedwait Index: sysdeps/unix/sysv/linux/mips/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/syscalls.list,v retrieving revision 1.20 diff -u -p -r1.20 syscalls.list --- syscalls.list 2000/06/23 06:26:24 1.20 +++ syscalls.list 2000/07/05 23:32:10 @@ -21,18 +21,18 @@ bind - bind i:ipi __bind bind connect - connect i:ipi __libc_connect __connect connect getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname -getsockopt - getsockopt i:iiipp __getsockopt getsockopt +getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen -recv - recv i:ipii __libc_recv __recv recv -recvfrom - recvfrom i:ipiipp __libc_recvfrom __recvfrom recvfrom +recv - recv i:ibni __libc_recv __recv recv +recvfrom - recvfrom i:ibnibN __libc_recvfrom __recvfrom recvfrom recvmsg - recvmsg i:ipi __libc_recvmsg __recvmsg recvmsg -send - send i:ipii __libc_send __send send +send - send i:ibni __libc_send __send send sendmsg - sendmsg i:ipi __libc_sendmsg __sendmsg sendmsg -sendto - sendto i:ipiipi __libc_sendto __sendto sendto -setsockopt - setsockopt i:iiipi __setsockopt setsockopt +sendto - sendto i:ibnibn __libc_sendto __sendto sendto +setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket -socketpair - socketpair i:iiip __socketpair socketpair +socketpair - socketpair i:iiif __socketpair socketpair # # These are defined locally because the caller is also defined in this dir. @@ -61,10 +61,10 @@ getresuid - getresuid i:ppp getresuid s_ipc msgget ipc i:iiiip __syscall_ipc s_lstat64 lxstat64 lstat64 i:sp __syscall_lstat64 s_poll poll poll i:pii __syscall_poll -s_pread64 pread64 pread i:ipiiii __syscall_pread +s_pread64 pread64 pread i:ibniii __syscall_pread s_putpmsg putpmsg putpmsg i:ippii __syscall_putpmsg s_ptrace ptrace ptrace i:iipp __syscall_ptrace -s_pwrite64 pwrite64 pwrite i:ipiiii __syscall_pwrite +s_pwrite64 pwrite64 pwrite i:ibniii __syscall_pwrite s_reboot reboot reboot i:iii __syscall_reboot s_setrlimit setrlimit setrlimit i:ip __syscall_setrlimit s_sigpending sigpending sigpending i:p __syscall_sigpending Index: sysdeps/unix/sysv/linux/powerpc/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/syscalls.list,v retrieving revision 1.21 diff -u -p -r1.21 syscalls.list --- syscalls.list 2000/06/27 00:14:44 1.21 +++ syscalls.list 2000/07/05 23:32:10 @@ -22,12 +22,12 @@ getresgid - getresgid i:ppp getresgid getresuid - getresuid i:ppp getresuid s_getrlimit getrlimit getrlimit i:ip __syscall_getrlimit s_lstat64 lxstat64 lstat64 i:sp __syscall_lstat64 -s_mmap2 mmap64 mmap2 p:piiiii __syscall_mmap2 +s_mmap2 mmap64 mmap2 P:aniiii __syscall_mmap2 s_poll poll poll i:pii __syscall_poll -s_pread64 pread64 pread i:ipiii __syscall_pread +s_pread64 pread64 pread i:ibnii __syscall_pread s_ptrace ptrace ptrace i:iipp __syscall_ptrace s_putpmsg putpmsg putpmsg i:ippii __syscall_putpmsg -s_pwrite64 pwrite64 pwrite i:ipiii __syscall_pwrite +s_pwrite64 pwrite64 pwrite i:ibnii __syscall_pwrite s_reboot reboot reboot i:iii __syscall_reboot s_setrlimit setrlimit setrlimit i:ip __syscall_setrlimit s_sigaction sigaction sigaction i:ipp __syscall_sigaction From drepper@redhat.com Wed Jul 5 17:44:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 05 Jul 2000 17:44:00 -0000 Subject: PATCH: syscall thunk rewrite References: <200007052348.QAA31385@kayak.mcgary.org> Message-ID: Greg McGary writes: > OK? Yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Thu Jul 6 01:10:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Thu, 06 Jul 2000 01:10:00 -0000 Subject: Patch for crypt/Makefile Message-ID: Running make check with a static only library I got: gcc: /var/home/aj/builds/glibc/20000705-static/libcrypt.a: No such file or directory make[2]: *** [/var/home/aj/builds/glibc/20000705-static/crypt/cert] Error 1 make[2]: Leaving directory `/var/home/aj/cvs/libc/crypt' make[1]: *** [crypt/tests] Error 2 Here's a patch which I've tested with static and shared libs. Ok to commit? Andreas 2000-07-06 Andreas Jaeger * crypt/Makefile (LDLIBS-cert): Removed. (LDLIBS-md5c-test): Removed. ($(objpfx)cert): Renamed from cert.out to fix dependencies. ($(objpfx)md5c-test): Likewise for md5c-test.out. ============================================================ Index: crypt/Makefile --- crypt/Makefile 2000/07/04 08:49:38 1.5 +++ crypt/Makefile 2000/07/06 07:57:51 @@ -45,17 +45,15 @@ include ../Rules -LDLIBS-cert = libcrypt -LDLIBS-md5c-test = libcrypt - ifeq (yes,$(build-shared)) libcrypt-dep = $(objpfx)libcrypt.so else libcrypt-dep = $(objpfx)libcrypt.a endif + +$(objpfx)cert: $(libcrypt-dep) +$(objpfx)md5c-test: $(libcrypt-dep) -$(objpfx)cert.out: $(libcrypt-dep) -$(objpfx)md5c-test.out: $(libcrypt-dep) # Depend on libc.so so a DT_NEEDED is generated in the shared objects. # This ensures they will load libc.so for needed symbols if loaded by -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From aj@suse.de Thu Jul 6 02:25:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Thu, 06 Jul 2000 02:25:00 -0000 Subject: getsysstats problem Message-ID: Hi, I got the following warning - and a segfault in getsysstats running the testsuite: ../sysdeps/unix/sysv/linux/getsysstats.c:48: warning: `result' might be used uninitialized in this function We do need to initialize result with NULL. I've committed the appended patch. Andreas 2000-07-06 Andreas Jaeger * sysdeps/unix/sysv/linux/getsysstats.c (get_proc_path): Initialize result. ============================================================ Index: sysdeps/unix/sysv/linux/getsysstats.c --- sysdeps/unix/sysv/linux/getsysstats.c 2000/07/06 00:43:06 1.10 +++ sysdeps/unix/sysv/linux/getsysstats.c 2000/07/06 09:23:55 @@ -45,7 +45,7 @@ { struct mntent mount_point; struct mntent *entry; - char *result; + char *result = NULL; char *copy_result; FILE *fp; -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From aj@suse.de Thu Jul 6 02:34:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Thu, 06 Jul 2000 02:34:00 -0000 Subject: linuxthreads broken in glibc 2.2? References: <200007011103.e61B3qZ00574@delius.kettenis.local> Message-ID: >>>>> Mark Kettenis writes: Mark> From: Andreas Jaeger Mark> Date: 01 Jul 2000 11:47:33 +0200 >>>>>> Andreas Jaeger writes: [...] Mark> The other test programs segfault at the same place. Any ideas what's Mark> broken? Mark> Yep. __pthread_initialize_minimal() hasn't been called yet. It is Mark> called from the libc constructor functions, but if you look at Mark> sysdeps/generic/libc-start.c, you'll see that __libc_init_secure() is Mark> called before __libc_init_first() which calls the constructors. Mark> I suppose that there is no problem when using the old method of Mark> getting at the per-thread errno (which is still used on everything < Mark> i686), but it fails for the stuff that uses the LDT, since the LDT Mark> hasn't been set up yet. Mark> I'm entirely not sure how to fix this. Calling Mark> __pthread_initialize_minimal from __libc_start_main() #ifndef SHARED Mark> is probably the easiest solution. Here's a patch to follow your suggestion - it fixed the problem for me and I can run threads with static libraries again. Uli, ok to commit this? Andreas 2000-07-06 Andreas Jaeger * sysdeps/generic/libc-start.c (__libc_start_main): Initialize thread library for static program.s ============================================================ Index: sysdeps/generic/libc-start.c --- sysdeps/generic/libc-start.c 2000/06/30 01:11:14 1.19 +++ sysdeps/generic/libc-start.c 2000/07/06 09:27:11 @@ -29,6 +29,10 @@ extern int __libc_multiple_libcs; extern void *__libc_stack_end; +#ifndef SHARED +extern void __pthread_initialize_minimal (void) __attribute__ ((weak)); +#endif + /* Prototype for local function. */ extern void __libc_check_standard_fds (void); @@ -62,6 +66,12 @@ __libc_stack_end = stack_end; #ifndef SHARED + /* Initialize the thread library at least a bit since the libgcc + functions are using thread functions if these are available and + we need to setup errno. */ + if (__pthread_initialize_minimal) + __pthread_initialize_minimal (); + /* Some security at this point. Prevent starting a SUID binary where the standard file descriptors are not opened. We have to do this only for statically linked applications since otherwise the dynamic -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From aj@suse.de Thu Jul 6 03:53:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Thu, 06 Jul 2000 03:53:00 -0000 Subject: Another getsysstats bug Message-ID: The type of the proc system is proc - but getsysstats was looking for "/proc" instead. Here's a fix. Ok to commit? Andreas 2000-07-06 Andreas Jaeger * sysdeps/unix/sysv/linux/getsysstats.c (get_proc_path): The type of the proc system is "proc". ============================================================ Index: sysdeps/unix/sysv/linux/getsysstats.c --- sysdeps/unix/sysv/linux/getsysstats.c 2000/07/06 09:25:17 1.11 +++ sysdeps/unix/sysv/linux/getsysstats.c 2000/07/06 10:49:20 @@ -57,7 +57,7 @@ { while ((entry = __getmntent_r (fp, &mount_point, buffer, bufsize)) != NULL) - if (strcmp (mount_point.mnt_type, path_proc) == 0) + if (strcmp (mount_point.mnt_type, "proc") == 0) { result = mount_point.mnt_dir; break; @@ -78,7 +78,7 @@ if (copy_result == NULL) return result; - /* Now strore the copied value. But do it atomically. */ + /* Now store the copied value. But do it atomically. */ assert (sizeof (long int) == sizeof (void *)); if (compare_and_swap ((long int *) &mount_proc, (long int) 0, (long int) copy_result) == 0) -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From greg@mcgary.org Thu Jul 6 05:38:00 2000 From: greg@mcgary.org (Greg McGary) Date: Thu, 06 Jul 2000 05:38:00 -0000 Subject: PATCH: fix recursive macro defn in sys/ptrace.h Message-ID: <200007061238.FAA06368@kayak.mcgary.org> All the other #defines have PT_ prefix on the LHS... Index: sysdeps/unix/sysv/linux/sys/ptrace.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sys/ptrace.h,v retrieving revision 1.11 diff -u -p -r1.11 ptrace.h --- ptrace.h 2000/06/24 06:56:29 1.11 +++ ptrace.h 2000/07/06 12:33:35 @@ -110,7 +110,7 @@ enum __ptrace_request /* Continue and stop at the next (return from) syscall. */ PTRACE_SYSCALL = 24 -#define PTRACE_SYSCALL PTRACE_SYSCALL +#define PT_SYSCALL PTRACE_SYSCALL }; /* Perform process tracing functions. REQUEST is one of the values From jakub@redhat.com Thu Jul 6 06:56:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 06 Jul 2000 06:56:00 -0000 Subject: [PATCH] LC_TELEPHONE int_prefixes for all locales Message-ID: <20000706155811.B7043@sunsite.ms.mff.cuni.cz> Hi! Used a phone book and a little bit of awk... 2000-07-06 Jakub Jelinek * locales/af_ZA (LC_TELEPHONE): Add int_prefix. * locales/ar_SA (LC_TELEPHONE): Likewise. * locales/be_BY (LC_TELEPHONE): Likewise. * locales/bg_BG (LC_TELEPHONE): Likewise. * locales/ca_ES (LC_TELEPHONE): Likewise. * locales/da_DK (LC_TELEPHONE): Likewise. * locales/de_BE (LC_TELEPHONE): Likewise. * locales/de_CH (LC_TELEPHONE): Likewise. * locales/de_LU (LC_TELEPHONE): Likewise. * locales/el_GR (LC_TELEPHONE): Likewise. * locales/en_AU (LC_TELEPHONE): Likewise. * locales/en_BW (LC_TELEPHONE): Likewise. * locales/en_CA (LC_TELEPHONE): Likewise. * locales/en_CA,2.5 (LC_TELEPHONE): Likewise. * locales/en_DK (LC_TELEPHONE): Likewise. * locales/en_IE (LC_TELEPHONE): Likewise. * locales/en_NZ (LC_TELEPHONE): Likewise. * locales/en_ZA (LC_TELEPHONE): Likewise. * locales/en_ZW (LC_TELEPHONE): Likewise. * locales/es_AR (LC_TELEPHONE): Likewise. * locales/es_BO (LC_TELEPHONE): Likewise. * locales/es_CL (LC_TELEPHONE): Likewise. * locales/es_CO (LC_TELEPHONE): Likewise. * locales/es_DO (LC_TELEPHONE): Likewise. * locales/es_EC (LC_TELEPHONE): Likewise. * locales/es_ES (LC_TELEPHONE): Likewise. * locales/es_GT (LC_TELEPHONE): Likewise. * locales/es_HN (LC_TELEPHONE): Likewise. * locales/es_MX (LC_TELEPHONE): Likewise. * locales/es_PA (LC_TELEPHONE): Likewise. * locales/es_PE (LC_TELEPHONE): Likewise. * locales/es_PY (LC_TELEPHONE): Likewise. * locales/es_SV (LC_TELEPHONE): Likewise. * locales/es_US (LC_TELEPHONE): Likewise. * locales/es_UY (LC_TELEPHONE): Likewise. * locales/es_VE (LC_TELEPHONE): Likewise. * locales/et_EE (LC_TELEPHONE): Likewise. * locales/eu_ES (LC_TELEPHONE): Likewise. * locales/fa_IR (LC_TELEPHONE): Likewise. * locales/fi_FI (LC_TELEPHONE): Likewise. * locales/fo_FO (LC_TELEPHONE): Likewise. * locales/fr_BE (LC_TELEPHONE): Likewise. * locales/fr_CA (LC_TELEPHONE): Likewise. * locales/fr_CA,2.13 (LC_TELEPHONE): Likewise. * locales/fr_CH (LC_TELEPHONE): Likewise. * locales/fr_LU (LC_TELEPHONE): Likewise. * locales/ga_IE (LC_TELEPHONE): Likewise. * locales/gl_ES (LC_TELEPHONE): Likewise. * locales/gv_GB (LC_TELEPHONE): Likewise. * locales/he_IL (LC_TELEPHONE): Likewise. * locales/hr_HR (LC_TELEPHONE): Likewise. * locales/hu_HU (LC_TELEPHONE): Likewise. * locales/id_ID (LC_TELEPHONE): Likewise. * locales/in_ID (LC_TELEPHONE): Likewise. * locales/is_IS (LC_TELEPHONE): Likewise. * locales/it_CH (LC_TELEPHONE): Likewise. * locales/it_IT (LC_TELEPHONE): Likewise. * locales/iw_IL (LC_TELEPHONE): Likewise. * locales/kl_GL (LC_TELEPHONE): Likewise. * locales/ko_KR (LC_TELEPHONE): Likewise. * locales/kw_GB (LC_TELEPHONE): Likewise. * locales/lt_LT (LC_TELEPHONE): Likewise. * locales/lv_LV (LC_TELEPHONE): Likewise. * locales/mk_MK (LC_TELEPHONE): Likewise. * locales/nl_BE (LC_TELEPHONE): Likewise. * locales/nl_NL (LC_TELEPHONE): Likewise. * locales/pl_PL (LC_TELEPHONE): Likewise. * locales/pt_BR (LC_TELEPHONE): Likewise. * locales/ro_RO (LC_TELEPHONE): Likewise. * locales/ru_RU (LC_TELEPHONE): Likewise. * locales/ru_UA (LC_TELEPHONE): Likewise. * locales/sk_SK (LC_TELEPHONE): Likewise. * locales/sl_SI (LC_TELEPHONE): Likewise. * locales/sr_YU (LC_TELEPHONE): Likewise. * locales/sv_FI (LC_TELEPHONE): Likewise. * locales/th_TH (LC_TELEPHONE): Likewise. * locales/tr_TR (LC_TELEPHONE): Likewise. * locales/uk_UA (LC_TELEPHONE): Likewise. --- libc/localedata/locales/af_ZA.jj Tue Jul 4 21:41:06 2000 +++ libc/localedata/locales/af_ZA Thu Jul 6 15:40:49 2000 @@ -2238,6 +2238,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/ar_SA.jj Tue Jul 4 21:41:06 2000 +++ libc/localedata/locales/ar_SA Thu Jul 6 15:40:49 2000 @@ -559,6 +559,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/be_BY.jj Tue Jul 4 21:41:07 2000 +++ libc/localedata/locales/be_BY Thu Jul 6 15:40:49 2000 @@ -3120,6 +3120,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/bg_BG.jj Tue Jul 4 21:41:08 2000 +++ libc/localedata/locales/bg_BG Thu Jul 6 15:40:49 2000 @@ -3143,6 +3143,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/ca_ES.jj Tue Jul 4 21:41:08 2000 +++ libc/localedata/locales/ca_ES Thu Jul 6 15:40:50 2000 @@ -2190,6 +2190,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/da_DK.jj Tue Jul 4 21:41:10 2000 +++ libc/localedata/locales/da_DK Thu Jul 6 15:40:50 2000 @@ -2213,6 +2213,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/de_BE.jj Tue Jul 4 21:41:10 2000 +++ libc/localedata/locales/de_BE Thu Jul 6 15:40:50 2000 @@ -128,6 +128,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/de_CH.jj Tue Jul 4 21:41:10 2000 +++ libc/localedata/locales/de_CH Thu Jul 6 15:40:50 2000 @@ -128,6 +128,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/de_LU.jj Tue Jul 4 21:41:10 2000 +++ libc/localedata/locales/de_LU Thu Jul 6 15:40:50 2000 @@ -128,6 +128,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/el_GR.jj Thu Jul 6 15:01:30 2000 +++ libc/localedata/locales/el_GR Thu Jul 6 15:40:50 2000 @@ -3156,6 +3156,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/en_AU.jj Tue Jul 4 21:41:10 2000 +++ libc/localedata/locales/en_AU Thu Jul 6 15:40:50 2000 @@ -130,6 +130,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/en_BW.jj Tue Jul 4 21:41:10 2000 +++ libc/localedata/locales/en_BW Thu Jul 6 15:40:50 2000 @@ -91,6 +91,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/en_CA.jj Tue Jul 4 21:41:11 2000 +++ libc/localedata/locales/en_CA Thu Jul 6 15:40:50 2000 @@ -2193,6 +2193,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/en_CA,2.5.jj Tue Jul 4 21:41:12 2000 +++ libc/localedata/locales/en_CA,2.5 Thu Jul 6 15:40:50 2000 @@ -823,6 +823,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/en_DK.jj Tue Jul 4 21:41:12 2000 +++ libc/localedata/locales/en_DK Thu Jul 6 15:40:50 2000 @@ -136,6 +136,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/en_IE.jj Tue Jul 4 21:41:12 2000 +++ libc/localedata/locales/en_IE Thu Jul 6 15:40:50 2000 @@ -131,6 +131,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/en_NZ.jj Tue Jul 4 21:41:12 2000 +++ libc/localedata/locales/en_NZ Thu Jul 6 15:40:51 2000 @@ -130,6 +130,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/en_ZA.jj Tue Jul 4 21:41:12 2000 +++ libc/localedata/locales/en_ZA Thu Jul 6 15:40:51 2000 @@ -127,6 +127,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/en_ZW.jj Tue Jul 4 21:41:12 2000 +++ libc/localedata/locales/en_ZW Thu Jul 6 15:40:51 2000 @@ -91,6 +91,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_AR.jj Thu Jul 6 15:01:30 2000 +++ libc/localedata/locales/es_AR Thu Jul 6 15:40:51 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_BO.jj Thu Jul 6 15:01:31 2000 +++ libc/localedata/locales/es_BO Thu Jul 6 15:40:51 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_CL.jj Thu Jul 6 15:01:33 2000 +++ libc/localedata/locales/es_CL Thu Jul 6 15:40:51 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_CO.jj Thu Jul 6 15:01:33 2000 +++ libc/localedata/locales/es_CO Thu Jul 6 15:40:51 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_DO.jj Thu Jul 6 15:01:35 2000 +++ libc/localedata/locales/es_DO Thu Jul 6 15:40:51 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_EC.jj Thu Jul 6 15:01:36 2000 +++ libc/localedata/locales/es_EC Thu Jul 6 15:40:51 2000 @@ -2208,6 +2208,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_ES.jj Thu Jul 6 15:01:37 2000 +++ libc/localedata/locales/es_ES Thu Jul 6 15:40:51 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_GT.jj Thu Jul 6 15:01:38 2000 +++ libc/localedata/locales/es_GT Thu Jul 6 15:40:52 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_HN.jj Thu Jul 6 15:01:39 2000 +++ libc/localedata/locales/es_HN Thu Jul 6 15:40:52 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_MX.jj Thu Jul 6 15:01:39 2000 +++ libc/localedata/locales/es_MX Thu Jul 6 15:40:52 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_PA.jj Thu Jul 6 15:01:40 2000 +++ libc/localedata/locales/es_PA Thu Jul 6 15:40:52 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_PE.jj Thu Jul 6 15:01:41 2000 +++ libc/localedata/locales/es_PE Thu Jul 6 15:40:52 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_PY.jj Thu Jul 6 15:01:42 2000 +++ libc/localedata/locales/es_PY Thu Jul 6 15:40:52 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_SV.jj Thu Jul 6 15:01:43 2000 +++ libc/localedata/locales/es_SV Thu Jul 6 15:40:52 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_US.jj Thu Jul 6 15:01:44 2000 +++ libc/localedata/locales/es_US Thu Jul 6 15:40:52 2000 @@ -2206,6 +2206,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_UY.jj Thu Jul 6 15:01:45 2000 +++ libc/localedata/locales/es_UY Thu Jul 6 15:40:53 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/es_VE.jj Thu Jul 6 15:01:46 2000 +++ libc/localedata/locales/es_VE Thu Jul 6 15:40:53 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/et_EE.jj Tue Jul 4 21:41:18 2000 +++ libc/localedata/locales/et_EE Thu Jul 6 15:40:53 2000 @@ -2206,6 +2206,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/eu_ES.jj Tue Jul 4 21:41:18 2000 +++ libc/localedata/locales/eu_ES Thu Jul 6 15:40:53 2000 @@ -137,6 +137,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/fa_IR.jj Tue Jul 4 21:41:18 2000 +++ libc/localedata/locales/fa_IR Thu Jul 6 15:40:53 2000 @@ -546,6 +546,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/fi_FI.jj Tue Jul 4 21:41:19 2000 +++ libc/localedata/locales/fi_FI Thu Jul 6 15:40:53 2000 @@ -2201,6 +2201,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/fo_FO.jj Tue Jul 4 21:41:19 2000 +++ libc/localedata/locales/fo_FO Thu Jul 6 15:40:53 2000 @@ -117,6 +117,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/fr_BE.jj Tue Jul 4 21:41:19 2000 +++ libc/localedata/locales/fr_BE Thu Jul 6 15:40:53 2000 @@ -130,6 +130,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/fr_CA.jj Thu Jul 6 15:01:47 2000 +++ libc/localedata/locales/fr_CA Thu Jul 6 15:40:53 2000 @@ -130,6 +130,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/fr_CA,2.13.jj Tue Jul 4 21:41:19 2000 +++ libc/localedata/locales/fr_CA,2.13 Thu Jul 6 15:40:53 2000 @@ -864,6 +864,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/fr_CH.jj Tue Jul 4 21:41:19 2000 +++ libc/localedata/locales/fr_CH Thu Jul 6 15:40:53 2000 @@ -116,6 +116,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/fr_LU.jj Tue Jul 4 21:41:19 2000 +++ libc/localedata/locales/fr_LU Thu Jul 6 15:40:53 2000 @@ -130,6 +130,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/ga_IE.jj Tue Jul 4 21:41:19 2000 +++ libc/localedata/locales/ga_IE Thu Jul 6 15:40:54 2000 @@ -128,6 +128,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/gl_ES.jj Tue Jul 4 21:41:19 2000 +++ libc/localedata/locales/gl_ES Thu Jul 6 15:40:54 2000 @@ -131,6 +131,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/gv_GB.jj Tue Jul 4 21:41:19 2000 +++ libc/localedata/locales/gv_GB Thu Jul 6 15:40:54 2000 @@ -141,6 +141,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/he_IL.jj Tue Jul 4 21:41:19 2000 +++ libc/localedata/locales/he_IL Thu Jul 6 15:40:54 2000 @@ -129,6 +129,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/hr_HR.jj Tue Jul 4 21:41:20 2000 +++ libc/localedata/locales/hr_HR Thu Jul 6 15:40:54 2000 @@ -2217,6 +2217,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/hu_HU.jj Thu Jul 6 15:01:47 2000 +++ libc/localedata/locales/hu_HU Thu Jul 6 15:40:54 2000 @@ -2294,6 +2294,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/id_ID.jj Tue Jul 4 21:41:20 2000 +++ libc/localedata/locales/id_ID Thu Jul 6 15:40:54 2000 @@ -130,6 +130,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/in_ID.jj Tue Jul 4 21:41:20 2000 +++ libc/localedata/locales/in_ID Thu Jul 6 15:40:54 2000 @@ -130,6 +130,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/is_IS.jj Tue Jul 4 21:41:21 2000 +++ libc/localedata/locales/is_IS Thu Jul 6 15:40:54 2000 @@ -2236,6 +2236,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/it_CH.jj Tue Jul 4 21:41:21 2000 +++ libc/localedata/locales/it_CH Thu Jul 6 15:40:54 2000 @@ -109,6 +109,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/it_IT.jj Tue Jul 4 21:41:21 2000 +++ libc/localedata/locales/it_IT Thu Jul 6 15:40:54 2000 @@ -130,6 +130,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/iw_IL.jj Tue Jul 4 21:41:21 2000 +++ libc/localedata/locales/iw_IL Thu Jul 6 15:40:54 2000 @@ -129,6 +129,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/kl_GL.jj Tue Jul 4 21:41:27 2000 +++ libc/localedata/locales/kl_GL Thu Jul 6 15:40:54 2000 @@ -118,6 +118,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/ko_KR.jj Tue Jul 4 21:41:27 2000 +++ libc/localedata/locales/ko_KR Thu Jul 6 15:40:55 2000 @@ -1795,6 +1795,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/kw_GB.jj Tue Jul 4 21:41:27 2000 +++ libc/localedata/locales/kw_GB Thu Jul 6 15:40:55 2000 @@ -133,6 +133,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/lt_LT.jj Tue Jul 4 21:41:28 2000 +++ libc/localedata/locales/lt_LT Thu Jul 6 15:40:55 2000 @@ -2201,6 +2201,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/lv_LV.jj Tue Jul 4 21:41:28 2000 +++ libc/localedata/locales/lv_LV Thu Jul 6 15:40:55 2000 @@ -2194,6 +2194,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/mk_MK.jj Tue Jul 4 21:41:29 2000 +++ libc/localedata/locales/mk_MK Thu Jul 6 15:40:55 2000 @@ -3096,6 +3096,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/nl_BE.jj Tue Jul 4 21:41:29 2000 +++ libc/localedata/locales/nl_BE Thu Jul 6 15:40:55 2000 @@ -113,6 +113,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/nl_NL.jj Tue Jul 4 21:41:29 2000 +++ libc/localedata/locales/nl_NL Thu Jul 6 15:40:55 2000 @@ -129,6 +129,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/pl_PL.jj Tue Jul 4 21:41:30 2000 +++ libc/localedata/locales/pl_PL Thu Jul 6 15:40:55 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/pt_BR.jj Tue Jul 4 21:41:30 2000 +++ libc/localedata/locales/pt_BR Thu Jul 6 15:40:55 2000 @@ -130,6 +130,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/ro_RO.jj Thu Jul 6 15:01:51 2000 +++ libc/localedata/locales/ro_RO Thu Jul 6 15:40:55 2000 @@ -2190,6 +2190,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/ru_RU.jj Thu Jul 6 15:01:54 2000 +++ libc/localedata/locales/ru_RU Thu Jul 6 15:40:56 2000 @@ -3125,6 +3125,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/ru_UA.jj Tue Jul 4 21:41:31 2000 +++ libc/localedata/locales/ru_UA Thu Jul 6 15:40:56 2000 @@ -3120,6 +3120,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/sk_SK.jj Tue Jul 4 21:41:31 2000 +++ libc/localedata/locales/sk_SK Thu Jul 6 15:40:56 2000 @@ -190,6 +190,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/sl_SI.jj Tue Jul 4 21:41:32 2000 +++ libc/localedata/locales/sl_SI Thu Jul 6 15:40:56 2000 @@ -2192,6 +2192,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/sr_YU.jj Tue Jul 4 21:41:32 2000 +++ libc/localedata/locales/sr_YU Thu Jul 6 15:40:56 2000 @@ -2217,6 +2217,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/sv_FI.jj Tue Jul 4 21:41:32 2000 +++ libc/localedata/locales/sv_FI Thu Jul 6 15:40:56 2000 @@ -114,6 +114,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/th_TH.jj Thu Jul 6 15:01:55 2000 +++ libc/localedata/locales/th_TH Thu Jul 6 15:40:56 2000 @@ -1047,6 +1047,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/tr_TR.jj Thu Jul 6 15:01:58 2000 +++ libc/localedata/locales/tr_TR Thu Jul 6 15:40:56 2000 @@ -3110,6 +3110,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT --- libc/localedata/locales/uk_UA.jj Tue Jul 4 21:41:34 2000 +++ libc/localedata/locales/uk_UA Thu Jul 6 15:40:56 2000 @@ -3120,6 +3120,7 @@ END LC_PAPER LC_TELEPHONE tel_int_fmt "/ " +int_prefix "" END LC_TELEPHONE LC_MEASUREMENT Jakub From drepper@redhat.com Thu Jul 6 09:27:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 06 Jul 2000 09:27:00 -0000 Subject: linuxthreads broken in glibc 2.2? References: <200007011103.e61B3qZ00574@delius.kettenis.local> Message-ID: Andreas Jaeger writes: > Uli, ok to commit this? Seems OK, yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Jul 6 09:28:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 06 Jul 2000 09:28:00 -0000 Subject: Another getsysstats bug References: Message-ID: Andreas Jaeger writes: > The type of the proc system is proc - but getsysstats was looking for > "/proc" instead. Here's a fix. Ok to commit? Yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Jul 6 09:30:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 06 Jul 2000 09:30:00 -0000 Subject: PATCH: fix recursive macro defn in sys/ptrace.h References: <200007061238.FAA06368@kayak.mcgary.org> Message-ID: Greg McGary writes: > All the other #defines have PT_ prefix on the LHS... OK. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Thu Jul 6 13:07:00 2000 From: greg@mcgary.org (Greg McGary) Date: Thu, 06 Jul 2000 13:07:00 -0000 Subject: PATCH: eliminate some endian #ifs Message-ID: <200007062007.NAA25310@kayak.mcgary.org> No build-shared & build-static failures or binary differences for i686. Mips untested. Andreas, what are some good MIPS cross configurations? [ sysdeps/unix/sysv/linux/llseek.c always passes the two pieces of the 64-bit offset in big-endian order. Is this proper, or should it be conditional on endianness also? ] OK? 2000-07-06 Greg McGary * string/endian.h (__LONG_LONG_PAIR): New macro. * sysdeps/unix/sysv/linux/ftruncate64.c: Use it. * sysdeps/unix/sysv/linux/pread.c: Likewise. * sysdeps/unix/sysv/linux/pread64.c: Likewise. * sysdeps/unix/sysv/linux/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/pwrite64.c: Likewise. * sysdeps/unix/sysv/linux/truncate64.c: Likewise. * sysdeps/unix/sysv/linux/mips/ftruncate64.c: Likewise. * sysdeps/unix/sysv/linux/mips/pread.c: Likewise. * sysdeps/unix/sysv/linux/mips/pread64.c: Likewise. * sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise. * sysdeps/unix/sysv/linux/mips/truncate64.c: Likewise. Index: string/endian.h =================================================================== RCS file: /cvs/glibc/libc/string/endian.h,v retrieving revision 1.5 diff -u -p -r1.5 endian.h --- endian.h 1998/11/27 11:34:04 1.5 +++ endian.h 2000/07/06 19:44:07 @@ -47,4 +47,10 @@ # define BYTE_ORDER __BYTE_ORDER #endif +#if __BYTE_ORDER == __LITTLE_ENDIAN +# define __LONG_LONG_PAIR(HI, LO) LO, HI +#elif __BYTE_ORDER == __BIG_ENDIAN +# define __LONG_LONG_PAIR(HI, LO) HI, LO +#endif + #endif /* endian.h */ Index: sysdeps/unix/sysv/linux/ftruncate64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ftruncate64.c,v retrieving revision 1.7 diff -u -p -r1.7 ftruncate64.c --- ftruncate64.c 2000/05/26 20:11:43 1.7 +++ ftruncate64.c 2000/07/06 19:44:07 @@ -49,11 +49,8 @@ ftruncate64 (int fd, off64_t length) #ifndef __ASSUME_TRUNCATE64_SYSCALL int saved_errno = errno; #endif -#if __BYTE_ORDER == __LITTLE_ENDIAN - int result = INLINE_SYSCALL (ftruncate64, 3, fd, low, high); -#elif __BYTE_ORDER == __BIG_ENDIAN - int result = INLINE_SYSCALL (ftruncate64, 3, fd, high, low); -#endif + int result = INLINE_SYSCALL (ftruncate64, 3, fd, + __LONG_LONG_PAIR (high, low)); #ifndef __ASSUME_TRUNCATE64_SYSCALL if (result != -1 || errno != ENOSYS) #endif Index: sysdeps/unix/sysv/linux/pread.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/pread.c,v retrieving revision 1.9 diff -u -p -r1.9 pread.c --- pread.c 2000/05/27 16:50:33 1.9 +++ pread.c 2000/07/06 19:44:07 @@ -48,11 +48,8 @@ __libc_pread (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if __BYTE_ORDER == __LITTLE_ENDIAN - result = INLINE_SYSCALL (pread, 5, fd, buf, count, offset, 0); -# elif __BYTE_ORDER == __BIG_ENDIAN - result = INLINE_SYSCALL (pread, 5, fd, buf, count, 0, offset); -# endif + result = INLINE_SYSCALL (pread, 5, fd, buf, count, + __LONG_LONG_PAIR (0, offset)); # if __ASSUME_PREAD_SYSCALL == 0 if (result == -1 && errno == ENOSYS) Index: sysdeps/unix/sysv/linux/pread64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/pread64.c,v retrieving revision 1.9 diff -u -p -r1.9 pread64.c --- pread64.c 2000/05/26 19:55:43 1.9 +++ pread64.c 2000/07/06 19:44:07 @@ -47,15 +47,9 @@ __libc_pread64 (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if __BYTE_ORDER == __LITTLE_ENDIAN result = INLINE_SYSCALL (pread, 5, fd, buf, count, - (off_t) (offset & 0xffffffff), - (off_t) (offset >> 32)); -# elif __BYTE_ORDER == __BIG_ENDIAN - result = INLINE_SYSCALL (pread, 5, fd, buf, count, - (off_t) (offset >> 32), - (off_t) (offset & 0xffffffff)); -# endif + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); # if __ASSUME_PREAD_SYSCALL == 0 if (result == -1 && errno == ENOSYS) Index: sysdeps/unix/sysv/linux/pwrite.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/pwrite.c,v retrieving revision 1.8 diff -u -p -r1.8 pwrite.c --- pwrite.c 2000/05/27 16:50:33 1.8 +++ pwrite.c 2000/07/06 19:44:07 @@ -48,11 +48,8 @@ __libc_pwrite (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if __BYTE_ORDER == __LITTLE_ENDIAN - result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, offset, 0); -# elif __BYTE_ORDER == __BIG_ENDIAN - result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, 0, offset); -# endif + result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, + __LONG_LONG_PAIR (0, offset)); # if __ASSUME_PWRITE_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/pwrite64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/pwrite64.c,v retrieving revision 1.8 diff -u -p -r1.8 pwrite64.c --- pwrite64.c 2000/05/26 15:45:04 1.8 +++ pwrite64.c 2000/07/06 19:44:07 @@ -47,15 +47,9 @@ __libc_pwrite64 (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if __BYTE_ORDER == __LITTLE_ENDIAN result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, - (off_t) (offset & 0xffffffff), - (off_t) (offset >> 32)); -# elif __BYTE_ORDER == __BIG_ENDIAN - result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, - (off_t) (offset >> 32), - (off_t) (offset & 0xffffffff)); -# endif + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); # if __ASSUME_PWRITE_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/truncate64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/truncate64.c,v retrieving revision 1.8 diff -u -p -r1.8 truncate64.c --- truncate64.c 2000/05/26 20:11:43 1.8 +++ truncate64.c 2000/07/06 19:44:07 @@ -49,11 +49,8 @@ truncate64 (const char *path, off64_t le #ifndef __ASSUME_TRUNCATE64_SYSCALL int saved_errno = errno; #endif -#if __BYTE_ORDER == __LITTLE_ENDIAN - int result = INLINE_SYSCALL (truncate64, 3, path, low, high); -#elif __BYTE_ORDER == __BIG_ENDIAN - int result = INLINE_SYSCALL (truncate64, 3, path, high, low); -#endif + int result = INLINE_SYSCALL (truncate64, 3, path, + __LONG_LONG_PAIR (high, low)); #ifndef __ASSUME_TRUNCATE64_SYSCALL if (result != -1 || errno != ENOSYS) Index: sysdeps/unix/sysv/linux/mips/ftruncate64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/ftruncate64.c,v retrieving revision 1.2 diff -u -p -r1.2 ftruncate64.c --- ftruncate64.c 2000/05/31 12:00:45 1.2 +++ ftruncate64.c 2000/07/06 19:44:07 @@ -50,13 +50,8 @@ ftruncate64 (int fd, off64_t length) #ifndef __ASSUME_TRUNCATE64_SYSCALL int saved_errno = errno; #endif -#if __BYTE_ORDER == __LITTLE_ENDIAN - /* Use a fill argument to pass low, high in an aligned pair of - arguments (here 2/3). */ - int result = INLINE_SYSCALL (ftruncate64, 3, fd, 0, low, high); -#elif __BYTE_ORDER == __BIG_ENDIAN - int result = INLINE_SYSCALL (ftruncate64, 3, fd, 0, high, low); -#endif + int result = INLINE_SYSCALL (ftruncate64, 3, fd, 0, + __LONG_LONG_PAIR (high, low)); #ifndef __ASSUME_TRUNCATE64_SYSCALL if (result != -1 || errno != ENOSYS) #endif Index: sysdeps/unix/sysv/linux/mips/pread.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pread.c,v retrieving revision 1.4 diff -u -p -r1.4 pread.c --- pread.c 2000/05/30 12:50:17 1.4 +++ pread.c 2000/07/06 19:44:07 @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -46,11 +47,8 @@ __libc_pread (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if defined(__MIPSEB__) - result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, 0, offset); -# elif defined(__MIPSEL__) - result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, offset, 0); -# endif + result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, + __LONG_LONG_PAIR (0, offset)); # if __ASSUME_PREAD_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/mips/pread64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pread64.c,v retrieving revision 1.5 diff -u -p -r1.5 pread64.c --- pread64.c 2000/05/30 12:50:17 1.5 +++ pread64.c 2000/07/06 19:44:07 @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -47,14 +48,9 @@ __libc_pread64 (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if defined(__MIPSEB__) - result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, (off_t) (offset >> 32), - (off_t) (offset & 0xffffffff)); -# elif defined(__MIPSEL__) result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, - (off_t) (offset & 0xffffffff), - (off_t) (offset >> 32)); -# endif + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); # if __ASSUME_PREAD_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/mips/pwrite.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pwrite.c,v retrieving revision 1.4 diff -u -p -r1.4 pwrite.c --- pwrite.c 2000/05/30 12:50:17 1.4 +++ pwrite.c 2000/07/06 19:44:07 @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -45,11 +46,8 @@ __libc_pwrite (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if defined(__MIPSEB__) - result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, 0, offset); -# elif defined(__MIPSEL__) - result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, offset, 0); -# endif + result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, + __LONG_LONG_PAIR (0, offset)); # if __ASSUME_PWRITE_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/mips/pwrite64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pwrite64.c,v retrieving revision 1.5 diff -u -p -r1.5 pwrite64.c --- pwrite64.c 2000/05/30 12:50:17 1.5 +++ pwrite64.c 2000/07/06 19:44:07 @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -45,15 +46,9 @@ __libc_pwrite64 (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if defined(__MIPSEB__) - result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, (off_t) (offset >> 32), - (off_t) (offset & 0xffffffff)); -# elif defined(__MIPSEL__) result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, - (off_t) (offset & 0xffffffff), - (off_t) (offset >> 32)); -# endif - + __LONG_LONG_PAIR ((off_t) (offset >> 32), + (off_t) (offset & 0xffffffff))); # if __ASSUME_PWRITE_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/mips/truncate64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/truncate64.c,v retrieving revision 1.2 diff -u -p -r1.2 truncate64.c --- truncate64.c 2000/05/31 12:00:45 1.2 +++ truncate64.c 2000/07/06 19:44:07 @@ -50,14 +50,8 @@ truncate64 (const char *path, off64_t le #ifndef __ASSUME_TRUNCATE64_SYSCALL int saved_errno = errno; #endif -#if __BYTE_ORDER == __LITTLE_ENDIAN - /* Use a fill argument to pass low, high in an aligned pair of - arguments (here 2/3). */ - int result = INLINE_SYSCALL (truncate64, 3, path, 0, low, high); -#elif __BYTE_ORDER == __BIG_ENDIAN - int result = INLINE_SYSCALL (truncate64, 3, path, 0, high, low); -#endif - + int result = INLINE_SYSCALL (truncate64, 3, path, 0, + __LONG_LONG_PAIR (high, low)); #ifndef __ASSUME_TRUNCATE64_SYSCALL if (result != -1 || errno != ENOSYS) #endif From drepper@redhat.com Thu Jul 6 13:18:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 06 Jul 2000 13:18:00 -0000 Subject: PATCH: eliminate some endian #ifs References: <200007062007.NAA25310@kayak.mcgary.org> Message-ID: Greg McGary writes: > No build-shared & build-static failures or binary differences for i686. OK. > [ sysdeps/unix/sysv/linux/llseek.c always passes the two pieces of the > 64-bit offset in big-endian order. Is this proper, or should it be > conditional on endianness also? ] If nobody complains it seems OK. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Thu Jul 6 13:53:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 06 Jul 2000 13:53:00 -0000 Subject: [PATCH] Sparc fixes Message-ID: <20000706225448.A12509@sunsite.ms.mff.cuni.cz> Hi! This removes some warnings and fixes a typo in spinlock.h which prevents building glibc on sparc32. 2000-07-06 Jakub Jelinek * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Pass 0 instead of NULL to elf_machine_fixup_plt t argument. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c (__mmap64): Add cast. linuxthreads/ * spinlock.h (__pthread_trylock): Fix typos. --- libc/linuxthreads/spinlock.h.jj Thu Jul 6 16:47:05 2000 +++ libc/linuxthreads/spinlock.h Thu Jul 6 16:29:45 2000 @@ -107,7 +107,7 @@ static inline int __pthread_trylock (str #endif #if !defined HAS_COMPARE_AND_SWAP { - return (testandset(&lock->__spinlock) : EBUSY : 0) + return (testandset(&lock->__spinlock) ? EBUSY : 0); } #endif --- libc/sysdeps/sparc/sparc32/dl-machine.h.jj Thu Jul 6 16:17:26 2000 +++ libc/sysdeps/sparc/sparc32/dl-machine.h Thu Jul 6 16:17:56 2000 @@ -396,7 +396,7 @@ elf_machine_rela (struct link_map *map, *reloc_addr = value; break; case R_SPARC_JMP_SLOT: - elf_machine_fixup_plt(map, NULL, reloc, reloc_addr, value); + elf_machine_fixup_plt(map, 0, reloc, reloc_addr, value); break; case R_SPARC_8: *(char *) reloc_addr = value; --- libc/sysdeps/sparc/sparc64/dl-machine.h.jj Sat May 13 16:56:21 2000 +++ libc/sysdeps/sparc/sparc64/dl-machine.h Thu Jul 6 16:18:53 2000 @@ -313,7 +313,7 @@ elf_machine_rela (struct link_map *map, break; case R_SPARC_JMP_SLOT: - elf_machine_fixup_plt(map, NULL, reloc, reloc_addr, value); + elf_machine_fixup_plt(map, 0, reloc, reloc_addr, value); break; case R_SPARC_UA64: --- libc/sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c.jj Wed Mar 22 16:36:11 2000 +++ libc/sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c Thu Jul 6 16:45:18 2000 @@ -48,8 +48,9 @@ __mmap64 (__ptr_t addr, size_t len, int int saved_errno = errno; #endif /* This will be always 12, no matter what page size is. */ - __ptr_t result = INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags, - fd, (off_t) (offset >> 12)); + __ptr_t result = + (__ptr_t) INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags, + fd, (off_t) (offset >> 12)); #ifndef __ASSUME_MMAP2_SYSCALL if (result != (__ptr_t) -1 || errno != ENOSYS) Jakub From greg@mcgary.org Thu Jul 6 13:55:00 2000 From: greg@mcgary.org (Greg McGary) Date: Thu, 06 Jul 2000 13:55:00 -0000 Subject: PATCH: eliminate some endian #ifs References: <200007062007.NAA25310@kayak.mcgary.org> Message-ID: Ulrich Drepper writes: > > No build-shared & build-static failures or binary differences for i686. Same deal. I refined this a bit further: __LONG_LONG_SPLIT accepts a single 64-bit quantity, breaks it into two 32-bit args, and passes the pieces according to __BYTE_ORDER. Index: string/endian.h =================================================================== RCS file: /cvs/glibc/libc/string/endian.h,v retrieving revision 1.5 diff -u -p -r1.5 endian.h --- endian.h 1998/11/27 11:34:04 1.5 +++ endian.h 2000/07/06 20:44:11 @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1996, 1997, 2000 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 @@ -45,6 +45,13 @@ # define BIG_ENDIAN __BIG_ENDIAN # define PDP_ENDIAN __PDP_ENDIAN # define BYTE_ORDER __BYTE_ORDER +#endif + +#define __LONG_LONG_SPLIT(LL) __LONG_LONG_PAIR ((LL) >> 32, (LL) & 0xffffffff) +#if __BYTE_ORDER == __LITTLE_ENDIAN +# define __LONG_LONG_PAIR(HI, LO) (LO), (HI) +#elif __BYTE_ORDER == __BIG_ENDIAN +# define __LONG_LONG_PAIR(HI, LO) (HI), (LO) #endif #endif /* endian.h */ Index: sysdeps/unix/sysv/linux/ftruncate64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ftruncate64.c,v retrieving revision 1.7 diff -u -p -r1.7 ftruncate64.c --- ftruncate64.c 2000/05/26 20:11:43 1.7 +++ ftruncate64.c 2000/07/06 20:44:12 @@ -44,16 +44,11 @@ ftruncate64 (int fd, off64_t length) if (! __have_no_truncate64) #endif { - unsigned int low = length & 0xffffffff; - unsigned int high = length >> 32; #ifndef __ASSUME_TRUNCATE64_SYSCALL int saved_errno = errno; #endif -#if __BYTE_ORDER == __LITTLE_ENDIAN - int result = INLINE_SYSCALL (ftruncate64, 3, fd, low, high); -#elif __BYTE_ORDER == __BIG_ENDIAN - int result = INLINE_SYSCALL (ftruncate64, 3, fd, high, low); -#endif + int result = INLINE_SYSCALL (ftruncate64, 3, fd, + __LONG_LONG_SPLIT (length)); #ifndef __ASSUME_TRUNCATE64_SYSCALL if (result != -1 || errno != ENOSYS) #endif Index: sysdeps/unix/sysv/linux/pread.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/pread.c,v retrieving revision 1.9 diff -u -p -r1.9 pread.c --- pread.c 2000/05/27 16:50:33 1.9 +++ pread.c 2000/07/06 20:44:12 @@ -48,11 +48,8 @@ __libc_pread (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if __BYTE_ORDER == __LITTLE_ENDIAN - result = INLINE_SYSCALL (pread, 5, fd, buf, count, offset, 0); -# elif __BYTE_ORDER == __BIG_ENDIAN - result = INLINE_SYSCALL (pread, 5, fd, buf, count, 0, offset); -# endif + result = INLINE_SYSCALL (pread, 5, fd, buf, count, + __LONG_LONG_SPLIT (offset)); # if __ASSUME_PREAD_SYSCALL == 0 if (result == -1 && errno == ENOSYS) Index: sysdeps/unix/sysv/linux/pread64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/pread64.c,v retrieving revision 1.9 diff -u -p -r1.9 pread64.c --- pread64.c 2000/05/26 19:55:43 1.9 +++ pread64.c 2000/07/06 20:44:12 @@ -47,16 +47,8 @@ __libc_pread64 (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if __BYTE_ORDER == __LITTLE_ENDIAN result = INLINE_SYSCALL (pread, 5, fd, buf, count, - (off_t) (offset & 0xffffffff), - (off_t) (offset >> 32)); -# elif __BYTE_ORDER == __BIG_ENDIAN - result = INLINE_SYSCALL (pread, 5, fd, buf, count, - (off_t) (offset >> 32), - (off_t) (offset & 0xffffffff)); -# endif - + __LONG_LONG_SPLIT (offset)); # if __ASSUME_PREAD_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/pwrite.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/pwrite.c,v retrieving revision 1.8 diff -u -p -r1.8 pwrite.c --- pwrite.c 2000/05/27 16:50:33 1.8 +++ pwrite.c 2000/07/06 20:44:12 @@ -48,11 +48,8 @@ __libc_pwrite (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if __BYTE_ORDER == __LITTLE_ENDIAN - result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, offset, 0); -# elif __BYTE_ORDER == __BIG_ENDIAN - result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, 0, offset); -# endif + result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, + __LONG_LONG_SPLIT (offset)); # if __ASSUME_PWRITE_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/pwrite64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/pwrite64.c,v retrieving revision 1.8 diff -u -p -r1.8 pwrite64.c --- pwrite64.c 2000/05/26 15:45:04 1.8 +++ pwrite64.c 2000/07/06 20:44:12 @@ -47,15 +47,8 @@ __libc_pwrite64 (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if __BYTE_ORDER == __LITTLE_ENDIAN result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, - (off_t) (offset & 0xffffffff), - (off_t) (offset >> 32)); -# elif __BYTE_ORDER == __BIG_ENDIAN - result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, - (off_t) (offset >> 32), - (off_t) (offset & 0xffffffff)); -# endif + __LONG_LONG_SPLIT (offset)); # if __ASSUME_PWRITE_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/truncate64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/truncate64.c,v retrieving revision 1.8 diff -u -p -r1.8 truncate64.c --- truncate64.c 2000/05/26 20:11:43 1.8 +++ truncate64.c 2000/07/06 20:44:12 @@ -44,17 +44,11 @@ truncate64 (const char *path, off64_t le if (! __have_no_truncate64) #endif { - unsigned int low = length & 0xffffffff; - unsigned int high = length >> 32; #ifndef __ASSUME_TRUNCATE64_SYSCALL int saved_errno = errno; #endif -#if __BYTE_ORDER == __LITTLE_ENDIAN - int result = INLINE_SYSCALL (truncate64, 3, path, low, high); -#elif __BYTE_ORDER == __BIG_ENDIAN - int result = INLINE_SYSCALL (truncate64, 3, path, high, low); -#endif - + int result = INLINE_SYSCALL (truncate64, 3, path, + __LONG_LONG_SPLIT (length)); #ifndef __ASSUME_TRUNCATE64_SYSCALL if (result != -1 || errno != ENOSYS) #endif Index: sysdeps/unix/sysv/linux/mips/ftruncate64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/ftruncate64.c,v retrieving revision 1.2 diff -u -p -r1.2 ftruncate64.c --- ftruncate64.c 2000/05/31 12:00:45 1.2 +++ ftruncate64.c 2000/07/06 20:44:14 @@ -45,18 +45,11 @@ ftruncate64 (int fd, off64_t length) if (! __have_no_truncate64) #endif { - unsigned int low = length & 0xffffffff; - unsigned int high = length >> 32; #ifndef __ASSUME_TRUNCATE64_SYSCALL int saved_errno = errno; #endif -#if __BYTE_ORDER == __LITTLE_ENDIAN - /* Use a fill argument to pass low, high in an aligned pair of - arguments (here 2/3). */ - int result = INLINE_SYSCALL (ftruncate64, 3, fd, 0, low, high); -#elif __BYTE_ORDER == __BIG_ENDIAN - int result = INLINE_SYSCALL (ftruncate64, 3, fd, 0, high, low); -#endif + int result = INLINE_SYSCALL (ftruncate64, 3, fd, 0, + __LONG_LONG_SPLIT (length)); #ifndef __ASSUME_TRUNCATE64_SYSCALL if (result != -1 || errno != ENOSYS) #endif Index: sysdeps/unix/sysv/linux/mips/pread.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pread.c,v retrieving revision 1.4 diff -u -p -r1.4 pread.c --- pread.c 2000/05/30 12:50:17 1.4 +++ pread.c 2000/07/06 20:44:14 @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -46,11 +47,8 @@ __libc_pread (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if defined(__MIPSEB__) - result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, 0, offset); -# elif defined(__MIPSEL__) - result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, offset, 0); -# endif + result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, + __LONG_LONG_SPLIT (offset)); # if __ASSUME_PREAD_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/mips/pread64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pread64.c,v retrieving revision 1.5 diff -u -p -r1.5 pread64.c --- pread64.c 2000/05/30 12:50:17 1.5 +++ pread64.c 2000/07/06 20:44:14 @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -47,14 +48,8 @@ __libc_pread64 (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if defined(__MIPSEB__) - result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, (off_t) (offset >> 32), - (off_t) (offset & 0xffffffff)); -# elif defined(__MIPSEL__) result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, - (off_t) (offset & 0xffffffff), - (off_t) (offset >> 32)); -# endif + __LONG_LONG_SPLIT (offset)); # if __ASSUME_PREAD_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/mips/pwrite.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pwrite.c,v retrieving revision 1.4 diff -u -p -r1.4 pwrite.c --- pwrite.c 2000/05/30 12:50:17 1.4 +++ pwrite.c 2000/07/06 20:44:14 @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -45,11 +46,8 @@ __libc_pwrite (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if defined(__MIPSEB__) - result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, 0, offset); -# elif defined(__MIPSEL__) - result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, offset, 0); -# endif + result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, + __LONG_LONG_SPLIT (offset)); # if __ASSUME_PWRITE_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/mips/pwrite64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pwrite64.c,v retrieving revision 1.5 diff -u -p -r1.5 pwrite64.c --- pwrite64.c 2000/05/30 12:50:17 1.5 +++ pwrite64.c 2000/07/06 20:44:14 @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -45,15 +46,8 @@ __libc_pwrite64 (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ -# if defined(__MIPSEB__) - result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, (off_t) (offset >> 32), - (off_t) (offset & 0xffffffff)); -# elif defined(__MIPSEL__) result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, - (off_t) (offset & 0xffffffff), - (off_t) (offset >> 32)); -# endif - + __LONG_LONG_SPLIT (offset)); # if __ASSUME_PWRITE_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/mips/truncate64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/truncate64.c,v retrieving revision 1.2 diff -u -p -r1.2 truncate64.c --- truncate64.c 2000/05/31 12:00:45 1.2 +++ truncate64.c 2000/07/06 20:44:14 @@ -45,19 +45,11 @@ truncate64 (const char *path, off64_t le if (! __have_no_truncate64) #endif { - unsigned int low = length & 0xffffffff; - unsigned int high = length >> 32; #ifndef __ASSUME_TRUNCATE64_SYSCALL int saved_errno = errno; #endif -#if __BYTE_ORDER == __LITTLE_ENDIAN - /* Use a fill argument to pass low, high in an aligned pair of - arguments (here 2/3). */ - int result = INLINE_SYSCALL (truncate64, 3, path, 0, low, high); -#elif __BYTE_ORDER == __BIG_ENDIAN - int result = INLINE_SYSCALL (truncate64, 3, path, 0, high, low); -#endif - + int result = INLINE_SYSCALL (truncate64, 3, path, 0, + __LONG_LONG_SPLIT (length)); #ifndef __ASSUME_TRUNCATE64_SYSCALL if (result != -1 || errno != ENOSYS) #endif From drepper@redhat.com Thu Jul 6 14:00:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 06 Jul 2000 14:00:00 -0000 Subject: PATCH: eliminate some endian #ifs References: <200007062007.NAA25310@kayak.mcgary.org> Message-ID: Greg McGary writes: > I refined this a bit further: __LONG_LONG_SPLIT accepts a single > 64-bit quantity, breaks it into two 32-bit args, and passes the pieces > according to __BYTE_ORDER. The macro does not belong in endian.h. Remove it there. The rest is OK. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Thu Jul 6 14:02:00 2000 From: greg@mcgary.org (Greg McGary) Date: Thu, 06 Jul 2000 14:02:00 -0000 Subject: PATCH: eliminate some endian #ifs References: <200007062007.NAA25310@kayak.mcgary.org> Message-ID: Ulrich Drepper writes: > The macro does not belong in endian.h. Remove it there. The rest is OK. Where do you recommend that it go? From drepper@redhat.com Thu Jul 6 14:14:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 06 Jul 2000 14:14:00 -0000 Subject: PATCH: eliminate some endian #ifs References: <200007062007.NAA25310@kayak.mcgary.org> Message-ID: Greg McGary writes: > Where do you recommend that it go? If you generally need it, include/endian.h. string/endian.h gets installed as a system header, include/endian.h not. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From jakub@redhat.com Thu Jul 6 14:17:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 06 Jul 2000 14:17:00 -0000 Subject: PATCH: eliminate some endian #ifs References: <200007062007.NAA25310@kayak.mcgary.org> Message-ID: <20000706231911.B12509@sunsite.ms.mff.cuni.cz> On Thu, Jul 06, 2000 at 01:55:16PM -0700, Greg McGary wrote: > Ulrich Drepper writes: > > > > No build-shared & build-static failures or binary differences for i686. > > Same deal. > > I refined this a bit further: __LONG_LONG_SPLIT accepts a single > 64-bit quantity, breaks it into two 32-bit args, and passes the pieces > according to __BYTE_ORDER. This will not correctly if 32bit value (such as off_t on 32bit arch; see pread/pwrite below e.g.) is passed to __LONG_LONG_SPLIT. You'll get a warning: right shift count >= width of type and undefined result. You must either use something like: #define __LONG_LONG_SPLIT(LL) \ __LONG_LONG_PAIR (((unsigned long long)(LL)) >> 32, (LL) & 0xffffffff) or not use __LONG_LONG_SPLIT on 32bit types. Jakub From greg@mcgary.org Thu Jul 6 14:43:00 2000 From: greg@mcgary.org (Greg McGary) Date: Thu, 06 Jul 2000 14:43:00 -0000 Subject: PATCH: eliminate some endian #ifs References: <200007062007.NAA25310@kayak.mcgary.org> <20000706231911.B12509@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > This will not correctly if 32bit value (such as off_t on 32bit arch; see > pread/pwrite below e.g.) is passed to __LONG_LONG_SPLIT. > You'll get a > warning: right shift count >= width of type > and undefined result. > You must either use something like: > #define __LONG_LONG_SPLIT(LL) \ > __LONG_LONG_PAIR (((unsigned long long)(LL)) >> 32, (LL) & 0xffffffff) > or not use __LONG_LONG_SPLIT on 32bit types. > > Jakub Thanks. Here's the revised def'n: /* This macro intended to break apart a off64_t into two 32-bit off_t halves, presented as a comma-separated pair for subsequent passing as separate arguments to INLINE_SYSCALL, in an order determined by __BYTE_ORDER. Note that we cast LL to unsigned types. off_t and off64_t are signed, but pread and pwrite internally convert negative 32-bit quantities to unsigned 64-bit. */ #define __LONG_LONG_SPLIT(LL) \ __LONG_LONG_PAIR ((uint32_t) (((uint64_t) (LL)) >> 32), \ (uint64_t) ((LL) & 0xffffffff)) From jakub@redhat.com Thu Jul 6 14:47:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 06 Jul 2000 14:47:00 -0000 Subject: PATCH: eliminate some endian #ifs References: <200007062007.NAA25310@kayak.mcgary.org> <20000706231911.B12509@sunsite.ms.mff.cuni.cz> Message-ID: <20000706234926.D12509@sunsite.ms.mff.cuni.cz> On Thu, Jul 06, 2000 at 02:43:20PM -0700, Greg McGary wrote: > Thanks. Here's the revised def'n: > > > /* This macro intended to break apart a off64_t into two 32-bit off_t > halves, presented as a comma-separated pair for subsequent passing > as separate arguments to INLINE_SYSCALL, in an order determined by > __BYTE_ORDER. Note that we cast LL to unsigned types. off_t and > off64_t are signed, but pread and pwrite internally convert > negative 32-bit quantities to unsigned 64-bit. */ > > #define __LONG_LONG_SPLIT(LL) \ > __LONG_LONG_PAIR ((uint32_t) (((uint64_t) (LL)) >> 32), \ > (uint64_t) ((LL) & 0xffffffff)) ^^ 32 Jakub From greg@mcgary.org Thu Jul 6 14:49:00 2000 From: greg@mcgary.org (Greg McGary) Date: Thu, 06 Jul 2000 14:49:00 -0000 Subject: PATCH: eliminate some endian #ifs References: <200007062007.NAA25310@kayak.mcgary.org> <20000706231911.B12509@sunsite.ms.mff.cuni.cz> <20000706234926.D12509@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > > #define __LONG_LONG_SPLIT(LL) \ > > __LONG_LONG_PAIR ((uint32_t) (((uint64_t) (LL)) >> 32), \ > > (uint64_t) ((LL) & 0xffffffff)) > ^^ > 32 Yep, and the build failed because of it too. Time to get a new brain. From greg@mcgary.org Thu Jul 6 16:20:00 2000 From: greg@mcgary.org (Greg McGary) Date: Thu, 06 Jul 2000 16:20:00 -0000 Subject: PATCH: eliminate some endian #ifs References: <200007062007.NAA25310@kayak.mcgary.org> Message-ID: Greg McGary writes: > Ulrich Drepper writes: > > > > No build-shared & build-static failures or binary differences for i686. > > Same deal. > > I refined this a bit further: __LONG_LONG_SPLIT accepts a single > 64-bit quantity, breaks it into two 32-bit args, and passes the pieces > according to __BYTE_ORDER. FYI, When all the dust settled, I got binary differences with this one, so I'll just drop it. I'm going to check in my first patch which had no binary differences. From drepper@redhat.com Thu Jul 6 16:22:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 06 Jul 2000 16:22:00 -0000 Subject: Patch for crypt/Makefile References: Message-ID: Andreas Jaeger writes: > Here's a patch which I've tested with static and shared libs. Ok to > commit? I've applied it. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Jul 6 16:24:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 06 Jul 2000 16:24:00 -0000 Subject: [PATCH] LC_TELEPHONE int_prefixes for all locales References: <20000706155811.B7043@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > Used a phone book and a little bit of awk... Thanks a lot, I've applied the patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Jul 6 16:28:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 06 Jul 2000 16:28:00 -0000 Subject: [PATCH] Sparc fixes References: <20000706225448.A12509@sunsite.ms.mff.cuni.cz> Message-ID: Jakub Jelinek writes: > This removes some warnings and fixes a typo in spinlock.h which prevents > building glibc on sparc32. Thanks, I've applied the patches. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Thu Jul 6 18:22:00 2000 From: greg@mcgary.org (Greg McGary) Date: Thu, 06 Jul 2000 18:22:00 -0000 Subject: PATCH: bounds checks for many syscalls Message-ID: <200007070121.SAA13014@kayak.mcgary.org> i686-pc-linux-gnu: No build-shared & build-static failures. No binary differences for non-BP. These are all syscalls except SysV IPC (shm, msg, sem) and Streams, since those pass structs that contain pointers between user & kernel, and require extra effort. OK? 2000-07-06 Greg McGary * sysdeps/generic/bp-checks.h (CHECK_SIGSET, CHECK_SIGSETopt): New macros. * sysdeps/generic/strcpy.c: Add bounds checks. * sysdeps/unix/fxstat.c: Likewise. * sysdeps/unix/xstat.c: Likewise. * sysdeps/unix/common/lxstat.c: Likewise. * sysdeps/unix/sysv/linux/aio_sigqueue.c: Likewise. * sysdeps/unix/sysv/linux/execve.c: Likewise. * sysdeps/unix/sysv/linux/fxstat.c: Likewise. * sysdeps/unix/sysv/linux/fxstat64.c: Likewise. * sysdeps/unix/sysv/linux/getcwd.c: Likewise. * sysdeps/unix/sysv/linux/getdents.c: Likewise. * sysdeps/unix/sysv/linux/llseek.c: Likewise. * sysdeps/unix/sysv/linux/lxstat.c: Likewise. * sysdeps/unix/sysv/linux/lxstat64.c: Likewise. * sysdeps/unix/sysv/linux/poll.c: Likewise. * sysdeps/unix/sysv/linux/pread.c: Likewise. * sysdeps/unix/sysv/linux/pread64.c: Likewise. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. * sysdeps/unix/sysv/linux/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/pwrite64.c: Likewise. * sysdeps/unix/sysv/linux/readv.c: Likewise. * sysdeps/unix/sysv/linux/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/sigpending.c: Likewise. * sysdeps/unix/sysv/linux/sigprocmask.c: Likewise. * sysdeps/unix/sysv/linux/sigqueue.c: Likewise. * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise. * sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise. * sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise. * sysdeps/unix/sysv/linux/sysctl.c: Likewise. * sysdeps/unix/sysv/linux/truncate64.c: Likewise. * sysdeps/unix/sysv/linux/ustat.c: Likewise. * sysdeps/unix/sysv/linux/writev.c: Likewise. * sysdeps/unix/sysv/linux/xmknod.c: Likewise. * sysdeps/unix/sysv/linux/xstat.c: Likewise. * sysdeps/unix/sysv/linux/xstat64.c: Likewise. * sysdeps/unix/sysv/linux/arm/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/i386/brk.c: Likewise. * sysdeps/unix/sysv/linux/i386/chown.c: Likewise. * sysdeps/unix/sysv/linux/i386/fxstat.c: Likewise. * sysdeps/unix/sysv/linux/i386/getgroups.c: Likewise. * sysdeps/unix/sysv/linux/i386/getresgid.c: Likewise. * sysdeps/unix/sysv/linux/i386/getresuid.c: Likewise. * sysdeps/unix/sysv/linux/i386/getrlimit.c: Likewise. * sysdeps/unix/sysv/linux/i386/lchown.c: Likewise. * sysdeps/unix/sysv/linux/i386/lxstat.c: Likewise. * sysdeps/unix/sysv/linux/i386/setgroups.c: Likewise. * sysdeps/unix/sysv/linux/i386/setrlimit.c: Likewise. * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/i386/xstat.c: Likewise. * sysdeps/unix/sysv/linux/ia64/fxstat.c: Likewise. * sysdeps/unix/sysv/linux/ia64/lxstat.c: Likewise. * sysdeps/unix/sysv/linux/ia64/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/ia64/sigpending.c: Likewise. * sysdeps/unix/sysv/linux/ia64/sigprocmask.c: Likewise. * sysdeps/unix/sysv/linux/ia64/sigsuspend.c: Likewise. * sysdeps/unix/sysv/linux/ia64/xstat.c: Likewise. * sysdeps/unix/sysv/linux/m68k/chown.c: Likewise. * sysdeps/unix/sysv/linux/mips/pread.c: Likewise. * sysdeps/unix/sysv/linux/mips/pread64.c: Likewise. * sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise. * sysdeps/unix/sysv/linux/mips/truncate64.c: Likewise. * sysdeps/unix/sysv/linux/mips/ustat.c: Likewise. * sysdeps/unix/sysv/linux/mips/xmknod.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sigsuspend.c: Likewise. Index: sysdeps/generic/bp-checks.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/generic/bp-checks.h,v retrieving revision 1.1 diff -u -p -r1.1 bp-checks.h --- bp-checks.h 2000/07/06 00:48:38 1.1 +++ bp-checks.h 2000/07/07 01:03:51 @@ -68,6 +68,9 @@ extern int __ubp_memchr (const char *__u && BOUNDS_VIOLATED), \ __ptrvalue (ARG)) +# define CHECK_SIGSET(SET) CHECK_N ((SET), _NSIG / (8 * sizeof *(SET))) +# define CHECK_SIGSETopt(SET) CHECK_Nopt ((SET), _NSIG / (8 * sizeof *(SET))) + # else /* !__BOUNDED_POINTERS__ */ /* Do nothing if not compiling with -fbounded-pointers. */ @@ -80,6 +83,8 @@ extern int __ubp_memchr (const char *__u # define CHECK_N(ARG, N) (ARG) # define CHECK_Nopt(ARG, N) (ARG) # define CHECK_STRING(ARG) (ARG) +# define CHECK_SIGSET(SET) (SET) +# define CHECK_SIGSETopt(SET) (SET) # endif /* !__BOUNDED_POINTERS__ */ Index: sysdeps/generic/strcpy.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/generic/strcpy.c,v retrieving revision 1.4 diff -u -p -r1.4 strcpy.c --- strcpy.c 1997/09/11 03:18:17 1.4 +++ strcpy.c 2000/07/07 01:03:51 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1997, 2000 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 @@ -19,6 +19,7 @@ #include #include #include +#include #undef strcpy @@ -29,8 +30,9 @@ strcpy (dest, src) const char *src; { reg_char c; - char *s = (char *) src; - const ptrdiff_t off = dest - src - 1; + char *__unbounded s = (char *__unbounded) CHECK_BOUNDS_LOW (src); + const ptrdiff_t off = CHECK_BOUNDS_LOW (dest) - s - 1; + size_t n; do { @@ -38,6 +40,10 @@ strcpy (dest, src) s[off] = c; } while (c != '\0'); + + n = s - src; + CHECK_BOUNDS_HIGH (src + n); + CHECK_BOUNDS_HIGH (dest + n); return dest; } Index: sysdeps/unix/fxstat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/fxstat.c,v retrieving revision 1.3 diff -u -p -r1.3 fxstat.c --- fxstat.c 1997/06/23 21:53:50 1.3 +++ fxstat.c 2000/07/07 01:03:51 @@ -1,5 +1,5 @@ /* fxstat using old-style Unix fstat system call. - Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1991, 1995, 1996, 1997, 2000 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 @@ -20,8 +20,9 @@ #include #include #include +#include -extern int __syscall_fstat (int, struct stat *); +extern int __syscall_fstat (int, struct stat *__unbounded); /* Get information about the file descriptor FD in BUF. */ int @@ -32,7 +33,7 @@ __fxstat (int vers, int fd, struct stat __set_errno (EINVAL); return -1; } - - return __syscall_fstat (fd, buf); + + return __syscall_fstat (fd, CHECK_1 (buf)); } weak_alias (__fxstat, _fxstat) Index: sysdeps/unix/xstat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/xstat.c,v retrieving revision 1.3 diff -u -p -r1.3 xstat.c --- xstat.c 1997/06/23 21:53:51 1.3 +++ xstat.c 2000/07/07 01:03:51 @@ -1,5 +1,5 @@ /* xstat using old-style Unix stat system call. - Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1991, 1995, 1996, 1997, 2000 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 @@ -20,8 +20,9 @@ #include #include #include +#include -extern int __syscall_stat (const char *, struct stat *); +extern int __syscall_stat (const char *__unbounded, struct stat *__unbounded); int __xstat (int vers, const char *file, struct stat *buf) @@ -32,6 +33,6 @@ __xstat (int vers, const char *file, str return -1; } - return __syscall_stat (file, buf); + return __syscall_stat (CHECK_STRING (file), CHECK_1 (buf)); } weak_alias (__xstat, _xstat) Index: sysdeps/unix/common/lxstat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/common/lxstat.c,v retrieving revision 1.3 diff -u -p -r1.3 lxstat.c --- lxstat.c 1997/06/23 21:54:20 1.3 +++ lxstat.c 2000/07/07 01:03:51 @@ -1,5 +1,5 @@ /* lxstat using old-style Unix lstat system call. - Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1991, 1995, 1996, 1997, 2000 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 @@ -20,8 +20,9 @@ #include #include #include +#include -extern int __syscall_lstat (const char *, struct stat *); +extern int __syscall_lstat (const char *__unbounded, struct stat *__unbounded); int __lxstat (int vers, const char *file, struct stat *buf) @@ -32,6 +33,6 @@ __lxstat (int vers, const char *file, st return -1; } - return __syscall_lstat (file, buf); + return __syscall_lstat (CHECK_STRING (file), CHECK_1 (buf)); } weak_alias (__lxstat, _lxstat) Index: sysdeps/unix/sysv/linux/aio_sigqueue.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/aio_sigqueue.c,v retrieving revision 1.8 diff -u -p -r1.8 aio_sigqueue.c --- aio_sigqueue.c 2000/01/24 11:48:05 1.8 +++ aio_sigqueue.c 2000/07/07 01:03:51 @@ -28,7 +28,7 @@ #include "aio_misc.h" #ifdef __NR_rt_sigqueueinfo -extern int __syscall_rt_sigqueueinfo (int, int, siginfo_t *); +extern int __syscall_rt_sigqueueinfo (int, int, siginfo_t *__unbounded); /* Return any pending signal or wait for one for the given time. */ @@ -50,7 +50,8 @@ __aio_sigqueue (sig, val, caller_pid) info.si_uid = getuid (); info.si_value = val; - return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid, sig, &info); + return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid, + sig, __ptrvalue (&info)); } #else # include Index: sysdeps/unix/sysv/linux/execve.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/execve.c,v retrieving revision 1.5 diff -u -p -r1.5 execve.c --- execve.c 2000/02/17 00:21:45 1.5 +++ execve.c 2000/07/07 01:03:51 @@ -21,9 +21,11 @@ #include #include +#include -extern int __syscall_execve (const char *file, char *const argv[], - char *const envp[]); +extern int __syscall_execve (const char *__unbounded file, + char *__unbounded const *__unbounded argv, + char *__unbounded const *__unbounded envp); extern void __pthread_kill_other_threads_np (void); weak_extern (__pthread_kill_other_threads_np) @@ -37,7 +39,32 @@ __execve (file, argv, envp) /* If this is a threaded application kill all other threads. */ if (__pthread_kill_other_threads_np) __pthread_kill_other_threads_np (); +#if __BOUNDED_POINTERS__ + { + char **v; + int i; + char *__unbounded *__unbounded ubp_argv; + char *__unbounded *__unbounded ubp_envp; + char *__unbounded *__unbounded ubp_v; + for (v = argv; *v; v++) + ; + i = v - argv + 1; + ubp_argv = (char *__unbounded *__unbounded) alloca (sizeof (*ubp_argv) * i); + for (v = argv, ubp_v = ubp_argv; i--; v++, ubp_v++) + *ubp_v = CHECK_STRING (*v); + + for (v = envp; *v; v++) + ; + i = v - envp + 1; + ubp_envp = (char *__unbounded *__unbounded) alloca (sizeof (*ubp_envp) * i); + for (v = envp, ubp_v = ubp_envp; i--; v++, ubp_v++) + *ubp_v = CHECK_STRING (*v); + + return INLINE_SYSCALL (execve, 3, CHECK_STRING (file), ubp_argv, ubp_envp); + } +#else return INLINE_SYSCALL (execve, 3, file, argv, envp); +#endif } weak_alias (__execve, execve) Index: sysdeps/unix/sysv/linux/fxstat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/fxstat.c,v retrieving revision 1.4 diff -u -p -r1.4 fxstat.c --- fxstat.c 1998/10/21 15:08:23 1.4 +++ fxstat.c 2000/07/07 01:03:51 @@ -1,5 +1,5 @@ /* fxstat using old-style Unix fstat system call. - Copyright (C) 1991, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1991, 1995, 1996, 1997, 1998, 2000 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 @@ -28,10 +28,11 @@ #include #include +#include #include -extern int __syscall_fstat (int, struct kernel_stat *); +extern int __syscall_fstat (int, struct kernel_stat *__unbounded); /* Get information about the file FD in BUF. */ int @@ -41,11 +42,9 @@ __fxstat (int vers, int fd, struct stat int result; if (vers == _STAT_VER_KERNEL) - { - return INLINE_SYSCALL (fstat, 2, fd, (struct kernel_stat *) buf); - } + return INLINE_SYSCALL (fstat, 2, fd, CHECK_1 ((struct kernel_stat *) buf)); - result = INLINE_SYSCALL (fstat, 2, fd, &kbuf); + result = INLINE_SYSCALL (fstat, 2, fd, __ptrvalue (&kbuf)); if (result == 0) result = xstat_conv (vers, &kbuf, buf); Index: sysdeps/unix/sysv/linux/fxstat64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/fxstat64.c,v retrieving revision 1.6 diff -u -p -r1.6 fxstat64.c --- fxstat64.c 1999/12/27 07:54:14 1.6 +++ fxstat64.c 2000/07/07 01:03:51 @@ -1,5 +1,5 @@ /* fxstat64 using old-style Unix fstat system call. - Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000 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 @@ -24,16 +24,18 @@ #include #include +#include + #include "kernel-features.h" #if __ASSUME_STAT64_SYSCALL == 0 # include #endif -extern int __syscall_fstat (int, struct kernel_stat *); +extern int __syscall_fstat (int, struct kernel_stat *__unbounded); #ifdef __NR_fstat64 -extern int __syscall_fstat64 (int, struct stat64 *); +extern int __syscall_fstat64 (int, struct stat64 *__unbounded); # if __ASSUME_STAT64_SYSCALL == 0 /* The variable is shared between all wrappers around *stat64 calls. */ extern int __have_no_stat64; @@ -45,7 +47,7 @@ int __fxstat64 (int vers, int fd, struct stat64 *buf) { #if __ASSUME_STAT64_SYSCALL > 0 - return INLINE_SYSCALL (fstat64, 2, fd, buf); + return INLINE_SYSCALL (fstat64, 2, fd, CHECK_1 (buf)); #else int result; struct kernel_stat kbuf; @@ -53,7 +55,7 @@ __fxstat64 (int vers, int fd, struct sta if (! __have_no_stat64) { int saved_errno = errno; - result = INLINE_SYSCALL (fstat64, 2, fd, buf); + result = INLINE_SYSCALL (fstat64, 2, fd, CHECK_1 (buf)); if (result != -1 || errno != ENOSYS) return result; @@ -62,7 +64,7 @@ __fxstat64 (int vers, int fd, struct sta __have_no_stat64 = 1; } # endif - result = INLINE_SYSCALL (fstat, 2, fd, &kbuf); + result = INLINE_SYSCALL (fstat, 2, fd, __ptrvalue (&kbuf)); if (result == 0) result = xstat64_conv (vers, &kbuf, buf); Index: sysdeps/unix/sysv/linux/getcwd.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/getcwd.c,v retrieving revision 1.13 diff -u -p -r1.13 getcwd.c --- getcwd.c 1999/08/20 23:43:47 1.13 +++ getcwd.c 2000/07/07 01:03:51 @@ -1,5 +1,5 @@ /* Determine current working directory. Linux version. - Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -26,6 +26,7 @@ #include #include +#include #include "kernel-features.h" @@ -34,7 +35,7 @@ /* Kernel 2.1.92 introduced a third way to get the current working directory: a syscall. We've got to be careful that even when compiling under 2.1.92+ the libc still runs under older kernels. */ -extern int __syscall_getcwd (char *buf, unsigned long size); +extern int __syscall_getcwd (char *__unbounded buf, unsigned long size); # define no_syscall_getcwd 0 # define have_new_dcache 1 /* This is a trick since we don't define generic_getcwd. */ @@ -51,7 +52,7 @@ static char *generic_getcwd (char *buf, /* Kernel 2.1.92 introduced a third way to get the current working directory: a syscall. We've got to be careful that even when compiling under 2.1.92+ the libc still runs under older kernels. */ -extern int __syscall_getcwd (char *buf, unsigned long size); +extern int __syscall_getcwd (char *__unbounded buf, unsigned long size); static int no_syscall_getcwd; static int have_new_dcache; # else @@ -99,7 +100,7 @@ __getcwd (char *buf, size_t size) { int retval; - retval = INLINE_SYSCALL (getcwd, 2, path, alloc_size); + retval = INLINE_SYSCALL (getcwd, 2, CHECK_STRING (path), alloc_size); if (retval >= 0) { if (buf == NULL) Index: sysdeps/unix/sysv/linux/getdents.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/getdents.c,v retrieving revision 1.10 diff -u -p -r1.10 getdents.c --- getdents.c 2000/04/10 05:25:12 1.10 +++ getdents.c 2000/07/07 01:03:51 @@ -28,14 +28,14 @@ #include #include +#include #include #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +extern int __syscall_getdents (int fd, char *__unbounded buf, size_t nbytes); -extern int __syscall_getdents (int fd, char *buf, size_t nbytes); - /* For Linux we need a special version of this file since the definition of `struct dirent' is not the same for the kernel and the libc. There is one additional field which might be introduced @@ -84,7 +84,8 @@ __getdents (int fd, char *buf, size_t nb dp = (struct dirent *) buf; skdp = kdp = __alloca (red_nbytes); - retval = INLINE_SYSCALL (getdents, 3, fd, (char *) kdp, red_nbytes); + retval = INLINE_SYSCALL (getdents, 3, fd, + CHECK_N ((char *) kdp, red_nbytes), red_nbytes); if (retval == -1) return -1; Index: sysdeps/unix/sysv/linux/llseek.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/llseek.c,v retrieving revision 1.8 diff -u -p -r1.8 llseek.c --- llseek.c 2000/01/02 18:55:08 1.8 +++ llseek.c 2000/07/07 01:03:51 @@ -24,7 +24,7 @@ #include extern int __syscall__llseek (int fd, off_t offset_hi, off_t offset_lo, - loff_t *result, int whence); + loff_t *__unbounded result, int whence); /* Seek to OFFSET on FD, starting from WHENCE. */ loff_t @@ -34,7 +34,7 @@ __llseek (int fd, loff_t offset, int whe return (loff_t) (INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 32), (off_t) (offset & 0xffffffff), - &result, whence) ?: result); + __ptrvalue (&result), whence) ?: result); } weak_alias (__llseek, llseek) strong_alias (__llseek, __libc_lseek64) Index: sysdeps/unix/sysv/linux/lxstat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/lxstat.c,v retrieving revision 1.4 diff -u -p -r1.4 lxstat.c --- lxstat.c 1998/10/21 15:10:58 1.4 +++ lxstat.c 2000/07/07 01:03:51 @@ -1,5 +1,5 @@ /* lxstat using old-style Unix lstat system call. - Copyright (C) 1991, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1991, 1995, 1996, 1997, 1998, 2000 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 @@ -28,10 +28,11 @@ #include #include +#include #include -extern int __syscall_lstat (const char *, struct kernel_stat *); +extern int __syscall_lstat (const char *__unbounded, struct kernel_stat *__unbounded); /* Get information about the file NAME in BUF. */ int @@ -41,11 +42,10 @@ __lxstat (int vers, const char *name, st int result; if (vers == _STAT_VER_KERNEL) - { - return INLINE_SYSCALL (lstat, 2, name, (struct kernel_stat *) buf); - } + return INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), + CHECK_1 ((struct kernel_stat *) buf)); - result = INLINE_SYSCALL (lstat, 2, name, &kbuf); + result = INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), __ptrvalue (&kbuf)); if (result == 0) result = xstat_conv (vers, &kbuf, buf); Index: sysdeps/unix/sysv/linux/lxstat64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/lxstat64.c,v retrieving revision 1.6 diff -u -p -r1.6 lxstat64.c --- lxstat64.c 1999/12/27 07:53:54 1.6 +++ lxstat64.c 2000/07/07 01:03:51 @@ -1,5 +1,5 @@ /* lxstat64 using old-style Unix lstat system call. - Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000 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 @@ -24,16 +24,18 @@ #include #include +#include + #include "kernel-features.h" #if __ASSUME_STAT64_SYSCALL == 0 # include #endif -extern int __syscall_lstat (const char *, struct kernel_stat *); +extern int __syscall_lstat (const char *__unbounded, struct kernel_stat *__unbounded); #ifdef __NR_lstat64 -extern int __syscall_lstat64 (const char *, struct stat64 *); +extern int __syscall_lstat64 (const char *__unbounded, struct stat64 *__unbounded); # if __ASSUME_STAT64_SYSCALL == 0 /* The variable is shared between all wrappers around *stat64 calls. */ extern int __have_no_stat64; @@ -45,7 +47,7 @@ int __lxstat64 (int vers, const char *name, struct stat64 *buf) { #ifdef __ASSUME_STAT64_SYSCALL - return INLINE_SYSCALL (lstat64, 2, name, buf); + return INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), CHECK_1 (buf)); #else struct kernel_stat kbuf; int result; @@ -53,7 +55,7 @@ __lxstat64 (int vers, const char *name, if (! __have_no_stat64) { int saved_errno = errno; - result = INLINE_SYSCALL (lstat64, 2, name, buf); + result = INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), CHECK_1 (buf)); if (result != -1 || errno != ENOSYS) return result; @@ -62,7 +64,7 @@ __lxstat64 (int vers, const char *name, __have_no_stat64 = 1; } # endif - result = INLINE_SYSCALL (lstat, 2, name, &kbuf); + result = INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), __ptrvalue (&kbuf)); if (result == 0) result = xstat64_conv (vers, &kbuf, buf); Index: sysdeps/unix/sysv/linux/poll.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/poll.c,v retrieving revision 1.12 diff -u -p -r1.12 poll.c --- poll.c 2000/05/23 08:43:00 1.12 +++ poll.c 2000/07/07 01:03:51 @@ -22,13 +22,14 @@ #include #include +#include #include "kernel-features.h" #if defined __NR_poll || __ASSUME_POLL_SYSCALL > 0 -extern int __syscall_poll (struct pollfd *fds, unsigned int nfds, - int timeout); +extern int __syscall_poll (struct pollfd *__unbounded fds, + unsigned int nfds, int timeout); # if __ASSUME_POLL_SYSCALL == 0 static int __emulate_poll (struct pollfd *fds, unsigned long int nfds, @@ -48,7 +49,7 @@ __poll (fds, nfds, timeout) if (!must_emulate) { int errno_saved = errno; - int retval = INLINE_SYSCALL (poll, 3, fds, nfds, timeout); + int retval = INLINE_SYSCALL (poll, 3, CHECK_N (fds, nfds), nfds, timeout); if (retval >= 0 || errno != ENOSYS) return retval; @@ -59,7 +60,7 @@ __poll (fds, nfds, timeout) return __emulate_poll (fds, nfds, timeout); # else - return INLINE_SYSCALL (poll, 3, fds, nfds, timeout); + return INLINE_SYSCALL (poll, 3, CHECK_N (fds, nfds), nfds, timeout); # endif } weak_alias (__poll, poll) Index: sysdeps/unix/sysv/linux/pread.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/pread.c,v retrieving revision 1.10 diff -u -p -r1.10 pread.c --- pread.c 2000/07/06 23:42:33 1.10 +++ pread.c 2000/07/07 01:03:51 @@ -23,13 +23,14 @@ #include #include +#include #include "kernel-features.h" #if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0 /* The order of hi, lo depends on endianness. */ -extern ssize_t __syscall_pread (int fd, void *buf, size_t count, +extern ssize_t __syscall_pread (int fd, void *__unbounded buf, size_t count, off_t offset_hi, off_t offset_lo); # if __ASSUME_PREAD_SYSCALL == 0 @@ -48,9 +49,8 @@ __libc_pread (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ - result = INLINE_SYSCALL (pread, 5, fd, buf, count, + result = INLINE_SYSCALL (pread, 5, fd, CHECK_N (buf, count), count, __LONG_LONG_PAIR (0, offset)); - # if __ASSUME_PREAD_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/pread64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/pread64.c,v retrieving revision 1.10 diff -u -p -r1.10 pread64.c --- pread64.c 2000/07/06 23:42:33 1.10 +++ pread64.c 2000/07/07 01:03:52 @@ -23,12 +23,13 @@ #include #include +#include #include "kernel-features.h" #if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0 -extern ssize_t __syscall_pread (int fd, void *buf, size_t count, +extern ssize_t __syscall_pread (int fd, void *__unbounded buf, size_t count, off_t offset_hi, off_t offset_lo); # if __ASSUME_PREAD_SYSCALL == 0 @@ -47,10 +48,9 @@ __libc_pread64 (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ - result = INLINE_SYSCALL (pread, 5, fd, buf, count, + result = INLINE_SYSCALL (pread, 5, fd, CHECK_N (buf, count), count, __LONG_LONG_PAIR ((off_t) (offset >> 32), (off_t) (offset & 0xffffffff))); - # if __ASSUME_PREAD_SYSCALL == 0 if (result == -1 && errno == ENOSYS) /* No system call available. Use the emulation. */ Index: sysdeps/unix/sysv/linux/ptrace.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ptrace.c,v retrieving revision 1.7 diff -u -p -r1.7 ptrace.c --- ptrace.c 1998/10/21 15:11:03 1.7 +++ ptrace.c 2000/07/07 01:03:52 @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 1997, 1998, 2000 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 @@ -19,12 +19,15 @@ #include #include #include +#include #include #include #include +#include -extern long int __syscall_ptrace (int, pid_t, void *, void *); +extern long int __syscall_ptrace (int, pid_t, void *__unbounded, + void *__unbounded); long int ptrace (enum __ptrace_request request, ...) @@ -43,7 +46,56 @@ ptrace (enum __ptrace_request request, . if (request > 0 && request < 4) data = &ret; - res = INLINE_SYSCALL (ptrace, 4, request, pid, addr, data); +#if __BOUNDED_POINTERS__ + switch (request) + { + case PTRACE_PEEKTEXT: + case PTRACE_PEEKDATA: + case PTRACE_PEEKUSER: + case PTRACE_POKETEXT: + case PTRACE_POKEDATA: + case PTRACE_POKEUSER: + CHECK_1 ((int *) addr); + CHECK_1 ((int *) data); + break; + + case PTRACE_GETREGS: + case PTRACE_SETREGS: +#ifdef __i386__ + CHECK_1 ((struct user_regs_struct *) data); +#else + /* We don't know the size of data, so the best we can do is ensure + that `data' is valid for at least one word. */ + CHECK_1 ((int *) data); +#endif + break; + + case PTRACE_GETFPREGS: + case PTRACE_SETFPREGS: +#ifdef __i386__ + CHECK_1 ((struct user_fpregs_struct *) data); +#else + /* We don't know the size of data, so the best we can do is ensure + that `data' is valid for at least one word. */ + CHECK_1 ((int *) data); +#endif + break; + + case PTRACE_GETFPXREGS: + case PTRACE_SETFPXREGS: +#ifdef __i386__ + CHECK_1 ((struct user_fpxregs_struct *) data); +#else + /* We don't know the size of data, so the best we can do is ensure + that `data' is valid for at least one word. */ + CHECK_1 ((int *) data); +#endif + break; + }; +#endif + + res = INLINE_SYSCALL (ptrace, 4, request, pid, + __ptrvalue (addr), __ptrvalue (data)); if (res >= 0 && request > 0 && request < 4) { __set_errno (0); Index: sysdeps/unix/sysv/linux/pwrite.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/pwrite.c,v retrieving revision 1.9 diff -u -p -r1.9 pwrite.c --- pwrite.c 2000/07/06 23:42:33 1.9 +++ pwrite.c 2000/07/07 01:03:52 @@ -23,13 +23,14 @@ #include #include +#include #include "kernel-features.h" #if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0 /* The order of hi, lo depends on endianness. */ -extern ssize_t __syscall_pwrite (int fd, const void *buf, size_t count, +extern ssize_t __syscall_pwrite (int fd, const void *__unbounded buf, size_t count, off_t offset_hi, off_t offset_lo); # if __ASSUME_PWRITE_SYSCALL == 0 @@ -48,7 +49,7 @@ __libc_pwrite (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ - result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, + result = INLINE_SYSCALL (pwrite, 5, fd, CHECK_N (buf, count), count, __LONG_LONG_PAIR (0, offset)); # if __ASSUME_PWRITE_SYSCALL == 0 if (result == -1 && errno == ENOSYS) Index: sysdeps/unix/sysv/linux/pwrite64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/pwrite64.c,v retrieving revision 1.9 diff -u -p -r1.9 pwrite64.c --- pwrite64.c 2000/07/06 23:42:33 1.9 +++ pwrite64.c 2000/07/07 01:03:52 @@ -23,12 +23,13 @@ #include #include +#include #include "kernel-features.h" #if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0 -extern ssize_t __syscall_pwrite (int fd, const void *buf, size_t count, +extern ssize_t __syscall_pwrite (int fd, const void *__unbounded buf, size_t count, off_t offset_hi, off_t offset_lo); # if __ASSUME_PWRITE_SYSCALL == 0 @@ -47,7 +48,7 @@ __libc_pwrite64 (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ - result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, + result = INLINE_SYSCALL (pwrite, 5, fd, CHECK_N (buf, count), count, __LONG_LONG_PAIR ((off_t) (offset >> 32), (off_t) (offset & 0xffffffff))); # if __ASSUME_PWRITE_SYSCALL == 0 Index: sysdeps/unix/sysv/linux/readv.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/readv.c,v retrieving revision 1.9 diff -u -p -r1.9 readv.c --- readv.c 2000/05/23 08:43:00 1.9 +++ readv.c 2000/07/07 01:03:52 @@ -24,8 +24,9 @@ #include #include +#include -extern ssize_t __syscall_readv (int, __const struct iovec *, int); +extern ssize_t __syscall_readv (int, __const struct iovec *__unbounded, int); static ssize_t __atomic_readv_replacement (int, __const struct iovec *, int) internal_function; @@ -47,7 +48,7 @@ __readv (fd, vector, count) int errno_saved = errno; ssize_t bytes_read; - bytes_read = INLINE_SYSCALL (readv, 3, fd, vector, count); + bytes_read = INLINE_SYSCALL (readv, 3, fd, CHECK_N (vector, count), count); if (bytes_read >= 0 || errno != EINVAL || count <= UIO_FASTIOV) return bytes_read; Index: sysdeps/unix/sysv/linux/sigaction.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sigaction.c,v retrieving revision 1.14 diff -u -p -r1.14 sigaction.c --- sigaction.c 1999/06/02 10:18:20 1.14 +++ sigaction.c 2000/07/07 01:03:52 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 1999, 2000 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 @@ -35,11 +35,11 @@ functions which have RT equivalents. This is the definition. */ int __libc_missing_rt_sigs; -extern int __syscall_sigaction (int, const struct old_kernel_sigaction *, - struct old_kernel_sigaction *); +extern int __syscall_sigaction (int, const struct old_kernel_sigaction *__unbounded, + struct old_kernel_sigaction *__unbounded); #endif -extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *, - struct kernel_sigaction *, size_t); +extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *__unbounded, + struct kernel_sigaction *__unbounded, size_t); /* If ACT is not NULL, change the action for SIG to *ACT. @@ -80,8 +80,9 @@ __sigaction (sig, act, oact) /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - result = INLINE_SYSCALL (rt_sigaction, 4, sig, act ? &kact : NULL, - oact ? &koact : NULL, _NSIG / 8); + result = INLINE_SYSCALL (rt_sigaction, 4, sig, + act ? __ptrvalue (&kact) : NULL, + oact ? __ptrvalue (&koact) : NULL, _NSIG / 8); # if __ASSUME_REALTIME_SIGNALS == 0 if (result >= 0 || errno != ENOSYS) @@ -116,8 +117,9 @@ __sigaction (sig, act, oact) k_sigact.sa_restorer = act->sa_restorer; # endif } - result = INLINE_SYSCALL (sigaction, 3, sig, act ? &k_sigact : NULL, - oact ? &k_osigact : NULL); + result = INLINE_SYSCALL (sigaction, 3, sig, + act ? __ptrvalue (&k_sigact) : NULL, + oact ? __ptrvalue (&k_osigact) : NULL); if (oact && result >= 0) { oact->sa_handler = k_osigact.k_sa_handler; Index: sysdeps/unix/sysv/linux/sigpending.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sigpending.c,v retrieving revision 1.9 diff -u -p -r1.9 sigpending.c --- sigpending.c 1999/05/26 23:33:34 1.9 +++ sigpending.c 2000/07/07 01:03:52 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 1999, 2000 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 @@ -22,11 +22,12 @@ #include #include +#include #include "kernel-features.h" -extern int __syscall_sigpending (sigset_t *); -extern int __syscall_rt_sigpending (sigset_t *, size_t); +extern int __syscall_sigpending (sigset_t *__unbounded); +extern int __syscall_rt_sigpending (sigset_t *__unbounded, size_t); /* The variable is shared between all wrappers around signal handling @@ -41,7 +42,7 @@ sigpending (set) sigset_t *set; { #if __ASSUME_REALTIME_SIGNALS > 0 - return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8); + return INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8); #else # ifdef __NR_rt_pending /* First try the RT signals. */ @@ -50,7 +51,7 @@ sigpending (set) /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ int saved_errno = errno; - int result = INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8); + int result = INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8); if (result >= 0 || errno != ENOSYS) return result; @@ -60,6 +61,6 @@ sigpending (set) } # endif - return INLINE_SYSCALL (sigpending, 1, set); + return INLINE_SYSCALL (sigpending, 1, CHECK_SIGSET (set)); #endif } Index: sysdeps/unix/sysv/linux/sigprocmask.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sigprocmask.c,v retrieving revision 1.9 diff -u -p -r1.9 sigprocmask.c --- sigprocmask.c 1999/05/26 23:33:35 1.9 +++ sigprocmask.c 2000/07/07 01:03:52 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 1999, 2000 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 @@ -22,13 +22,15 @@ #include #include +#include #include "kernel-features.h" -extern int __syscall_sigprocmask (int, const sigset_t *, sigset_t *); -extern int __syscall_rt_sigprocmask (int, const sigset_t *, sigset_t *, - size_t); +extern int __syscall_sigprocmask (int, const sigset_t *__unbounded, + sigset_t *__unbounded); +extern int __syscall_rt_sigprocmask (int, const sigset_t *__unbounded, + sigset_t *__unbounded, size_t); /* The variable is shared between all wrappers around signal handling functions which have RT equivalents. The definition is in sigaction.c. */ @@ -43,7 +45,8 @@ __sigprocmask (how, set, oset) sigset_t *oset; { #if __ASSUME_REALTIME_SIGNALS > 0 - return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8); + return INLINE_SYSCALL (rt_sigprocmask, 4, how, CHECK_SIGSET (set), + CHECK_SIGSETopt (oset), _NSIG / 8); #else # ifdef __NR_rt_sigprocmask /* First try the RT signals. */ @@ -52,8 +55,8 @@ __sigprocmask (how, set, oset) /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ int saved_errno = errno; - int result = INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, - _NSIG / 8); + int result = INLINE_SYSCALL (rt_sigprocmask, 4, how, CHECK_SIGSET (set), + CHECK_SIGSETopt (oset), _NSIG / 8); if (result >= 0 || errno != ENOSYS) return result; @@ -63,7 +66,8 @@ __sigprocmask (how, set, oset) } # endif - return INLINE_SYSCALL (sigprocmask, 3, how, set, oset); + return INLINE_SYSCALL (sigprocmask, 3, how, + CHECK_SIGSET (set), CHECK_SIGSETopt (oset)); #endif } weak_alias (__sigprocmask, sigprocmask) Index: sysdeps/unix/sysv/linux/sigqueue.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sigqueue.c,v retrieving revision 1.8 diff -u -p -r1.8 sigqueue.c --- sigqueue.c 2000/01/24 11:47:41 1.8 +++ sigqueue.c 2000/07/07 01:03:52 @@ -24,7 +24,7 @@ #include #include -extern int __syscall_rt_sigqueueinfo (int, int, siginfo_t *); +extern int __syscall_rt_sigqueueinfo (int, int, siginfo_t *__unbounded); #ifdef __NR_rt_sigqueueinfo /* Return any pending signal or wait for one for the given time. */ @@ -46,7 +46,7 @@ __sigqueue (pid, sig, val) info.si_uid = __getuid (); info.si_value = val; - return INLINE_SYSCALL (rt_sigqueueinfo, 3, pid, sig, &info); + return INLINE_SYSCALL (rt_sigqueueinfo, 3, pid, sig, __ptrvalue (&info)); } weak_alias (__sigqueue, sigqueue) #else Index: sysdeps/unix/sysv/linux/sigsuspend.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sigsuspend.c,v retrieving revision 1.13 diff -u -p -r1.13 sigsuspend.c --- sigsuspend.c 1999/05/26 23:33:36 1.13 +++ sigsuspend.c 2000/07/07 01:03:52 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 1999, 2000 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 @@ -22,11 +22,12 @@ #include #include +#include #include "kernel-features.h" extern int __syscall_sigsuspend (int, unsigned long int, unsigned long int); -extern int __syscall_rt_sigsuspend (const sigset_t *, size_t); +extern int __syscall_rt_sigsuspend (const sigset_t *__unbounded, size_t); /* The variable is shared between all wrappers around signal handling @@ -41,7 +42,7 @@ __sigsuspend (set) const sigset_t *set; { #if __ASSUME_REALTIME_SIGNALS - return INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8); + return INLINE_SYSCALL (rt_sigsuspend, 2, CHECK_SIGSET (set), _NSIG / 8); #else # ifdef __NR_rt_sigsuspend /* First try the RT signals. */ @@ -50,8 +51,8 @@ __sigsuspend (set) /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ int saved_errno = errno; - int result = INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8); - + int result = INLINE_SYSCALL (rt_sigsuspend, 2, + CHECK_SIGSET (set), _NSIG / 8); if (result >= 0 || errno != ENOSYS) return result; Index: sysdeps/unix/sysv/linux/sigtimedwait.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sigtimedwait.c,v retrieving revision 1.4 diff -u -p -r1.4 sigtimedwait.c --- sigtimedwait.c 1998/10/31 10:28:02 1.4 +++ sigtimedwait.c 2000/07/07 01:03:52 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 2000 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 @@ -21,10 +21,11 @@ #include #include +#include #ifdef __NR_rt_sigtimedwait -extern int __syscall_rt_sigtimedwait (const sigset_t *, siginfo_t *, - const struct timespec *, size_t); +extern int __syscall_rt_sigtimedwait (const sigset_t *__unbounded, siginfo_t *__unbounded, + const struct timespec *__unbounded, size_t); /* Return any pending signal or wait for one for the given time. */ @@ -36,7 +37,8 @@ __sigtimedwait (set, info, timeout) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - return INLINE_SYSCALL (rt_sigtimedwait, 4, set, info, timeout, _NSIG / 8); + return INLINE_SYSCALL (rt_sigtimedwait, 4, CHECK_SIGSET (set), + CHECK_1 (info), timeout, _NSIG / 8); } weak_alias (__sigtimedwait, sigtimedwait) #else Index: sysdeps/unix/sysv/linux/sigwaitinfo.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sigwaitinfo.c,v retrieving revision 1.5 diff -u -p -r1.5 sigwaitinfo.c --- sigwaitinfo.c 1998/10/31 10:28:01 1.5 +++ sigwaitinfo.c 2000/07/07 01:03:52 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 2000 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 @@ -23,10 +23,11 @@ #include #include +#include #ifdef __NR_rt_sigtimedwait -extern int __syscall_rt_sigtimedwait (const sigset_t *, siginfo_t *, - const struct timespec *, size_t); +extern int __syscall_rt_sigtimedwait (const sigset_t *__unbounded, siginfo_t *__unbounded, + const struct timespec *__unbounded, size_t); /* Return any pending signal or wait for one for the given time. */ @@ -37,7 +38,8 @@ __sigwaitinfo (set, info) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - return INLINE_SYSCALL (rt_sigtimedwait, 4, set, info, NULL, _NSIG / 8); + return INLINE_SYSCALL (rt_sigtimedwait, 4, CHECK_SIGSET (set), + CHECK_1 (info), NULL, _NSIG / 8); } weak_alias (__sigwaitinfo, sigwaitinfo) #else Index: sysdeps/unix/sysv/linux/sysctl.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sysctl.c,v retrieving revision 1.4 diff -u -p -r1.4 sysctl.c --- sysctl.c 1999/05/26 23:33:37 1.4 +++ sysctl.c 2000/07/07 01:03:52 @@ -1,5 +1,5 @@ /* Read or write system information. Linux version. - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000 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 @@ -22,13 +22,15 @@ #include #include +#include -extern int __syscall__sysctl (struct __sysctl_args *args); +extern int __syscall__sysctl (struct __sysctl_args *__unbounded args); int __sysctl (int *name, int nlen, void *oldval, size_t *oldlenp, void *newval, size_t newlen) { + /* GKM FIXME: force __sysctl_args decl to have unbounded pointers. */ struct __sysctl_args args = { name: name, @@ -38,7 +40,10 @@ __sysctl (int *name, int nlen, void *old newval: newval, newlen: newlen }; + CHECK_N (name, nlen); + CHECK_N (oldval, *oldlenp); + CHECK_N (newval, newlen); - return INLINE_SYSCALL (_sysctl, 1, &args); + return INLINE_SYSCALL (_sysctl, 1, __ptrvalue (&args)); } weak_alias (__sysctl, sysctl) Index: sysdeps/unix/sysv/linux/truncate64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/truncate64.c,v retrieving revision 1.9 diff -u -p -r1.9 truncate64.c --- truncate64.c 2000/07/06 23:42:33 1.9 +++ truncate64.c 2000/07/07 01:03:52 @@ -23,6 +23,7 @@ #include #include +#include #include "kernel-features.h" @@ -33,9 +34,9 @@ int __have_no_truncate64; #endif /* The order of hight, low depends on endianness. */ -extern int __syscall_truncate64 (const char *path, int high_length, int low_length); +extern int __syscall_truncate64 (const char *__unbounded path, + int high_length, int low_length); - /* Truncate the file FD refers to to LENGTH bytes. */ int truncate64 (const char *path, off64_t length) @@ -49,9 +50,8 @@ truncate64 (const char *path, off64_t le #ifndef __ASSUME_TRUNCATE64_SYSCALL int saved_errno = errno; #endif - int result = INLINE_SYSCALL (truncate64, 3, path, + int result = INLINE_SYSCALL (truncate64, 3, CHECK_STRING (path), __LONG_LONG_PAIR (high, low)); - #ifndef __ASSUME_TRUNCATE64_SYSCALL if (result != -1 || errno != ENOSYS) #endif Index: sysdeps/unix/sysv/linux/ustat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ustat.c,v retrieving revision 1.3 diff -u -p -r1.3 ustat.c --- ustat.c 1998/10/21 15:11:19 1.3 +++ ustat.c 2000/07/07 01:03:52 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -23,8 +23,9 @@ #include #include +#include -extern int __syscall_ustat (unsigned short int dev, struct ustat *ubuf); +extern int __syscall_ustat (unsigned short int, struct ustat *__unbounded); int ustat (dev_t dev, struct ustat *ubuf) @@ -34,5 +35,5 @@ ustat (dev_t dev, struct ustat *ubuf) /* We must convert the value to dev_t type used by the kernel. */ k_dev = ((major (dev) & 0xff) << 8) | (minor (dev) & 0xff); - return INLINE_SYSCALL (ustat, 2, k_dev, ubuf); + return INLINE_SYSCALL (ustat, 2, k_dev, CHECK_1 (ubuf)); } Index: sysdeps/unix/sysv/linux/writev.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/writev.c,v retrieving revision 1.9 diff -u -p -r1.9 writev.c --- writev.c 2000/05/23 08:43:00 1.9 +++ writev.c 2000/07/07 01:03:52 @@ -24,8 +24,9 @@ #include #include +#include -extern ssize_t __syscall_writev (int, const struct iovec *, int); +extern ssize_t __syscall_writev (int, const struct iovec *__unbounded, int); static ssize_t __atomic_writev_replacement (int, const struct iovec *, int) internal_function; @@ -47,7 +48,7 @@ __writev (fd, vector, count) int errno_saved = errno; ssize_t bytes_written; - bytes_written = INLINE_SYSCALL (writev, 3, fd, vector, count); + bytes_written = INLINE_SYSCALL (writev, 3, fd, CHECK_N (vector, count), count); if (bytes_written >= 0 || errno != EINVAL || count <= UIO_FASTIOV) return bytes_written; Index: sysdeps/unix/sysv/linux/xmknod.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/xmknod.c,v retrieving revision 1.2 diff -u -p -r1.2 xmknod.c --- xmknod.c 1998/10/21 15:11:21 1.2 +++ xmknod.c 2000/07/07 01:03:52 @@ -1,5 +1,5 @@ /* xmknod call using old-style Unix mknod system call. - Copyright (C) 1991, 93, 95, 96, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1991, 93, 95, 96, 97, 98, 2000 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 @@ -24,8 +24,9 @@ #include #include +#include -extern int __syscall_mknod (const char *, unsigned short int, +extern int __syscall_mknod (const char *__unbounded, unsigned short int, unsigned short int); /* Create a device file named PATH, with permission and special bits MODE @@ -45,7 +46,7 @@ __xmknod (int vers, const char *path, mo /* We must convert the value to dev_t type used by the kernel. */ k_dev = ((major (*dev) & 0xff) << 8) | (minor (*dev) & 0xff); - return INLINE_SYSCALL (mknod, 3, path, mode, k_dev); + return INLINE_SYSCALL (mknod, 3, CHECK_STRING (path), mode, k_dev); } weak_alias (__xmknod, _xmknod) Index: sysdeps/unix/sysv/linux/xstat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/xstat.c,v retrieving revision 1.4 diff -u -p -r1.4 xstat.c --- xstat.c 1998/10/21 15:11:22 1.4 +++ xstat.c 2000/07/07 01:03:52 @@ -1,5 +1,5 @@ /* xstat using old-style Unix stat system call. - Copyright (C) 1991, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1991, 1995, 1996, 1997, 1998, 2000 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 @@ -28,10 +28,11 @@ #include #include +#include #include -extern int __syscall_stat (const char *, struct kernel_stat *); +extern int __syscall_stat (const char *__unbounded, struct kernel_stat *__unbounded); /* Get information about the file NAME in BUF. */ int @@ -41,11 +42,11 @@ __xstat (int vers, const char *name, str int result; if (vers == _STAT_VER_KERNEL) - { - return INLINE_SYSCALL (stat, 2, name, (struct kernel_stat *) buf); - } + return INLINE_SYSCALL (stat, 2, CHECK_STRING (name), + CHECK_1 ((struct kernel_stat *) buf)); - result = INLINE_SYSCALL (stat, 2, name, &kbuf); + result = INLINE_SYSCALL (stat, 2, CHECK_STRING (name), + __ptrvalue (&kbuf)); if (result == 0) result = xstat_conv (vers, &kbuf, buf); Index: sysdeps/unix/sysv/linux/xstat64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/xstat64.c,v retrieving revision 1.6 diff -u -p -r1.6 xstat64.c --- xstat64.c 1999/12/27 07:53:32 1.6 +++ xstat64.c 2000/07/07 01:03:52 @@ -1,5 +1,5 @@ /* xstat64 using old-style Unix stat system call. - Copyright (C) 1991, 95, 96, 97, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1991, 95, 96, 97, 98, 99, 00 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 @@ -24,16 +24,18 @@ #include #include +#include + #include "kernel-features.h" #if __ASSUME_STAT64_SYSCALL == 0 # include #endif -extern int __syscall_stat (const char *, struct kernel_stat *); +extern int __syscall_stat (const char *__unbounded, struct kernel_stat *__unbounded); #ifdef __NR_stat64 -extern int __syscall_stat64 (const char *, struct stat64 *); +extern int __syscall_stat64 (const char *__unbounded, struct stat64 *__unbounded); # if __ASSUME_STAT64_SYSCALL == 0 /* The variable is shared between all wrappers around *stat64 calls. This is the definition. */ @@ -47,7 +49,7 @@ int __xstat64 (int vers, const char *name, struct stat64 *buf) { #if __ASSUME_STAT64_SYSCALL > 0 - return INLINE_SYSCALL (stat64, 2, name, buf); + return INLINE_SYSCALL (stat64, 2, CHECK_STRING (name), CHECK_1 (buf)); #else struct kernel_stat kbuf; int result; @@ -55,7 +57,7 @@ __xstat64 (int vers, const char *name, s if (! __have_no_stat64) { int saved_errno = errno; - result = INLINE_SYSCALL (stat64, 2, name, buf); + result = INLINE_SYSCALL (stat64, 2, CHECK_STRING (name), CHECK_1 (buf)); if (result != -1 || errno != ENOSYS) return result; @@ -65,7 +67,7 @@ __xstat64 (int vers, const char *name, s } # endif - result = INLINE_SYSCALL (stat, 2, name, &kbuf); + result = INLINE_SYSCALL (stat, 2, CHECK_STRING (name), __ptrvalue (&kbuf)); if (result == 0) result = xstat64_conv (vers, &kbuf, buf); Index: sysdeps/unix/sysv/linux/arm/sigaction.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/arm/sigaction.c,v retrieving revision 1.3 diff -u -p -r1.3 sigaction.c --- sigaction.c 1999/04/15 14:45:16 1.3 +++ sigaction.c 2000/07/07 01:03:52 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 1999, 2000 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 @@ -28,10 +28,10 @@ translate it here. */ #include -extern int __syscall_sigaction (int, const struct old_kernel_sigaction *, - struct old_kernel_sigaction *); -extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *, - struct kernel_sigaction *, size_t); +extern int __syscall_sigaction (int, const struct old_kernel_sigaction *__unbounded, + struct old_kernel_sigaction *__unbounded); +extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *__unbounded, + struct kernel_sigaction *__unbounded, size_t); /* The variable is shared between all wrappers around signal handling functions which have RT equivalents. */ @@ -95,8 +95,9 @@ __sigaction (sig, act, oact) /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - result = INLINE_SYSCALL (rt_sigaction, 4, sig, act ? &kact : NULL, - oact ? &koact : NULL, _NSIG / 8); + result = INLINE_SYSCALL (rt_sigaction, 4, sig, + act ? __ptrvalue (&kact) : NULL, + oact ? __ptrvalue (&koact) : NULL, _NSIG / 8); if (result >= 0 || errno != ENOSYS) { @@ -133,8 +134,9 @@ __sigaction (sig, act, oact) } #endif } - result = INLINE_SYSCALL (sigaction, 3, sig, act ? &k_sigact : NULL, - oact ? &k_osigact : NULL); + result = INLINE_SYSCALL (sigaction, 3, sig, + act ? __ptrvalue (&k_sigact) : NULL, + oact ? __ptrvalue (&k_osigact) : NULL); if (oact && result >= 0) { oact->sa_handler = k_osigact.k_sa_handler; Index: sysdeps/unix/sysv/linux/i386/brk.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/brk.c,v retrieving revision 1.5 diff -u -p -r1.5 brk.c --- brk.c 1996/11/28 04:16:05 1.5 +++ brk.c 2000/07/07 01:03:52 @@ -1,5 +1,5 @@ /* brk system call for Linux/i386. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 2000 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 @@ -21,6 +21,8 @@ #include #include +#include + /* This must be initialized data because commons can't have aliases. */ void *__curbrk = 0; @@ -32,14 +34,14 @@ weak_alias (__curbrk, ___brk_addr) int __brk (void *addr) { - void *newbrk, *scratch; + void *__unbounded newbrk, *__unbounded scratch; asm ("movl %%ebx, %1\n" /* Save %ebx in scratch register. */ "movl %3, %%ebx\n" /* Put ADDR in %ebx to be syscall arg. */ "int $0x80 # %2\n" /* Perform the system call. */ "movl %1, %%ebx\n" /* Restore %ebx from scratch register. */ : "=a" (newbrk), "=r" (scratch) - : "0" (SYS_ify (brk)), "g" (addr)); + : "0" (SYS_ify (brk)), "g" (__ptrvalue (addr))); __curbrk = newbrk; Index: sysdeps/unix/sysv/linux/i386/chown.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/chown.c,v retrieving revision 1.11 diff -u -p -r1.11 chown.c --- chown.c 2000/04/04 06:03:28 1.11 +++ chown.c 2000/07/07 01:03:52 @@ -21,11 +21,11 @@ #include #include - -#include -#include #include +#include +#include +#include "kernel-features.h" /* In Linux 2.1.x the chown functions have been changed. A new function lchown @@ -68,7 +68,7 @@ __real_chown (const char *file, uid_t ow int result; int saved_errno = errno; - result = INLINE_SYSCALL (chown32, 3, file, owner, group); + result = INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group); if (result == 0 || errno != ENOSYS) return result; @@ -83,7 +83,7 @@ __real_chown (const char *file, uid_t ow return -1; } - result = INLINE_SYSCALL (chown, 3, file, owner, group); + result = INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group); if (result >= 0 || errno != ENOSYS) return result; @@ -95,7 +95,7 @@ __real_chown (const char *file, uid_t ow return __lchown (file, owner, group); # elif __ASSUME_32BITUIDS /* This implies __ASSUME_LCHOWN_SYSCALL. */ - return INLINE_SYSCALL (chown32, 3, file, owner, group); + return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group); # else /* !__ASSUME_32BITUIDS && ASSUME_LCHOWN_SYSCALL */ # ifdef __NR_chown32 @@ -104,7 +104,7 @@ __real_chown (const char *file, uid_t ow int result; int saved_errno = errno; - result = INLINE_SYSCALL (chown32, 3, file, owner, group); + result = INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group); if (result == 0 || errno != ENOSYS) return result; @@ -119,7 +119,7 @@ __real_chown (const char *file, uid_t ow return -1; } - return INLINE_SYSCALL (chown, 3, file, owner, group); + return INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group); # endif } #endif @@ -130,7 +130,7 @@ __real_chown (const char *file, uid_t ow int __chown_is_lchown (const char *file, uid_t owner, gid_t group) { - return INLINE_SYSCALL (chown, 3, file, owner, group); + return INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group); } #elif SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) /* Compiling for compatibiity. */ Index: sysdeps/unix/sysv/linux/i386/fxstat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/fxstat.c,v retrieving revision 1.4 diff -u -p -r1.4 fxstat.c --- fxstat.c 2000/01/27 00:26:13 1.4 +++ fxstat.c 2000/07/07 01:03:52 @@ -28,14 +28,16 @@ #include #include +#include + #include "kernel-features.h" #include -extern int __syscall_fstat (int, struct kernel_stat *); +extern int __syscall_fstat (int, struct kernel_stat *__unbounded); #ifdef __NR_stat64 -extern int __syscall_fstat64 (int, struct stat64 *); +extern int __syscall_fstat64 (int, struct stat64 *__unbounded); # if __ASSUME_STAT64_SYSCALL == 0 /* The variable is shared between all wrappers around *stat64 calls. */ extern int __have_no_stat64; @@ -52,14 +54,13 @@ __fxstat (int vers, int fd, struct stat int result; if (vers == _STAT_VER_KERNEL) - { - return INLINE_SYSCALL (fstat, 2, fd, (struct kernel_stat *) buf); - } + return INLINE_SYSCALL (fstat, 2, fd, CHECK_1 ((struct kernel_stat *) buf)); + #if __ASSUME_STAT64_SYSCALL > 0 { struct stat64 buf64; - result = INLINE_SYSCALL (fstat64, 2, fd, &buf64); + result = INLINE_SYSCALL (fstat64, 2, fd, __ptrvalue (&buf64)); if (result == 0) result = xstat32_conv (vers, &buf64, buf); return result; @@ -73,19 +74,19 @@ __fxstat (int vers, int fd, struct stat { struct stat64 buf64; - result = INLINE_SYSCALL (fstat64, 2, fd, &buf64); + result = INLINE_SYSCALL (fstat64, 2, fd, __ptrvalue (&buf64)); if (result == 0) result = xstat32_conv (vers, &buf64, buf); - + if (result != -1 || errno != ENOSYS) return result; __have_no_stat64 = 1; } -# endif +# endif - result = INLINE_SYSCALL (fstat, 2, fd, &kbuf); + result = INLINE_SYSCALL (fstat, 2, fd, __ptrvalue (&kbuf)); if (result == 0) result = xstat_conv (vers, &kbuf, buf); Index: sysdeps/unix/sysv/linux/i386/getgroups.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/getgroups.c,v retrieving revision 1.6 diff -u -p -r1.6 getgroups.c --- getgroups.c 2000/02/11 19:42:14 1.6 +++ getgroups.c 2000/07/07 01:03:52 @@ -23,14 +23,16 @@ #include #include +#include + #include #include -extern int __syscall_getgroups(int, __kernel_gid_t *); +extern int __syscall_getgroups (int, __kernel_gid_t *__unbounded); #ifdef __NR_getgroups32 -extern int __syscall_getgroups32 (int, __kernel_gid32_t *); +extern int __syscall_getgroups32 (int, __kernel_gid32_t *__unbounded); # if __ASSUME_32BITUIDS == 0 /* This variable is shared with all files that need to check for 32bit uids. */ @@ -51,7 +53,7 @@ __getgroups (int n, gid_t *groups) else { #if __ASSUME_32BITUIDS > 0 - return INLINE_SYSCALL (getgroups32, 2, n, groups); + return INLINE_SYSCALL (getgroups32, 2, n, CHECK_N (groups, n)); #else int i, ngids; __kernel_gid_t kernel_groups[n = MIN (n, __sysconf (_SC_NGROUPS_MAX))]; @@ -61,7 +63,7 @@ __getgroups (int n, gid_t *groups) int result; int saved_errno = errno; - result = INLINE_SYSCALL (getgroups32, 2, n, groups); + result = INLINE_SYSCALL (getgroups32, 2, n, CHECK_N (groups, n)); if (result == 0 || errno != ENOSYS) return result; @@ -70,11 +72,10 @@ __getgroups (int n, gid_t *groups) } # endif /* __NR_getgroups32 */ - ngids = INLINE_SYSCALL (getgroups, 2, n, kernel_groups); + ngids = INLINE_SYSCALL (getgroups, 2, n, CHECK_N (kernel_groups, n)); if (n != 0 && ngids > 0) for (i = 0; i < ngids; i++) - groups[i] = kernel_groups[i]; - + (__ptrvalue (groups))[i] = kernel_groups[i]; return ngids; #endif } Index: sysdeps/unix/sysv/linux/i386/getresgid.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/getresgid.c,v retrieving revision 1.1 diff -u -p -r1.1 getresgid.c --- getresgid.c 2000/02/11 19:42:49 1.1 +++ getresgid.c 2000/07/07 01:03:52 @@ -24,16 +24,20 @@ #include #include +#include + #include "kernel-features.h" #ifdef __NR_getresgid -extern int __syscall_getresgid (__kernel_gid_t *rgid, __kernel_gid_t *egid, - __kernel_gid_t *sgid); +extern int __syscall_getresgid (__kernel_gid_t *__unbounded rgid, + __kernel_gid_t *__unbounded egid, + __kernel_gid_t *__unbounded sgid); # ifdef __NR_getresgid32 -extern int __syscall_getresgid32 (__kernel_gid32_t *rgid, __kernel_gid32_t *egid, - __kernel_gid32_t *sgid); +extern int __syscall_getresgid32 (__kernel_gid32_t *__unbounded rgid, + __kernel_gid32_t *__unbounded egid, + __kernel_gid32_t *__unbounded sgid); # if __ASSUME_32BITUIDS == 0 /* This variable is shared with all files that need to check for 32bit @@ -47,8 +51,9 @@ int getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid) { # if __ASSUME_32BITUIDS > 0 - return INLINE_SYSCALL (getresgid32, 3, rgid, egid, sgid); -# else + return INLINE_SYSCALL (getresgid32, 3, CHECK_1 (rgid), + CHECK_1 (egid), CHECK_1 (sgid)); +# else __kernel_gid_t k_rgid, k_egid, k_sgid; int result; # ifdef __NR_getresgid32 @@ -57,7 +62,8 @@ getresgid (gid_t *rgid, gid_t *egid, gid int r; int saved_errno = errno; - r = INLINE_SYSCALL (getresgid32, 3, rgid, egid, sgid); + r = INLINE_SYSCALL (getresgid32, 3, CHECK_1 (rgid), + CHECK_1 (egid), CHECK_1 (sgid)); if (r == 0 || errno != ENOSYS) return r; @@ -66,7 +72,8 @@ getresgid (gid_t *rgid, gid_t *egid, gid } # endif /* __NR_getresgid32 */ - result = INLINE_SYSCALL (getresgid, 3, &k_rgid, &k_egid, &k_sgid); + result = INLINE_SYSCALL (getresgid, 3, __ptrvalue (&k_rgid), + __ptrvalue (&k_egid), __ptrvalue (&k_sgid)); if (result == 0) { Index: sysdeps/unix/sysv/linux/i386/getresuid.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/getresuid.c,v retrieving revision 1.1 diff -u -p -r1.1 getresuid.c --- getresuid.c 2000/02/11 19:42:53 1.1 +++ getresuid.c 2000/07/07 01:03:52 @@ -24,17 +24,20 @@ #include #include +#include #include "kernel-features.h" #ifdef __NR_getresuid -extern int __syscall_getresuid (__kernel_uid_t *ruid, __kernel_uid_t *euid, - __kernel_uid_t *suid); +extern int __syscall_getresuid (__kernel_uid_t *__unbounded ruid, + __kernel_uid_t *__unbounded euid, + __kernel_uid_t *__unbounded suid); # ifdef __NR_getresuid32 -extern int __syscall_getresuid32 (__kernel_uid32_t *ruid, __kernel_uid32_t *euid, - __kernel_uid32_t *suid); +extern int __syscall_getresuid32 (__kernel_uid32_t *__unbounded ruid, + __kernel_uid32_t *__unbounded euid, + __kernel_uid32_t *__unbounded suid); # if __ASSUME_32BITUIDS == 0 /* This variable is shared with all files that need to check for 32bit uids. */ @@ -46,7 +49,8 @@ int getresuid (uid_t *ruid, uid_t *euid, uid_t *suid) { # if __ASSUME_32BITUIDS > 0 - return INLINE_SYSCALL (getresuid32, 3, ruid, euid, suid); + return INLINE_SYSCALL (getresuid32, 3, CHECK_1 (ruid), + CHECK_1 (euid), CHECK_1 (suid)); # else __kernel_uid_t k_ruid, k_euid, k_suid; int result; @@ -56,7 +60,8 @@ getresuid (uid_t *ruid, uid_t *euid, uid int r; int saved_errno = errno; - r = INLINE_SYSCALL (getresuid32, 3, ruid, euid, suid); + r = INLINE_SYSCALL (getresuid32, 3, CHECK_1 (ruid), + CHECK_1 (euid), CHECK_1 (suid)); if (r == 0 || errno != ENOSYS) return r; @@ -65,7 +70,8 @@ getresuid (uid_t *ruid, uid_t *euid, uid } # endif /* __NR_getresuid32 */ - result = INLINE_SYSCALL (getresuid, 3, &k_ruid, &k_euid, &k_suid); + result = INLINE_SYSCALL (getresuid, 3, __ptrvalue (&k_ruid), + __ptrvalue (&k_euid), __ptrvalue (&k_suid)); if (result == 0) { Index: sysdeps/unix/sysv/linux/i386/getrlimit.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/getrlimit.c,v retrieving revision 1.8 diff -u -p -r1.8 getrlimit.c --- getrlimit.c 2000/03/31 05:14:28 1.8 +++ getrlimit.c 2000/07/07 01:03:52 @@ -22,11 +22,14 @@ #include #include #include +#include + #include "kernel-features.h" extern int __syscall_ugetrlimit (unsigned int resource, - struct rlimit *rlimits); -extern int __syscall_getrlimit (unsigned int resource, struct rlimit *rlimits); + struct rlimit *__unbounded rlimits); +extern int __syscall_getrlimit (unsigned int resource, + struct rlimit *__unbounded rlimits); /* Linux 2.3.25 introduced a new system call since the types used for the limits are now unsigned. */ @@ -38,14 +41,14 @@ int __new_getrlimit (enum __rlimit_resource resource, struct rlimit *rlimits) { #ifdef __ASSUME_NEW_GETRLIMIT_SYSCALL - return INLINE_SYSCALL (ugetrlimit, 2, resource, rlimits); + return INLINE_SYSCALL (ugetrlimit, 2, resource, CHECK_1 (rlimits)); #else int result; # ifdef __NR_ugetrlimit if (__have_no_new_getrlimit <= 0) { - result = INLINE_SYSCALL (ugetrlimit, 2, resource, rlimits); + result = INLINE_SYSCALL (ugetrlimit, 2, resource, CHECK_1 (rlimits)); /* If the system call is available remember this fact and return. */ if (result != -1 || errno != ENOSYS) @@ -60,7 +63,7 @@ __new_getrlimit (enum __rlimit_resource # endif /* Fall back to the old system call. */ - result = INLINE_SYSCALL (getrlimit, 2, resource, rlimits); + result = INLINE_SYSCALL (getrlimit, 2, resource, CHECK_1 (rlimits)); if (result == -1) return result; Index: sysdeps/unix/sysv/linux/i386/lchown.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/lchown.c,v retrieving revision 1.3 diff -u -p -r1.3 lchown.c --- lchown.c 2000/02/11 19:42:14 1.3 +++ lchown.c 2000/07/07 01:03:52 @@ -21,16 +21,17 @@ #include #include +#include #include #include "kernel-features.h" #ifdef __NR_lchown -extern int __syscall_lchown (const char *__file, +extern int __syscall_lchown (const char *__unbounded __file, __kernel_uid_t __owner, __kernel_gid_t __group); # ifdef __NR_lchown32 -extern int __syscall_lchown32 (const char *__file, +extern int __syscall_lchown32 (const char *__unbounded __file, __kernel_uid32_t __owner, __kernel_gid32_t __group); # if __ASSUME_32BITUIDS == 0 /* This variable is shared with all files that need to check for 32bit @@ -43,7 +44,7 @@ int __lchown (const char *file, uid_t owner, gid_t group) { # if __ASSUME_32BITUIDS > 0 - return INLINE_SYSCALL (lchown32, 3, file, owner, group); + return INLINE_SYSCALL (lchown32, 3, CHECK_STRING (file), owner, group); # else # ifdef __NR_lchown32 if (__libc_missing_32bit_uids <= 0) @@ -51,7 +52,7 @@ __lchown (const char *file, uid_t owner, int result; int saved_errno = errno; - result = INLINE_SYSCALL (lchown32, 3, file, owner, group); + result = INLINE_SYSCALL (lchown32, 3, CHECK_STRING (file), owner, group); if (result == 0 || errno != ENOSYS) return result; @@ -67,7 +68,7 @@ __lchown (const char *file, uid_t owner, return -1; } - return INLINE_SYSCALL (lchown, 3, file, owner, group); + return INLINE_SYSCALL (lchown, 3, CHECK_STRING (file), owner, group); # endif } Index: sysdeps/unix/sysv/linux/i386/lxstat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/lxstat.c,v retrieving revision 1.3 diff -u -p -r1.3 lxstat.c --- lxstat.c 2000/01/27 00:26:13 1.3 +++ lxstat.c 2000/07/07 01:03:52 @@ -28,14 +28,18 @@ #include #include +#include + #include "kernel-features.h" #include -extern int __syscall_lstat (const char *, struct kernel_stat *); +extern int __syscall_lstat (const char *__unbounded, + struct kernel_stat *__unbounded); #ifdef __NR_stat64 -extern int __syscall_lstat64 (const char *, struct stat64 *); +extern int __syscall_lstat64 (const char *__unbounded, + struct stat64 *__unbounded); # if __ASSUME_STAT64_SYSCALL == 0 /* The variable is shared between all wrappers around *stat64 calls. */ extern int __have_no_stat64; @@ -53,15 +57,13 @@ __lxstat (int vers, const char *name, st int result; if (vers == _STAT_VER_KERNEL) - { - return INLINE_SYSCALL (lstat, 2, name, (struct kernel_stat *) buf); - } + return INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), CHECK_1 ((struct kernel_stat *) buf)); #if __ASSUME_STAT64_SYSCALL > 0 { struct stat64 buf64; - result = INLINE_SYSCALL (lstat64, 2, name, &buf64); + result = INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), __ptrvalue (&buf64)); if (result == 0) result = xstat32_conv (vers, &buf64, buf); return result; @@ -74,7 +76,7 @@ __lxstat (int vers, const char *name, st if (! __have_no_stat64) { struct stat64 buf64; - result = INLINE_SYSCALL (lstat64, 2, name, &buf64); + result = INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), __ptrvalue (&buf64)); if (result == 0) result = xstat32_conv (vers, &buf64, buf); @@ -84,9 +86,9 @@ __lxstat (int vers, const char *name, st __have_no_stat64 = 1; } -# endif - - result = INLINE_SYSCALL (lstat, 2, name, &kbuf); +# endif + + result = INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), __ptrvalue (&kbuf)); if (result == 0) result = xstat_conv (vers, &kbuf, buf); Index: sysdeps/unix/sysv/linux/i386/setgroups.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/setgroups.c,v retrieving revision 1.10 diff -u -p -r1.10 setgroups.c --- setgroups.c 2000/05/23 08:43:01 1.10 +++ setgroups.c 2000/07/07 01:03:52 @@ -23,14 +23,16 @@ #include #include +#include + #include #include "kernel-features.h" -extern int __syscall_setgroups (int, const __kernel_gid_t *); +extern int __syscall_setgroups (int, const __kernel_gid_t *__unbounded); #ifdef __NR_setgroups32 -extern int __syscall_setgroups32 (int, const __kernel_gid32_t *); +extern int __syscall_setgroups32 (int, const __kernel_gid32_t *__unbounded); # if __ASSUME_32BITUIDS == 0 /* This variable is shared with all files that need to check for 32bit uids. */ @@ -52,17 +54,18 @@ setgroups (size_t n, const gid_t *groups else { #if __ASSUME_32BITUIDS > 0 - return INLINE_SYSCALL (setgroups32, 2, n, groups); + return INLINE_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n)); #else size_t i; __kernel_gid_t kernel_groups[n]; + # ifdef __NR_setgroups32 if (__libc_missing_32bit_uids <= 0) { int result; int saved_errno = errno; - result = INLINE_SYSCALL (setgroups32, 2, n, groups); + result = INLINE_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n)); if (result == 0 || errno != ENOSYS) return result; @@ -72,7 +75,7 @@ setgroups (size_t n, const gid_t *groups # endif /* __NR_setgroups32 */ for (i = 0; i < n; i++) { - kernel_groups[i] = groups[i]; + kernel_groups[i] = (__ptrvalue (groups))[i]; if (groups[i] != (gid_t) ((__kernel_gid_t) groups[i])) { __set_errno (EINVAL); @@ -80,7 +83,7 @@ setgroups (size_t n, const gid_t *groups } } - return INLINE_SYSCALL (setgroups, 2, n, kernel_groups); + return INLINE_SYSCALL (setgroups, 2, n, CHECK_N (kernel_groups, n)); #endif } } Index: sysdeps/unix/sysv/linux/i386/setrlimit.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/setrlimit.c,v retrieving revision 1.4 diff -u -p -r1.4 setrlimit.c --- setrlimit.c 2000/03/31 05:14:28 1.4 +++ setrlimit.c 2000/07/07 01:03:52 @@ -22,14 +22,15 @@ #include #include +#include +#include #include "kernel-features.h" -#include extern int __syscall_setrlimit (unsigned int resource, - const struct rlimit *rlimits); + const struct rlimit *__unbounded rlimits); extern int __syscall_ugetrlimit (unsigned int resource, - const struct rlimit *rlimits); + const struct rlimit *__unbounded rlimits); /* Linux 2.3.25 introduced a new system call since the types used for the limits are now unsigned. */ @@ -41,7 +42,7 @@ int __new_setrlimit (enum __rlimit_resource resource, const struct rlimit *rlimits) { #ifdef __ASSUME_NEW_GETRLIMIT_SYSCALL - return INLINE_SYSCALL (setrlimit, 2, resource, rlimits); + return INLINE_SYSCALL (setrlimit, 2, resource, CHECK_1 (rlimits)); #else struct rlimit rlimits_small; @@ -51,7 +52,7 @@ __new_setrlimit (enum __rlimit_resource /* Check if the new ugetrlimit syscall exists. We must do this first because older kernels don't reject negative rlimit values in setrlimit. */ - int result = INLINE_SYSCALL (ugetrlimit, 2, resource, &rlimits_small); + int result = INLINE_SYSCALL (ugetrlimit, 2, resource, __ptrvalue (&rlimits_small)); if (result != -1 || errno != ENOSYS) /* The syscall exists. */ __have_no_new_getrlimit = -1; @@ -60,7 +61,7 @@ __new_setrlimit (enum __rlimit_resource __have_no_new_getrlimit = 1; } if (__have_no_new_getrlimit < 0) - return INLINE_SYSCALL (setrlimit, 2, resource, rlimits); + return INLINE_SYSCALL (setrlimit, 2, resource, CHECK_1 (rlimits)); # endif /* We might have to correct the limits values. Since the old values @@ -71,7 +72,7 @@ __new_setrlimit (enum __rlimit_resource RLIM_INFINITY >> 1); /* Use the adjusted values. */ - return INLINE_SYSCALL (setrlimit, 2, resource, &rlimits_small); + return INLINE_SYSCALL (setrlimit, 2, resource, __ptrvalue (&rlimits_small)); #endif } Index: sysdeps/unix/sysv/linux/i386/sigaction.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/sigaction.c,v retrieving revision 1.23 diff -u -p -r1.23 sigaction.c --- sigaction.c 2000/04/30 04:23:44 1.23 +++ sigaction.c 2000/07/07 01:03:52 @@ -37,8 +37,8 @@ #define SA_RESTORER 0x04000000 -extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *, - struct kernel_sigaction *, size_t); +extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *__unbounded, + struct kernel_sigaction *__unbounded, size_t); #if __ASSUME_REALTIME_SIGNALS == 0 /* The variable is shared between all wrappers around signal handling @@ -86,8 +86,9 @@ __sigaction (int sig, const struct sigac /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - result = INLINE_SYSCALL (rt_sigaction, 4, sig, act ? &kact : NULL, - oact ? &koact : NULL, _NSIG / 8); + result = INLINE_SYSCALL (rt_sigaction, 4, + sig, act ? __ptrvalue (&kact) : NULL, + oact ? __ptrvalue (&koact) : NULL, _NSIG / 8); # if __ASSUME_REALTIME_SIGNALS == 0 if (result >= 0 || errno != ENOSYS) @@ -126,7 +127,8 @@ __sigaction (int sig, const struct sigac "popl %%ebx" : "=a" (result) : "0" (SYS_ify (sigaction)), "r" (sig), - "c" (act ? &k_newact : 0), "d" (oact ? &k_oldact : 0)); + "c" (act ? __ptrvalue (&k_newact) : 0), + "d" (oact ? __ptrvalue (&k_oldact) : 0)); if (result < 0) { Index: sysdeps/unix/sysv/linux/i386/xstat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/xstat.c,v retrieving revision 1.4 diff -u -p -r1.4 xstat.c --- xstat.c 2000/01/27 00:26:13 1.4 +++ xstat.c 2000/07/07 01:03:52 @@ -28,15 +28,19 @@ #include #include +#include + #include "kernel-features.h" #include -extern int __syscall_stat (const char *, struct kernel_stat *); +extern int __syscall_stat (const char *__unbounded, + struct kernel_stat *__unbounded); #ifdef __NR_stat64 -extern int __syscall_stat64 (const char *, struct stat64 *); -# if __ASSUME_STAT64_SYSCALL == 0 +extern int __syscall_stat64 (const char *__unbounded, + struct stat64 *__unbounded); +# if __ASSUME_STAT64_SYSCALL == 0 /* The variable is shared between all wrappers around *stat64 calls. */ extern int __have_no_stat64; # endif @@ -53,14 +57,13 @@ __xstat (int vers, const char *name, str int result; if (vers == _STAT_VER_KERNEL) - { - return INLINE_SYSCALL (stat, 2, name, (struct kernel_stat *) buf); - } + return INLINE_SYSCALL (stat, 2, CHECK_STRING (name), CHECK_1 ((struct kernel_stat *) buf)); + #if __ASSUME_STAT64_SYSCALL > 0 { struct stat64 buf64; - result = INLINE_SYSCALL (stat64, 2, name, &buf64); + result = INLINE_SYSCALL (stat64, 2, CHECK_STRING (name), __ptrvalue (&buf64)); if (result == 0) result = xstat32_conv (vers, &buf64, buf); return result; @@ -73,7 +76,7 @@ __xstat (int vers, const char *name, str { struct stat64 buf64; - result = INLINE_SYSCALL (stat64, 2, name, &buf64); + result = INLINE_SYSCALL (stat64, 2, CHECK_STRING (name), __ptrvalue (&buf64)); if (result == 0) result = xstat32_conv (vers, &buf64, buf); @@ -83,8 +86,8 @@ __xstat (int vers, const char *name, str __have_no_stat64 = 1; } -# endif - result = INLINE_SYSCALL (stat, 2, name, &kbuf); +# endif + result = INLINE_SYSCALL (stat, 2, CHECK_STRING (name), __ptrvalue (&kbuf)); if (result == 0) result = xstat_conv (vers, &kbuf, buf); @@ -94,6 +97,6 @@ __xstat (int vers, const char *name, str weak_alias (__xstat, _xstat); #ifdef XSTAT_IS_XSTAT64 -#undef __xstat64 +# undef __xstat64 strong_alias (__xstat, __xstat64); #endif Index: sysdeps/unix/sysv/linux/ia64/fxstat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/fxstat.c,v retrieving revision 1.1 diff -u -p -r1.1 fxstat.c --- fxstat.c 2000/06/20 01:35:09 1.1 +++ fxstat.c 2000/07/07 01:03:52 @@ -27,14 +27,15 @@ #include #include +#include -extern int __syscall_fstat (int, struct stat *); +extern int __syscall_fstat (int, struct stat *__unbounded); /* Get information about the file FD in BUF. */ int __fxstat (int vers, int fd, struct stat *buf) { - return INLINE_SYSCALL (fstat, 2, fd, buf); + return INLINE_SYSCALL (fstat, 2, fd, CHECK_1 (buf)); } weak_alias (__fxstat, _fxstat); Index: sysdeps/unix/sysv/linux/ia64/lxstat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/lxstat.c,v retrieving revision 1.1 diff -u -p -r1.1 lxstat.c --- lxstat.c 2000/06/20 01:35:18 1.1 +++ lxstat.c 2000/07/07 01:03:52 @@ -27,14 +27,15 @@ #include #include +#include -extern int __syscall_lstat (const char *, struct stat *); +extern int __syscall_lstat (const char *__unbounded, struct stat *__unbounded); /* Get information about the file FD in BUF. */ int __lxstat (int vers, const char *name, struct stat *buf) { - return INLINE_SYSCALL (lstat, 2, name, buf); + return INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), CHECK_1 (buf)); } weak_alias (__lxstat, _lxstat); Index: sysdeps/unix/sysv/linux/ia64/sigaction.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/sigaction.c,v retrieving revision 1.1 diff -u -p -r1.1 sigaction.c --- sigaction.c 2000/06/10 00:02:55 1.1 +++ sigaction.c 2000/07/07 01:03:52 @@ -27,9 +27,10 @@ #include #include +#include -extern int __syscall_rt_sigaction (int, const struct sigaction *, - struct sigaction *, size_t); +extern int __syscall_rt_sigaction (int, const struct sigaction *__unbounded, + struct sigaction *__unbounded, size_t); /* The variable is shared between all wrappers around signal handling functions which have RT equivalents. This is the definition. */ @@ -45,7 +46,8 @@ __sigaction (sig, act, oact) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - return INLINE_SYSCALL (rt_sigaction, 4, sig, act, oact, _NSIG / 8); + return INLINE_SYSCALL (rt_sigaction, 4, sig, + CHECK_1opt (act), CHECK_1opt (oact), _NSIG / 8); } weak_alias (__sigaction, sigaction) Index: sysdeps/unix/sysv/linux/ia64/sigpending.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/sigpending.c,v retrieving revision 1.1 diff -u -p -r1.1 sigpending.c --- sigpending.c 2000/06/10 00:03:19 1.1 +++ sigpending.c 2000/07/07 01:03:52 @@ -25,8 +25,9 @@ #include #include +#include -extern int __syscall_rt_sigpending (sigset_t *, size_t); +extern int __syscall_rt_sigpending (sigset_t *__unbounded, size_t); /* Change the set of blocked signals to SET, @@ -37,5 +38,5 @@ sigpending (set) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8); + return INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8); } Index: sysdeps/unix/sysv/linux/ia64/sigprocmask.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/sigprocmask.c,v retrieving revision 1.1 diff -u -p -r1.1 sigprocmask.c --- sigprocmask.c 2000/06/10 00:03:40 1.1 +++ sigprocmask.c 2000/07/07 01:03:52 @@ -27,9 +27,10 @@ #include #include +#include -extern int __syscall_rt_sigprocmask (int, const sigset_t *, sigset_t *, - size_t); +extern int __syscall_rt_sigprocmask (int, const sigset_t *__unbounded, + sigset_t *__unbounded, size_t); /* Get and/or change the set of blocked signals. */ int @@ -41,6 +42,7 @@ __sigprocmask (how, set, oset) /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8); + return INLINE_SYSCALL (rt_sigprocmask, 4, how, CHECK_SIGSET (set), + CHECK_SIGSETopt (oset), _NSIG / 8); } weak_alias (__sigprocmask, sigprocmask) Index: sysdeps/unix/sysv/linux/ia64/sigsuspend.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/sigsuspend.c,v retrieving revision 1.1 diff -u -p -r1.1 sigsuspend.c --- sigsuspend.c 2000/06/10 00:03:58 1.1 +++ sigsuspend.c 2000/07/07 01:03:52 @@ -22,8 +22,9 @@ #include #include +#include -extern int __syscall_rt_sigsuspend (const sigset_t *, size_t); +extern int __syscall_rt_sigsuspend (const sigset_t *__unbounded, size_t); /* Change the set of blocked signals to SET, @@ -34,6 +35,6 @@ __sigsuspend (set) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - return INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8); + return INLINE_SYSCALL (rt_sigsuspend, 2, CHECK_SIGSET (set), _NSIG / 8); } weak_alias (__sigsuspend, sigsuspend) Index: sysdeps/unix/sysv/linux/ia64/xstat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/xstat.c,v retrieving revision 1.1 diff -u -p -r1.1 xstat.c --- xstat.c 2000/06/20 01:35:25 1.1 +++ xstat.c 2000/07/07 01:03:52 @@ -27,14 +27,15 @@ #include #include +#include -extern int __syscall_stat (const char *, struct stat *); +extern int __syscall_stat (const char *__unbounded, struct stat *__unbounded); /* Get information about the file NAME in BUF. */ int __xstat (int vers, const char *name, struct stat *buf) { - return INLINE_SYSCALL (stat, 2, name, buf); + return INLINE_SYSCALL (stat, 2, name, CHECK_1 (buf)); } weak_alias (__xstat, _xstat); Index: sysdeps/unix/sysv/linux/m68k/chown.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/m68k/chown.c,v retrieving revision 1.3 diff -u -p -r1.3 chown.c --- chown.c 2000/02/11 19:42:16 1.3 +++ chown.c 2000/07/07 01:03:52 @@ -21,14 +21,15 @@ #include #include +#include #include -extern int __syscall_chown (const char *__file, +extern int __syscall_chown (const char *__unbounded __file, __kernel_uid_t __owner, __kernel_gid_t __group); #ifdef __NR_chown32 -extern int __syscall_chown32 (const char *__file, +extern int __syscall_chown32 (const char *__unbounded __file, __kernel_uid32_t owner, __kernel_gid32_t group); # if __ASSUME_32BITUIDS == 0 @@ -42,7 +43,7 @@ int __chown (const char *file, uid_t owner, gid_t group) { #if __ASSUME_32BITUIDS - return INLINE_SYSCALL (chown32, 3, file, owner, group); + return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group); #else # ifdef __NR_chown32 if (__libc_missing_32bit_uids <= 0) @@ -50,7 +51,7 @@ __chown (const char *file, uid_t owner, int result; int saved_errno = errno; - result = INLINE_SYSCALL (chown32, 3, file, owner, group); + result = INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group); if (result == 0 || errno != ENOSYS) return result; @@ -66,7 +67,7 @@ __chown (const char *file, uid_t owner, return -1; } - return INLINE_SYSCALL (chown, 3, file, owner, group); + return INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group); #endif } weak_alias (__chown, chown) Index: sysdeps/unix/sysv/linux/mips/pread.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pread.c,v retrieving revision 1.5 diff -u -p -r1.5 pread.c --- pread.c 2000/07/06 23:42:33 1.5 +++ pread.c 2000/07/07 01:03:52 @@ -23,6 +23,7 @@ #include #include +#include #include @@ -32,8 +33,8 @@ static ssize_t __emulate_pread (int fd, void *buf, size_t count, off_t offset) internal_function; # endif -extern ssize_t __syscall_pread (int fd, void *buf, size_t count, int dummy, - off_t offset_hi, off_t offset_lo); +extern ssize_t __syscall_pread (int fd, void *__unbounded buf, size_t count, + int dummy, off_t offset_hi, off_t offset_lo); @@ -47,7 +48,7 @@ __libc_pread (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ - result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, + result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR (0, offset)); # if __ASSUME_PREAD_SYSCALL == 0 if (result == -1 && errno == ENOSYS) Index: sysdeps/unix/sysv/linux/mips/pread64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pread64.c,v retrieving revision 1.6 diff -u -p -r1.6 pread64.c --- pread64.c 2000/07/06 23:42:33 1.6 +++ pread64.c 2000/07/07 01:03:52 @@ -23,6 +23,7 @@ #include #include +#include #include @@ -33,8 +34,8 @@ static ssize_t __emulate_pread64 (int fd off64_t offset) internal_function; # endif -extern ssize_t __syscall_pread (int fd, void *buf, size_t count, int dummy, - off_t offset_hi, off_t offset_lo); +extern ssize_t __syscall_pread (int fd, void *__unbounded buf, size_t count, + int dummy, off_t offset_hi, off_t offset_lo); @@ -48,7 +49,7 @@ __libc_pread64 (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ - result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, + result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR ((off_t) (offset >> 32), (off_t) (offset & 0xffffffff))); # if __ASSUME_PREAD_SYSCALL == 0 Index: sysdeps/unix/sysv/linux/mips/pwrite.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pwrite.c,v retrieving revision 1.5 diff -u -p -r1.5 pwrite.c --- pwrite.c 2000/07/06 23:42:33 1.5 +++ pwrite.c 2000/07/07 01:03:52 @@ -23,12 +23,13 @@ #include #include +#include #include #if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0 -extern ssize_t __syscall_pwrite (int fd, const void *buf, size_t count, +extern ssize_t __syscall_pwrite (int fd, const void *__unbounded buf, size_t count, int dummy, off_t offset_hi, off_t offset_lo); # if __ASSUME_PWRITE_SYSCALL == 0 @@ -46,7 +47,7 @@ __libc_pwrite (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ - result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, + result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR (0, offset)); # if __ASSUME_PWRITE_SYSCALL == 0 if (result == -1 && errno == ENOSYS) Index: sysdeps/unix/sysv/linux/mips/pwrite64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/pwrite64.c,v retrieving revision 1.6 diff -u -p -r1.6 pwrite64.c --- pwrite64.c 2000/07/06 23:42:33 1.6 +++ pwrite64.c 2000/07/07 01:03:52 @@ -23,12 +23,13 @@ #include #include +#include #include #if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0 -extern ssize_t __syscall_pwrite (int fd, const void *buf, size_t count, +extern ssize_t __syscall_pwrite (int fd, const void *__unbounded buf, size_t count, int dummy, off_t offset_hi, off_t offset_lo); # if __ASSUME_PWRITE_SYSCALL == 0 @@ -46,7 +47,7 @@ __libc_pwrite64 (fd, buf, count, offset) ssize_t result; /* First try the syscall. */ - result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, + result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR ((off_t) (offset >> 32), (off_t) (offset & 0xffffffff))); # if __ASSUME_PWRITE_SYSCALL == 0 Index: sysdeps/unix/sysv/linux/mips/truncate64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/truncate64.c,v retrieving revision 1.3 diff -u -p -r1.3 truncate64.c --- truncate64.c 2000/07/06 23:42:33 1.3 +++ truncate64.c 2000/07/07 01:03:52 @@ -23,6 +23,7 @@ #include #include +#include #include "kernel-features.h" @@ -33,7 +34,7 @@ int __have_no_truncate64; #endif /* The order of hight, low depends on endianness. */ -extern int __syscall_truncate64 (const char *path, int dummy, +extern int __syscall_truncate64 (const char *__unbounded path, int dummy, int high_length, int low_length); @@ -50,7 +51,7 @@ truncate64 (const char *path, off64_t le #ifndef __ASSUME_TRUNCATE64_SYSCALL int saved_errno = errno; #endif - int result = INLINE_SYSCALL (truncate64, 3, path, 0, + int result = INLINE_SYSCALL (truncate64, 3, CHECK_STRING (path), 0, __LONG_LONG_PAIR (high, low)); #ifndef __ASSUME_TRUNCATE64_SYSCALL if (result != -1 || errno != ENOSYS) Index: sysdeps/unix/sysv/linux/mips/ustat.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/ustat.c,v retrieving revision 1.2 diff -u -p -r1.2 ustat.c --- ustat.c 1998/11/28 21:01:25 1.2 +++ ustat.c 2000/07/07 01:03:52 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -23,8 +23,9 @@ #include #include +#include -extern int __syscall_ustat (unsigned long dev, struct ustat *ubuf); +extern int __syscall_ustat (unsigned long dev, struct ustat *__unbounded ubuf); int ustat (dev_t dev, struct ustat *ubuf) @@ -34,5 +35,5 @@ ustat (dev_t dev, struct ustat *ubuf) /* We must convert the value to dev_t type used by the kernel. */ k_dev = ((major (dev) & 0xff) << 8) | (minor (dev) & 0xff); - return INLINE_SYSCALL (ustat, 2, k_dev, ubuf); + return INLINE_SYSCALL (ustat, 2, k_dev, CHECK_1 (ubuf)); } Index: sysdeps/unix/sysv/linux/mips/xmknod.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/xmknod.c,v retrieving revision 1.2 diff -u -p -r1.2 xmknod.c --- xmknod.c 1998/11/28 21:01:30 1.2 +++ xmknod.c 2000/07/07 01:03:52 @@ -1,5 +1,5 @@ /* xmknod call using old-style Unix mknod system call. - Copyright (C) 1991, 93, 95, 96, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1991, 93, 95, 96, 97, 98, 00 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 @@ -24,8 +24,9 @@ #include #include +#include -extern int __syscall_mknod (const char *, unsigned long, unsigned int); +extern int __syscall_mknod (const char *__unbounded, unsigned long, unsigned int); /* Create a device file named PATH, with permission and special bits MODE and device number DEV (which can be constructed from major and minor @@ -44,7 +45,7 @@ __xmknod (int vers, const char *path, mo /* We must convert the value to dev_t type used by the kernel. */ k_dev = ((major (*dev) & 0xff) << 8) | (minor (*dev) & 0xff); - return INLINE_SYSCALL (mknod, 3, path, mode, k_dev); + return INLINE_SYSCALL (mknod, 3, CHECK_STRING (path), mode, k_dev); } weak_alias (__xmknod, _xmknod) Index: sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sparc/sparc32/mmap64.c,v retrieving revision 1.4 diff -u -p -r1.4 mmap64.c --- mmap64.c 2000/07/06 23:30:40 1.4 +++ mmap64.c 2000/07/07 01:03:52 @@ -19,48 +19,53 @@ #include #include +#include #include #include - -#include +#include #include "kernel-features.h" #ifdef __NR_mmap2 -extern __ptr_t __syscall_mmap2(__ptr_t, size_t, int, int, int, off_t); -#ifndef __ASSUME_MMAP2_SYSCALL +extern void *__unbounded __syscall_mmap2 (void *__unbounded, size_t, + int, int, int, off_t); +# ifndef __ASSUME_MMAP2_SYSCALL static int have_no_mmap2; +# endif #endif -#endif __ptr_t __mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd, off64_t offset) { #ifdef __NR_mmap2 if ( -#ifndef __ASSUME_MMAP2_SYSCALL +# ifndef __ASSUME_MMAP2_SYSCALL ! have_no_mmap2 && -#endif +# endif ! (offset & 4095)) { -#ifndef __ASSUME_MMAP2_SYSCALL +# ifndef __ASSUME_MMAP2_SYSCALL int saved_errno = errno; -#endif +# endif /* This will be always 12, no matter what page size is. */ - __ptr_t result = - (__ptr_t) INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags, - fd, (off_t) (offset >> 12)); - -#ifndef __ASSUME_MMAP2_SYSCALL + __ptr_t result; + __ptrvalue (result) = + (void *__unbounded) INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags, + fd, (off_t) (offset >> 12)); +# if __BOUNDED_POINTERS__ + __ptrlow (result) = __ptrvalue (result); + __ptrhigh (result) = __ptrvalue (result) + len; +# endif +# ifndef __ASSUME_MMAP2_SYSCALL if (result != (__ptr_t) -1 || errno != ENOSYS) -#endif +# endif return result; -#ifndef __ASSUME_MMAP2_SYSCALL +# ifndef __ASSUME_MMAP2_SYSCALL __set_errno (saved_errno); have_no_mmap2 = 1; -#endif +# endif } #endif if (offset != (off_t) offset || (offset + len) != (off_t) (offset + len)) Index: sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c,v retrieving revision 1.4 diff -u -p -r1.4 sigaction.c --- sigaction.c 2000/01/31 06:39:50 1.4 +++ sigaction.c 2000/07/07 01:03:52 @@ -1,5 +1,5 @@ /* POSIX.1 sigaction call for Linux/SPARC64. - Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Miguel de Icaza (miguel@nuclecu.unam.mx) and Jakub Jelinek (jj@ultra.linux.cz). @@ -24,6 +24,7 @@ #include #include #include + #include /* SPARC 64bit userland requires a kernel that has rt signals anyway. */ @@ -47,8 +48,9 @@ __sigaction (int sig, __const struct sig /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - ret = INLINE_SYSCALL (rt_sigaction, 5, sig, act ? &kact : 0, - oact ? &koact : 0, stub, _NSIG / 8); + ret = INLINE_SYSCALL (rt_sigaction, 5, sig, + act ? __ptrvalue (&kact) : 0, + oact ? __ptrvalue (&koact) : 0, stub, _NSIG / 8); if (oact && ret >= 0) { Index: sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigpending.c,v retrieving revision 1.1 diff -u -p -r1.1 sigpending.c --- sigpending.c 1999/06/02 11:09:57 1.1 +++ sigpending.c 2000/07/07 01:03:52 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 1999, 2000 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 @@ -22,8 +22,9 @@ #include #include +#include -extern int __syscall_rt_sigpending (sigset_t *, size_t); +extern int __syscall_rt_sigpending (sigset_t *__unbounded, size_t); /* Change the set of blocked signals to SET, @@ -34,5 +35,5 @@ sigpending (set) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8); + return INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8); } Index: sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigprocmask.c,v retrieving revision 1.1 diff -u -p -r1.1 sigprocmask.c --- sigprocmask.c 1999/06/02 11:10:43 1.1 +++ sigprocmask.c 2000/07/07 01:03:52 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 1999, 2000 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 @@ -22,9 +22,10 @@ #include #include +#include -extern int __syscall_rt_sigprocmask (int, const sigset_t *, sigset_t *, - size_t); +extern int __syscall_rt_sigprocmask (int, const sigset_t *__unbounded, + sigset_t *__unbounded, size_t); /* Get and/or change the set of blocked signals. */ int @@ -35,6 +36,7 @@ __sigprocmask (how, set, oset) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8); + return INLINE_SYSCALL (rt_sigprocmask, 4, how, CHECK_SIGSET (set), + CHECK_SIGSETopt (oset), _NSIG / 8); } weak_alias (__sigprocmask, sigprocmask) Index: sysdeps/unix/sysv/linux/sparc/sparc64/sigsuspend.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sparc/sparc64/sigsuspend.c,v retrieving revision 1.1 diff -u -p -r1.1 sigsuspend.c --- sigsuspend.c 1999/06/02 11:10:54 1.1 +++ sigsuspend.c 2000/07/07 01:03:52 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 1999, 2000 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 @@ -22,8 +22,9 @@ #include #include +#include -extern int __syscall_rt_sigsuspend (const sigset_t *, size_t); +extern int __syscall_rt_sigsuspend (const sigset_t *__unbounded, size_t); /* Change the set of blocked signals to SET, wait until a signal arrives, and restore the set of blocked signals. */ @@ -33,6 +34,6 @@ __sigsuspend (set) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - return INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8); + return INLINE_SYSCALL (rt_sigsuspend, 2, CHECK_SIGSET (set), _NSIG / 8); } weak_alias (__sigsuspend, sigsuspend) From drepper@redhat.com Thu Jul 6 18:58:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 06 Jul 2000 18:58:00 -0000 Subject: PATCH: bounds checks for many syscalls References: <200007070121.SAA13014@kayak.mcgary.org> Message-ID: OK. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Fri Jul 7 00:01:00 2000 From: greg@mcgary.org (Greg McGary) Date: Fri, 07 Jul 2000 00:01:00 -0000 Subject: PATCH: make regex.c friendly for BPs. Message-ID: <200007070701.AAA31182@kayak.mcgary.org> 2000-07-06 Greg McGary * posix/regex.c (EXTEND_BUFFER): Compute increment once. Move all three components of a bounded pointer. Index: posix/regex.c =================================================================== RCS file: /cvs/glibc/libc/posix/regex.c,v retrieving revision 1.74 diff -u -p -B -w -r1.74 regex.c --- regex.c 2000/07/05 22:00:29 1.74 +++ regex.c 2000/07/07 06:57:51 @@ -1747,6 +1747,12 @@ static reg_errcode_t compile_range _RE_A reset the pointers that pointed into the old block to point to the correct places in the new one. If extending the buffer results in it being larger than MAX_BUF_SIZE, then flag memory exhausted. */ +#if __BOUNDED_POINTERS__ +# define MOVE_BUFFER_POINTER(P) \ + (__ptrlow (P) += incr, __ptrhigh (P) += incr, __ptrvalue (P) += incr) +#else +# define MOVE_BUFFER_POINTER(P) (P) += incr +#endif #define EXTEND_BUFFER() \ do { \ unsigned char *old_buffer = bufp->buffer; \ @@ -1761,14 +1767,15 @@ static reg_errcode_t compile_range _RE_A /* If the buffer moved, move all the pointers into it. */ \ if (old_buffer != bufp->buffer) \ { \ - b = (b - old_buffer) + bufp->buffer; \ - begalt = (begalt - old_buffer) + bufp->buffer; \ + int incr = bufp->buffer - old_buffer; \ + MOVE_BUFFER_POINTER (b); \ + MOVE_BUFFER_POINTER (begalt); \ if (fixup_alt_jump) \ - fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\ + MOVE_BUFFER_POINTER (fixup_alt_jump); \ if (laststart) \ - laststart = (laststart - old_buffer) + bufp->buffer; \ + MOVE_BUFFER_POINTER (laststart); \ if (pending_exact) \ - pending_exact = (pending_exact - old_buffer) + bufp->buffer; \ + MOVE_BUFFER_POINTER (pending_exact); \ } \ } while (0) From drepper@redhat.com Fri Jul 7 00:12:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 07 Jul 2000 00:12:00 -0000 Subject: PATCH: make regex.c friendly for BPs. References: <200007070701.AAA31182@kayak.mcgary.org> Message-ID: Greg McGary writes: > 2000-07-06 Greg McGary > > * posix/regex.c (EXTEND_BUFFER): Compute increment once. > Move all three components of a bounded pointer. OK. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Fri Jul 7 03:13:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Fri, 07 Jul 2000 03:13:00 -0000 Subject: make-syscalls.sh broken :-( Message-ID: This line in make-syscalls.sh: # find the name without leading underscores set `echo $strong $weak |tr -s ' \t' '\12' |sed '/^_/d'` doesn't work with these declarations in sysdeps/unix/sysv/linux/mips/syscalls.list: s_llseek llseek _llseek i:iiipi __syscall__llseek s_sigaction sigaction sigaction i:ipp __syscall_sigaction s_ustat ustat ustat i:ip __syscall_ustat sys_mknod xmknod mknod i:sii __syscall_mknod For testing run this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #! /bin/bash strong="__syscall__llseek" echo $strong $weak |tr -s ' \t' '\12' |sed '/^_/d' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The output is empty - and therefore set is invoked as set `` - which puts the whole environment into sysd-syscalls :-( What's the proper way to fix this? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From schwab@suse.de Fri Jul 7 03:44:00 2000 From: schwab@suse.de (Andreas Schwab) Date: Fri, 07 Jul 2000 03:44:00 -0000 Subject: make-syscalls.sh broken :-( References: Message-ID: <200007071044.MAA03226@hawking.suse.de> Andreas Jaeger writes: |> This line in make-syscalls.sh: |> |> # find the name without leading underscores |> set `echo $strong $weak |tr -s ' \t' '\12' |sed '/^_/d'` |> |> doesn't work with these declarations in |> sysdeps/unix/sysv/linux/mips/syscalls.list: |> |> s_llseek llseek _llseek i:iiipi __syscall__llseek |> s_sigaction sigaction sigaction i:ipp __syscall_sigaction |> s_ustat ustat ustat i:ip __syscall_ustat |> sys_mknod xmknod mknod i:sii __syscall_mknod |> |> For testing run this: |> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |> #! /bin/bash |> |> strong="__syscall__llseek" |> echo $strong $weak |tr -s ' \t' '\12' |sed '/^_/d' |> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |> |> The output is empty - and therefore set is invoked as set `` - which |> puts the whole environment into sysd-syscalls :-( |> |> What's the proper way to fix this? What about this: set x `...` callname=$2 if test -n "$callname"; then .... Andreas. -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz????ckerstr. 10, D-90443 N????rnberg From greg@mcgary.org Fri Jul 7 10:03:00 2000 From: greg@mcgary.org (Greg McGary) Date: Fri, 07 Jul 2000 10:03:00 -0000 Subject: make-syscalls.sh broken :-( References: <200007071044.MAA03226@hawking.suse.de> Message-ID: Andreas Schwab writes: > Andreas Jaeger writes: > > |> This line in make-syscalls.sh: > |> > |> # find the name without leading underscores > |> set `echo $strong $weak |tr -s ' \t' '\12' |sed '/^_/d'` > |> > |> doesn't work with these declarations in > |> sysdeps/unix/sysv/linux/mips/syscalls.list: > |> > |> s_llseek llseek _llseek i:iiipi __syscall__llseek > |> s_sigaction sigaction sigaction i:ipp __syscall_sigaction > |> s_ustat ustat ustat i:ip __syscall_ustat > |> sys_mknod xmknod mknod i:sii __syscall_mknod > |> > |> For testing run this: > |> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > |> #! /bin/bash > |> > |> strong="__syscall__llseek" > |> echo $strong $weak |tr -s ' \t' '\12' |sed '/^_/d' > |> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > |> > |> The output is empty - and therefore set is invoked as set `` - which > |> puts the whole environment into sysd-syscalls :-( > |> > |> What's the proper way to fix this? > > What about this: > > set x `...` > callname=$2 > if test -n "$callname"; then > .... I'd rather do this: OK? Index: sysdeps/unix/make-syscalls.sh =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/make-syscalls.sh,v retrieving revision 1.17 diff -u -p -r1.17 make-syscalls.sh --- make-syscalls.sh 2000/07/06 00:48:38 1.17 +++ make-syscalls.sh 2000/07/07 17:02:07 @@ -193,8 +193,8 @@ shared-only-routines += $file x-,-,* | x*,*.[sS],*V*) ;; x*,-,*$ptrlet* | x*,*.[sS],*$ptrlet*) - # find the name without leading underscores - set `echo $strong $weak |tr -s ' \t' '\12' |sed '/^_/d'` + # find the name with the fewest leading underscores, preferably none + set `echo $strong $weak |tr -s ' \t' '\12' |tr _ \~ |sort |tr \~ _` callname=$1 # convert signature string to individual numbered arg names From greg@mcgary.org Fri Jul 7 23:32:00 2000 From: greg@mcgary.org (Greg McGary) Date: Fri, 07 Jul 2000 23:32:00 -0000 Subject: PATCH: fix make-syscalls.sh for MIPS _llseek Message-ID: <200007080632.XAA03582@kayak.mcgary.org> This version is a little cleaner. It assumes that all syscall names begin with the pattern "_*[a-z]", and that no syscall names begin with "_*[A-Z0-9]". This is currently a valid assumption, and I expect it will remain so. (If a syscall name ever began with a capital letter, then `sort -r' would improperly place capitals after underscores.) OK? 2000-07-07 Greg McGary * sysdeps/unix/make-syscalls.sh: Tolerate syscalls that have no names without leading underscores. Index: sysdeps/unix/make-syscalls.sh =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/make-syscalls.sh,v retrieving revision 1.17 diff -u -p -r1.17 make-syscalls.sh --- make-syscalls.sh 2000/07/06 00:48:38 1.17 +++ make-syscalls.sh 2000/07/08 06:23:45 @@ -193,8 +193,8 @@ shared-only-routines += $file x-,-,* | x*,*.[sS],*V*) ;; x*,-,*$ptrlet* | x*,*.[sS],*$ptrlet*) - # find the name without leading underscores - set `echo $strong $weak |tr -s ' \t' '\12' |sed '/^_/d'` + # choose the name with the fewest leading underscores, preferably none + set `echo $strong $weak |tr ' \t' '\n' |sort -r` callname=$1 # convert signature string to individual numbered arg names From drepper@redhat.com Fri Jul 7 23:58:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 07 Jul 2000 23:58:00 -0000 Subject: PATCH: fix make-syscalls.sh for MIPS _llseek References: <200007080632.XAA03582@kayak.mcgary.org> Message-ID: Greg McGary writes: > OK? Yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kettenis@wins.uva.nl Sat Jul 8 04:34:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sat, 08 Jul 2000 04:34:00 -0000 Subject: Missing include in iconv/gconv_conf.c Message-ID: <200007081134.e68BYa730620@delius.kettenis.local> A include is missing from iconv/gconv_conf.c. If you build with libio, it's getting the include from somewhere else, but with stdio, it's not, which means that it won't build for the Hurd. OK to check this in? Mark 2000-07-08 Mark Kettenis * iconv/gconv_conf.c: Include . Index: iconv/gconv_conf.c =================================================================== RCS file: /cvs/glibc/libc/iconv/gconv_conf.c,v retrieving revision 1.24 diff -u -p -r1.24 gconv_conf.c --- iconv/gconv_conf.c 2000/06/20 00:16:36 1.24 +++ iconv/gconv_conf.c 2000/07/08 11:24:58 @@ -29,6 +29,8 @@ #include #include +#include + #include From kettenis@wins.uva.nl Sat Jul 8 21:47:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sat, 08 Jul 2000 21:47:00 -0000 Subject: Resolver in glibc 2.2 Message-ID: <200007090447.e694lI900774@delius.kettenis.local> The resolver is a bit out of shape at the moment. Ulrich already mentioned that the per-thread _res variable doesn't really work right now: http://sources.redhat.com/ml/libc-hacker/2000-06/msg00073.html and there are some other issues too. I've started to look into these matters, and I'm planning on spending some more time on it, to bring things in working order. The primary goal will still be to provide a fully backwards compatible libresolv.so for single-threaded programs, while providing the necessary infrastructure for a thread-safe libnss_dns. However, I think that the resolver in a multi-threaded program should behave as if one had linked with the libbind from BIND 8. This is somewhat differently from how the resolver in glibc 2.2 behaves right now: * res_init() won't affect the per-thread _res, but instead a static variable, just like the res_mkquery(), res_send(), etc. Right now res_init() sets the per-thread _res, which isn't consistent. * _res will be per-thread, and will be properly initialized in multi-threaded programs (as if res_ninit() had been called on it). I think this means that I can undo some of the ad-hoc patches that have been applied over the last few months. I'll also try to update to the latest and greatest BIND 8.2.3-T5B (which is supposed to be a release candidate). Mark From kettenis@wins.uva.nl Sun Jul 9 10:58:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sun, 09 Jul 2000 10:58:00 -0000 Subject: Move FD check to dl-sysdep.c Message-ID: <200007091757.e69Hvow25247@delius.kettenis.local> The following patch moves the call to __libc_check_standard_fds() from elf/rtld.c:dl_main() to sysdeps/generic/dl-sysdep.c:_dl_sysdep_start(), just before the call to dl_main(). It would really help the Hurd if this could be applied. The presence of the __libc_check_standard_fds() call in dl_main() prevents me from writing an elegant solution to check the FDs on the Hurd. The Hurd doesn't need to call __libc_check_standard_fds(). The concept of file descriptors doesn't exist outside libc, and we'd better check the file descriptors right when we build the file descriptor table for the Hurd. I'll check in a Hurd-specific check_fds.c that takes care of that in the near future. I think that sysdeps/generic/dl-sysdep.c conceptually is the right place to put the call. The need for __libc_check_standard_fds() is related to the way file descriptors behave in a generic Unix system. Mark 2000-07-09 Mark Kettenis * elf/rtld.c (dl_main): Move call to __libc_check_standard_fds... * sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): ... to here. Index: elf/rtld.c =================================================================== RCS file: /cvs/glibc/libc/elf/rtld.c,v retrieving revision 1.173 diff -u -p -r1.173 rtld.c --- elf/rtld.c 2000/06/10 03:58:55 1.173 +++ elf/rtld.c 2000/07/09 17:45:48 @@ -52,9 +52,6 @@ extern void *_dl_sysdep_read_whole_file size_t *filesize_ptr, int mmap_prot); -/* Protec SUID program against misuse of file descriptors. */ -extern void __libc_check_standard_fds (void); - /* Helper function to handle errors while resolving symbols. */ static void print_unresolved (int errcode, const char *objname, const char *errsting); @@ -399,12 +396,6 @@ dl_main (const ElfW(Phdr) *phdr, hp_timing_t stop; hp_timing_t diff; #endif - - /* First thing, if this is a SUID program we make sure that FDs 0, - 1, and 2 are allocated. If necessary we are doing it ourself. - If it is not possible we stop the program. */ - if (__builtin_expect (__libc_enable_secure, 0)) - __libc_check_standard_fds (); /* Process the environment variable which control the behaviour. */ process_envvars (&mode, &_dl_lazy); Index: sysdeps/generic/dl-sysdep.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/generic/dl-sysdep.c,v retrieving revision 1.50 diff -u -p -r1.50 dl-sysdep.c --- sysdeps/generic/dl-sysdep.c 2000/03/23 20:28:06 1.50 +++ sysdeps/generic/dl-sysdep.c 2000/07/09 17:45:48 @@ -45,6 +45,9 @@ extern fpu_control_t _dl_fpu_control; extern void _end; extern void ENTRY_POINT (void); +/* Protect SUID program against misuse of file descriptors. */ +extern void __libc_check_standard_fds (void); + ElfW(Addr) _dl_base_addr; int __libc_enable_secure; int __libc_multiple_libcs = 0; /* Defining this here avoids the inclusion @@ -166,6 +169,12 @@ _dl_sysdep_start (void **start_argptr, break up that far. When the user program examines its break, it will see this new value and not clobber our data. */ __sbrk (_dl_pagesize - ((&_end - (void *) 0) & (_dl_pagesize - 1))); + + /* If this is a SUID program we make sure that FDs 0, 1, and 2 are + allocated. If necessary we are doing it ourself. If it is not + possible we stop the program. */ + if (__builtin_expect (__libc_enable_secure, 0)) + __libc_check_standard_fds (); (*dl_main) (phdr, phnum, &user_entry); return user_entry; From kettenis@wins.uva.nl Sun Jul 9 13:48:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sun, 09 Jul 2000 13:48:00 -0000 Subject: Missing symbols from libresolv.so Message-ID: <200007092048.e69KmEd19388@delius.kettenis.local> In the upgrade to BIND-8.2.2-P5, two symbols have been lost: 1. The variable _res_resultcodes. 2. The function __p_rr. So in principle the glibc 2.2 libresolv.so isn't binary compatible with the one from glibc 2.1. Adding a backwards compatible _res_resultcodes isn't too difficult, but __p_rr() might pose a problem. I'm a bit inclined to simply leave them out and see what happens. The symbols are pretty obscure and undocumented. _res_resultcodes isn't even mentioned in , and p_rr() is documented as one of the "Private routine shared between libc/net, named, nslookup and others". So I strongly suspect that only programs distributed with BIND 4 access these symbols (in BIND-4.9.7-REL, dig en nslookup do this). Are people aware of distributions that shipped with the BIND 4 tools linked with glibc's libresolv.so.2? Mark From kettenis@wins.uva.nl Sun Jul 9 14:06:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sun, 09 Jul 2000 14:06:00 -0000 Subject: ldconfig problems Message-ID: <200007092105.e69L5pq19406@delius.kettenis.local> I configured glibc 2.2 with `--prefix=/opt/glibc' and did a `make install'. One of the last commands executed was: test ! -x /home/kettenis/obj/libc/elf/ldconfig || \ /home/kettenis/obj/libc/elf/ldconfig \ /opt/glibc/lib /opt/glibc/lib which kindly reminded me why I don't like ldconfig. This totally hosed my system, since after that my shell decided to use /opt/glibc/lib/libdl.so.2 and failed because it couldn't find the GLIBC_2.2 version definition in /lib/libc.so.6. I must admit it's a bit weird (/opt/glibc/lib/libdl.so.2 is chosen over /lib/libdl.so.2, but /opt/glibc/lib/libc.so.6 isn't preferred over /lib/libc.so.6, this might mean that there is a bug lurking here), but I don't think we should run ldconfig as part of the libc installation process. The dynamic linker is supposed to be able to find the installed libraries all by itself isn't it? And if people really want to run ldconfig, then I think it only should be done when prefix==/usr. Mark From roland@frob.com Sun Jul 9 14:09:00 2000 From: roland@frob.com (Roland McGrath) Date: Sun, 09 Jul 2000 14:09:00 -0000 Subject: ldconfig problems References: <200007092105.e69L5pq19406@delius.kettenis.local> Message-ID: <200007092109.RAA06606@neuralgia.linnaean.org> Conversely, perhaps ldconfig should use ${prefix}-based file names when ${prefix}!=/usr so that you would get a separate ld.so.cache universe for your separate libc installation. From drepper@redhat.com Sun Jul 9 14:18:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 09 Jul 2000 14:18:00 -0000 Subject: Missing symbols from libresolv.so References: <200007092048.e69KmEd19388@delius.kettenis.local> Message-ID: Mark Kettenis writes: > In the upgrade to BIND-8.2.2-P5, two symbols have been lost: > > 1. The variable _res_resultcodes. > > 2. The function __p_rr. > > So in principle the glibc 2.2 libresolv.so isn't binary compatible > with the one from glibc 2.1. These were rever exported. Therefore nothing has to be changed. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sun Jul 9 14:35:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 09 Jul 2000 14:35:00 -0000 Subject: ldconfig problems References: <200007092109.RAA06606@neuralgia.linnaean.org> Message-ID: Roland McGrath writes: > Conversely, perhaps ldconfig should use ${prefix}-based file names when > ${prefix}!=/usr so that you would get a separate ld.so.cache universe for > your separate libc installation. Volunteers? -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kettenis@wins.uva.nl Sun Jul 9 14:56:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sun, 09 Jul 2000 14:56:00 -0000 Subject: Missing symbols from libresolv.so References: <200007092048.e69KmEd19388@delius.kettenis.local> Message-ID: <200007092156.e69LuSV19967@delius.kettenis.local> From: Ulrich Drepper Date: 09 Jul 2000 14:18:27 -0700 Mark Kettenis writes: > In the upgrade to BIND-8.2.2-P5, two symbols have been lost: > > 1. The variable _res_resultcodes. > > 2. The function __p_rr. > > So in principle the glibc 2.2 libresolv.so isn't binary compatible > with the one from glibc 2.1. These were rever exported. Therefore nothing has to be changed. Sorry, we have them in resolv/Versions, and nm /lib/libresolv-2.1.3.so gives: 00005784 T __p_rr 0000bb8c D _res_resultcodes Or do you mean that since these symbols start with an underscore, they're supposed to be only used internally? That's fine for these two, but for instance my /usr/bin/sendmail has: U __dn_skipname@@GLIBC_2.0 Which symbols got prefixed with a double underscore was arbitrarily decided by whatever was in the BIND 4.9.x imported into glibc 2.0. If the resolver interface has really been restricted to (the symbols that are marked #ifdef BIND_RES_POSIX3 in ): dn_expand(), res_init(), res_query(), res_search(), res_querydomain() and res_mkquery() up to now, why were virtually all symbols added to the version map in glibc 2.1? Moreover, BIND 4.9.7 adds res_send() to that list, and documents dn_comp (which still has a double underscore in reality) on its resolver.3 man page. Nowadays BIND 8 simply gives all symbols a double underscore, and documents even more interfaces. I'm certainly not against exporting a limited set of symbols, but we should take some care in choosing the set. At a minimum the symbols on the BIND 4.9.7 man page should be exported. If we can decide on a restricted set of symbols that will officially be exported from libresolv.so, I'm willing to document them. Mark From kettenis@wins.uva.nl Sun Jul 9 17:05:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sun, 09 Jul 2000 17:05:00 -0000 Subject: ldconfig problems References: <200007092109.RAA06606@neuralgia.linnaean.org> Message-ID: <200007100005.e6A05k328262@delius.kettenis.local> From: Ulrich Drepper Date: 09 Jul 2000 14:35:09 -0700 Roland McGrath writes: > Conversely, perhaps ldconfig should use ${prefix}-based file names when > ${prefix}!=/usr so that you would get a separate ld.so.cache universe for > your separate libc installation. Volunteers? Not something with a really high priority for me, especially if you'd install the following patch :-) Mark 2000-07-10 Mark Kettenis * Makefile (install): Only run ldconfig if prefix is /usr and install_root is empty. Index: Makefile =================================================================== RCS file: /cvs/glibc/libc/Makefile,v retrieving revision 1.199 diff -u -p -r1.199 Makefile --- Makefile 2000/06/14 03:45:52 1.199 +++ Makefile 2000/07/10 00:04:48 @@ -107,13 +107,13 @@ install-symbolic-link: subdir_install $(symbolic-link-prog) $(symbolic-link-list) rm -f $(symbolic-link-list) +ifeq (/usr,$(prefix)) +ifeq (,$(install_root)) install: -test ! -x $(common-objpfx)elf/ldconfig || \ $(common-objpfx)elf/ldconfig $(addprefix -r ,$(install_root)) \ $(slibdir) $(libdir) ifneq (no,$(PERL)) -ifeq (/usr,$(prefix)) -ifeq (,$(install_root)) CC="$(CC)" $(PERL) scripts/test-installation.pl $(common-objpfx) endif endif From hjl@valinux.com Sun Jul 9 17:22:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Sun, 09 Jul 2000 17:22:00 -0000 Subject: binutils 2.10.0.12 is released. Message-ID: <20000709171907.A10477@valinux.com> This is the beta release of binutils 2.10.0.12 for Linux, which is based on binutils 2000 0701 in CVS on sourecware.cygnus.com plus various changes. It is purely for Linux, although it has been tested on Solaris/Sparc and Solaris/x86 from time to time. I am planning to make the public release soon. Please test it as much as you can. Please report any bugs related to binutils 2.10.0.12 to hjl@lucon.org. For arm-linux targets, there are some important differences in behaviour between these tools and binutils 2.9.1.0.x. The linker emulation name has changed from elf32arm{26} to armelf_linux{26}. Also, the "-p" flag must be passed with the linker when working with object files (or static libraries) created using older versions of the assembler. If this flag is omitted the linker will silently generate bad output when given old input files. To get the correct behaviour from gcc, amend the *link section of your specs file as follows: *link: %{h*} %{version:-v} %{b} %{Wl,*:%*} %{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} %{rdynamic:-export-dynamic} %{!dynamic-linker: -dynamic-linker /lib/ld-linux.so.2} -X %{mbig-endian:-EB} %{mapcs-26:-m armelf_linux26} %{!mapcs-26:-m armelf_linux} -p Changes from binutils 2.10.0.9: 1. Update from binutils 2000 0701. Fix the parallel build in ld when PE is enabled. Changes from binutils 2.9.5.0.46: 1. Update from binutils 2000 0617. The demangler support for the new g++ ABI. Minor fix for the ELF visibility. Fix linking non-ELF relocatable object files under ELF with symbol versioning. 2. Support for linking PE relocatable object files under ia32/ELF. Changes from binutils 2.9.5.0.42: 1. Update from binutils 2000 0604. The ELF visibility attribuite should work correctly now. 2. The ia32 assembler has changed the way it assembles the "jmp" instructions to the global symbols. The old assembler will optimize the jump to the global symbol defined in the same source file so that no relocation will be used. The new assembler will use relocation for global jumps. It will mainly affect PIC asm code. The segment like .globl __setjmp __setjmp: ... jmp __sigsetjmp ... .globl __sigsetjmp __sigsetjmp: is no longer PIC safe since "jmp __sigsetjmp" jumps to a global symbol and relocation will be used. Instead, it can be changed to .globl __setjmp __setjmp: ... jmp sigsetjmp ... .globl __sigsetjmp __sigsetjmp: sigsetjmp: so that "jmp sigsetjmp" jumps to a local symbol and the new assembler will optimize out the relocation. Changes from binutils 2.9.5.0.41: 1. Update from binutils 2000 0512. 2. Add testsuite for ELF visibility. Changes from binutils 2.9.5.0.37: 1. Update from binutils 2000 0502. 2. Support STV_HIDDEN and STV_INTERNAL. Changes from binutils 2.9.5.0.35: 1. Update from binutils 2000 0418. 2. Fix an ld demangle style option bug. Changes from binutils 2.9.5.0.34: 1. Update from binutils 2000 0412. Fix a relocation bug which affects the Linux kernel compilation. 2. An ELF/PPC linker script update. Changes from binutils 2.9.5.0.33: 1. Update from binutils 2000 0404. Fix the bug report bug. Changes from binutils 2.9.5.0.32: 1. Update from binutils 2000 0403. Fix the 16bit ia32 assembler bug. Changes from binutils 2.9.5.0.31: 1. Update from binutils 2000 0331. Fix the Linux/ARM assembler bug. 2. Fix a Debian assembler security bug. Changes from binutils 2.9.5.0.29: 1. Update from binutils 2000 0319. 2. An ELF/alpha bug is fixed. Changes from binutils 2.9.5.0.27: 1. Update from binutils 2000 0301. 2. A demangler bug is fixed. 3. A better fix for undefined symbols with -Bsymbolic when building shared library. Changes from binutils 2.9.5.0.24: 1. Update from binutils 2000 0204. 2. Added -taso to linker on alpha. 3. Fixed a -shared -Bsymbolic bug when PIC is not used. Changes from binutils 2.9.5.0.22: 1. Update from binutils 2000 0113. 2. A symbol version bug is fixed. 3. A -Bsymbolic bug is fixed. Changes from binutils 2.9.5.0.21: 1. Update from binutils 1999 1202. 2. Remove a MIPS/ELF change. 3. Enable SOM for HPPA. Changes from binutils 2.9.5.0.19: 1. Update from binutils 1999 1122. An ia32 gas bug is fixed. Changes from binutils 2.9.5.0.16: 1. Update from binutils 1999 1104. 2. i370 is changed to use EM_S370 and ELFOSABI_LINUX. Update readelf. 3. Fix Compaq's demangler support. Changes from binutils 2.9.5.0.14: 1. Update from binutils 1999 1012. A gas bug which affects Linux 2.3.21 is fixed. 2. i370 update. 3. The new demangler code. You should use "--style=xxx" to select the demnangle style instead of "--lang=xxx". Changes from binutils 2.9.5.0.13: 1. Update from binutils 1999 0925. 2. Fix a -s and linker script bug. Changes from binutils 2.9.5.0.12: 1. Update from binutils 1999 0922. 2. i370 update. Changes from binutils 2.9.5.0.11: 1. Update from binutils 1999 0910. It fixed a PIC linker bug on ix86 and sparc introduced in the last release. 2. i370 update. Changes from binutils 2.9.5.0.10: 1. Update from binutils 1999 0906. It fixed a PIC linker bug on ix86 and sparc. 2. Remove elf/hppa since it is WIP. Changes from binutils 2.9.5.0.8: 1. Update from binutils 1999 0831. It allows spaces around '(' and ')' in x86 FP register names. Changes from binutils 2.9.5.0.7: 1. Update from binutils 1999 0821. 2. Some MIPS changes. Changes from binutils 2.9.5.0.6: 1. Update from binutils 1999 0813. 2. i370 update. Changes from binutils 2.9.5.0.5: 1. Update from binutils 1999 0809. An ELF/Sparc ld bug is fixed. Changes from binutils 2.9.5.0.4: 1. Update from binutils 1999 0806. A Solaris/Sparc gas bug is fixed. 2. Remove mips gas patches from binutils 2.9.1.0.25. Changes from binutils 2.9.5.0.3: 1. Update from binutils 1999 0801. 2. Support for real mode x86 gcc. Changes from binutils 2.9.4.0.8: 1. Update from binutils 1999 0719. A libc 5 related bug fix. 2. Fix a typo in mips gas. Changes from binutils 2.9.4.0.7: 1. Update from binutils 1999 0710. A weak symbol bug http://egcs.cygnus.com/ml/egcs-bugs/1999-07/msg00129.html is fixed. Changes from binutils 2.9.4.0.6: 1. Update from binutils 1999 0626. Changes from binutils 2.9.4.0.5: 1. Update from binutils 1999 0620. 2. Remove my fwait fix and use the one in cvs. 3. Use "--only-section=section" instead of "--extract-section=section". for objcopy. Changes from binutils 2.9.4.0.4: 1. Update from binutils 1999 0612. 2. Remove various temporary fixes of mine since those bugs are fixed now. Changes from binutils 2.9.4.0.3: 1. Update from binutils 1999 0611. 2. Remove my ELF/Alpha bfd changes. 3. Use the local symbol copy fix in binutils 1999 0611. Changes from binutils 2.9.4.0.2: 1. Update from binutils 1999 0607. 2. Remove my Sparc hacks. 3. Fix local symbol copy. Changes from binutils 2.9.4.0.1: 1. Update from binutils 1999 0606. 2. Restore relocation overflow checking in binutils 2.9.1.0.25 so that Linux kernel can build. 3. Fix i370 for the new gas. Changes from binutils 1999 0605: 1. Fix a -Bsymbolic bug for Linux/alpha. 2. Add ELF/i370. 3. Fix 8/16-bit relocations for i386. 4. Add --redefine-sym=old_form=new_form to objcopy. 5. Add "-j section" for objcopy. 6. Fix i386 disassembler for fwait. 7. Fix a Sparc asm bug. 8. Add Ada demangle support. 9. Fix MIPS/ELF bugs. 10. Add some vxworks suppport. 11. Fix a.out assembler. The file list: 1. binutils-2.10.0.12.tar.gz. Source code. 2. binutils-2.10.0.9-2.10.0.12.diff.gz. Patch against the previous beta source code. 3. binutils-2.10.0.12-1.i386.rpm. IA-32 binary RPM for RedHat 6.2. 4. binutils-2.10.0.12-1.alpha.rpm. Alpha binary RPM for RedHat 6.2. There is no separate source rpm. You can do # rpm -ta binutils-2.10.0.12.tar.gz to create both binary and source rpms. The primary ftp sites for the beta Linux binutils are: 1. ftp://ftp.valinux.com/pub/support/hjl/binutils Thanks. H.J. Lu hjl@lucon.org 07/09/2000 From greg@mcgary.org Sun Jul 9 18:31:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sun, 09 Jul 2000 18:31:00 -0000 Subject: PATCH: bounds checks for many syscalls References: <200007070121.SAA13014@kayak.mcgary.org> <20000709151934.B5609@bacchus.dhis.org> Message-ID: Ralf Baechle writes: > maintaining the MIPS port of glibc I think I should learn a bit about > about the bounded pointer thing you're working on. Is there some > documentation available about it, especially the background of the whole > thing? I have an out-of-date overview document that describes an earlier gcc implementation I did a couple years ago (see http://gcc.gnu.org/ml/gcc/1998-05/msg00073.html ). Even so, it's substantially similar at the assembler-code level to the current implementation. Next, go to the gcc mailing list archives, and search for "bounded pointers" to get some more recent information. I will be done checking things into libc this coming week, then will turn my attention to getting things checked into gcc. While I'm waiting for patch approvals, will update documentation and integrate it into the gcc texinfo manual. Greg From aj@suse.de Mon Jul 10 01:14:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Mon, 10 Jul 2000 01:14:00 -0000 Subject: PATCH: fix make-syscalls.sh for MIPS _llseek References: <200007080632.XAA03582@kayak.mcgary.org> Message-ID: Thanks for the patch. mips compiles again fine (so far) for me after having just committed a patch for a simple typo. Andreas 2000-07-10 Andreas Jaeger * sysdeps/unix/sysv/linux/sigaction.c: Fix typo (string_alias->strong_alias). Index: sysdeps/unix/sysv/linux/sigaction.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sigaction.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- sigaction.c 2000/07/07 02:19:05 1.16 +++ sigaction.c 2000/07/10 07:11:09 1.17 @@ -133,5 +133,5 @@ #endif } -string_alias (__libc_sigaction, __sigaction) +strong_alias (__libc_sigaction, __sigaction) weak_alias (__libc_sigaction, sigaction) -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From aj@suse.de Mon Jul 10 01:32:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Mon, 10 Jul 2000 01:32:00 -0000 Subject: ldconfig problems References: <200007092109.RAA06606@neuralgia.linnaean.org> Message-ID: >>>>> Ulrich Drepper writes: Uli> Roland McGrath writes: >> Conversely, perhaps ldconfig should use ${prefix}-based file names when >> ${prefix}!=/usr so that you would get a separate ld.so.cache universe for >> your separate libc installation. Uli> Volunteers? Yes. Here's a patch. Ok to commit? Andreas 2000-07-10 Andreas Jaeger * elf/Makefile (SYSCONF-FLAGS): Added to pass sysconfdir to compiler. (CFLAGS-ldconfig.c): Added, uses SYSCONF-FLAGS. (CFLAGS-dl-cache.c): Likewise. (CFLAGS-cache.c): Likewise. * sysdeps/generic/dl-cache.h (LD_SO_CACHE): Use SYSCONFDIR to locate cache. * elf/ldconfig.c (LD_SO_CONF): Likewise. ============================================================ Index: elf/Makefile --- elf/Makefile 2000/07/01 15:36:11 1.156 +++ elf/Makefile 2000/07/10 07:38:48 @@ -215,6 +215,10 @@ $(objpfx)sprof: $(libdl) $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) +SYSCONF-FLAGS := -DSYSCONFDIR='"$(sysconfdir)"' +CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) +CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) +CFLAGS-cache.c = $(SYSCONF-FLAGS) test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names)))) generated += $(addsuffix .so,$(strip $(modules-names))) ============================================================ Index: elf/ldconfig.c --- elf/ldconfig.c 2000/05/10 09:14:27 1.4 +++ elf/ldconfig.c 2000/07/10 07:38:49 @@ -41,7 +41,7 @@ #include "dl-procinfo.h" #ifndef LD_SO_CONF -# define LD_SO_CONF "/etc/ld.so.conf" +# define LD_SO_CONF SYSCONFDIR "ld.so.conf" #endif /* Get libc version number. */ @@ -152,7 +152,7 @@ is_hwcap (const char *name) { int hwcap_idx = _dl_string_hwcap (name); - + if (hwcap_idx != -1 && ((1 << hwcap_idx) & HWCAP_IMPORTANT)) return 1; return 0; ============================================================ Index: sysdeps/generic/dl-cache.h --- sysdeps/generic/dl-cache.h 2000/05/17 11:04:01 1.3 +++ sysdeps/generic/dl-cache.h 2000/07/10 07:38:49 @@ -27,7 +27,7 @@ #endif #ifndef LD_SO_CACHE -# define LD_SO_CACHE "/etc/ld.so.cache" +# define LD_SO_CACHE SYSCONFDIR ## "ld.so.cache" #endif #define CACHEMAGIC "ld.so-1.7.0" -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From jakub@redhat.com Mon Jul 10 01:40:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 10 Jul 2000 01:40:00 -0000 Subject: ldconfig problems References: <200007092109.RAA06606@neuralgia.linnaean.org> Message-ID: <20000710104334.U17419@sunsite.ms.mff.cuni.cz> On Mon, Jul 10, 2000 at 10:32:01AM +0200, Andreas Jaeger wrote: > >>>>> Ulrich Drepper writes: > > Uli> Roland McGrath writes: > >> Conversely, perhaps ldconfig should use ${prefix}-based file names when > >> ${prefix}!=/usr so that you would get a separate ld.so.cache universe for > >> your separate libc installation. > > Uli> Volunteers? > > Yes. Here's a patch. Ok to commit? Also, Andreas, could ldconfig be made a little bit more silent unless -v is given to it? It complains without -v about several things H.J.'s ldconfig complained with -v only, and people seem to be really confused by that. Would you mind if I moved some of the error calls undef opt_verbose if? It confuses people e.g. when using rpm when foo package contains the shared library and foo-devel a .so symlink to it, then there is always some time when both are upgraded when some symlink is stale (either points to the older or newer library) and if ldconfig is called during that time period, it complains. Jakub From aj@suse.de Mon Jul 10 02:04:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Mon, 10 Jul 2000 02:04:00 -0000 Subject: ldconfig problems References: <200007092109.RAA06606@neuralgia.linnaean.org> <20000710104334.U17419@sunsite.ms.mff.cuni.cz> Message-ID: >>>>> Jakub Jelinek writes: Jakub> On Mon, Jul 10, 2000 at 10:32:01AM +0200, Andreas Jaeger wrote: >> >>>>> Ulrich Drepper writes: >> Uli> Roland McGrath writes: >> >> Conversely, perhaps ldconfig should use ${prefix}-based file names when >> >> ${prefix}!=/usr so that you would get a separate ld.so.cache universe for >> >> your separate libc installation. >> Uli> Volunteers? >> >> Yes. Here's a patch. Ok to commit? Jakub> Also, Andreas, could ldconfig be made a little bit more silent unless -v is Jakub> given to it? Jakub> It complains without -v about several things H.J.'s ldconfig complained with Jakub> -v only, and people seem to be really confused by that. Jakub> Would you mind if I moved some of the error calls undef opt_verbose if? Jakub> It confuses people e.g. when using rpm when foo package contains the shared Jakub> library and foo-devel a .so symlink to it, then there is always some time Jakub> when both are upgraded when some symlink is stale (either points to the Jakub> older or newer library) and if ldconfig is called during that time period, Jakub> it complains. Go ahead and send a patch. I don't think I'll mind but like to see the patch first. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From schwab@suse.de Mon Jul 10 02:30:00 2000 From: schwab@suse.de (Andreas Schwab) Date: Mon, 10 Jul 2000 02:30:00 -0000 Subject: ldconfig problems References: <200007092109.RAA06606@neuralgia.linnaean.org> Message-ID: <200007100930.LAA12011@hawking.suse.de> Andreas Jaeger writes: |> Index: sysdeps/generic/dl-cache.h |> --- sysdeps/generic/dl-cache.h 2000/05/17 11:04:01 1.3 |> +++ sysdeps/generic/dl-cache.h 2000/07/10 07:38:49 |> @@ -27,7 +27,7 @@ |> #endif |> |> #ifndef LD_SO_CACHE |> -# define LD_SO_CACHE "/etc/ld.so.cache" |> +# define LD_SO_CACHE SYSCONFDIR ## "ld.so.cache" ^^ Please remove this. Andreas. -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz????ckerstr. 10, D-90443 N????rnberg From aj@suse.de Mon Jul 10 03:02:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Mon, 10 Jul 2000 03:02:00 -0000 Subject: ldconfig problems References: <200007092109.RAA06606@neuralgia.linnaean.org> <200007100930.LAA12011@hawking.suse.de> Message-ID: >>>>> Andreas Schwab writes: AS> Andreas Jaeger writes: AS> |> Index: sysdeps/generic/dl-cache.h AS> |> --- sysdeps/generic/dl-cache.h 2000/05/17 11:04:01 1.3 AS> |> +++ sysdeps/generic/dl-cache.h 2000/07/10 07:38:49 AS> |> @@ -27,7 +27,7 @@ AS> |> #endif AS> |> AS> |> #ifndef LD_SO_CACHE AS> |> -# define LD_SO_CACHE "/etc/ld.so.cache" AS> |> +# define LD_SO_CACHE SYSCONFDIR ## "ld.so.cache" AS> ^^ AS> Please remove this. If I remove it, I get this warning: ../sysdeps/generic/dl-cache.c:153: warning: left-hand operand of comma expression has no effect The line is: _dl_debug_message (1, " search cache=", LD_SO_CACHE, "\n", NULL); What shall I do? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From aj@suse.de Mon Jul 10 05:04:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Mon, 10 Jul 2000 05:04:00 -0000 Subject: Fix for sigaction Bug Message-ID: Compiling statically I received: /builds/glibc/20000621-static/libc.a(sigaction.o): In function `__libc_sigaction': /usr/src/cvs/libc/signal/../sysdeps/unix/sysv/linux/i386/sigaction.c:69: multiple definition of `__sigaction' /builds/glibc/20000621-static/linuxthreads/libpthread.a(signals.o):/usr/src/cvs/libc/linuxthreads/signals.c:136: first defined here /opt/binutils/bin/ld: Warning: size of symbol `__sigaction' changed from 231 to 470 in sigaction.o collect2: ld returned 1 exit status make[2]: *** [/builds/glibc/20000621-static/nscd/nscd] Error 1 make[2]: Leaving directory `/usr/src/cvs/libc/nscd' The appended patch fixes this problem. Ok to commit? Andreas 2000-07-10 Andreas Jaeger * sysdeps/unix/sysv/linux/i386/sigaction.c: Make alias weak since it's overridden by libpthreads. * sysdeps/unix/sysv/linux/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/arm/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/ia64/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c: Likewise. ============================================================ Index: sysdeps/unix/sysv/linux/ia64/sigaction.c --- sysdeps/unix/sysv/linux/ia64/sigaction.c 2000/07/07 02:19:05 1.3 +++ sysdeps/unix/sysv/linux/ia64/sigaction.c 2000/07/10 11:53:26 @@ -50,5 +50,5 @@ CHECK_1opt (act), CHECK_1opt (oact), _NSIG / 8); } -strong_alias (__libc_sigaction, __sigaction) +weak_alias (__libc_sigaction, __sigaction) weak_alias (__libc_sigaction, sigaction) ============================================================ Index: sysdeps/unix/sysv/linux/sigaction.c --- sysdeps/unix/sysv/linux/sigaction.c 2000/07/10 07:11:09 1.17 +++ sysdeps/unix/sysv/linux/sigaction.c 2000/07/10 11:53:26 @@ -133,5 +133,5 @@ #endif } -strong_alias (__libc_sigaction, __sigaction) +weak_alias (__libc_sigaction, __sigaction) weak_alias (__libc_sigaction, sigaction) ============================================================ Index: sysdeps/unix/sysv/linux/arm/sigaction.c --- sysdeps/unix/sysv/linux/arm/sigaction.c 2000/07/07 02:19:05 1.5 +++ sysdeps/unix/sysv/linux/arm/sigaction.c 2000/07/10 11:53:27 @@ -149,5 +149,5 @@ return result; } -strong_alias (__libc_sigaction, __sigaction) +weak_alias (__libc_sigaction, __sigaction) weak_alias (__libc_sigaction, sigaction) ============================================================ Index: sysdeps/unix/sysv/linux/i386/sigaction.c --- sysdeps/unix/sysv/linux/i386/sigaction.c 2000/07/07 02:19:05 1.25 +++ sysdeps/unix/sysv/linux/i386/sigaction.c 2000/07/10 11:53:27 @@ -148,7 +148,7 @@ #endif } -strong_alias (__libc_sigaction, __sigaction) +weak_alias (__libc_sigaction, __sigaction) weak_alias (__libc_sigaction, sigaction) /* NOTE: Please think twice before making any changes to the bits of ============================================================ Index: sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c --- sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c 2000/07/07 00:47:17 1.11 +++ sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c 2000/07/10 11:53:27 @@ -135,7 +135,7 @@ return -1; } -strong_alias (__libc_sigaction, __sigaction); +weak_alias (__libc_sigaction, __sigaction); weak_alias (__libc_sigaction, sigaction); static void ============================================================ Index: sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c --- sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c 2000/07/07 02:19:06 1.6 +++ sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c 2000/07/10 11:53:27 @@ -64,7 +64,7 @@ return ret; } -strong_alias (__libc_sigaction, __sigaction); +weak_alias (__libc_sigaction, __sigaction); weak_alias (__libc_sigaction, sigaction); static void -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From schwab@suse.de Mon Jul 10 05:31:00 2000 From: schwab@suse.de (Andreas Schwab) Date: Mon, 10 Jul 2000 05:31:00 -0000 Subject: ldconfig problems References: <200007092109.RAA06606@neuralgia.linnaean.org> <200007100930.LAA12011@hawking.suse.de> Message-ID: <200007101231.OAA21734@hawking.suse.de> Andreas Jaeger writes: |> >>>>> Andreas Schwab writes: |> |> AS> Andreas Jaeger writes: |> AS> |> Index: sysdeps/generic/dl-cache.h |> AS> |> --- sysdeps/generic/dl-cache.h 2000/05/17 11:04:01 1.3 |> AS> |> +++ sysdeps/generic/dl-cache.h 2000/07/10 07:38:49 |> AS> |> @@ -27,7 +27,7 @@ |> AS> |> #endif |> AS> |> |> AS> |> #ifndef LD_SO_CACHE |> AS> |> -# define LD_SO_CACHE "/etc/ld.so.cache" |> AS> |> +# define LD_SO_CACHE SYSCONFDIR ## "ld.so.cache" |> AS> ^^ |> AS> Please remove this. |> |> If I remove it, I get this warning: |> ../sysdeps/generic/dl-cache.c:153: warning: left-hand operand of comma expression has no effect |> |> The line is: |> _dl_debug_message (1, " search cache=", LD_SO_CACHE, "\n", NULL); |> |> |> What shall I do? That looks like a bug in gcc, unless SYSCONFDIR is not what it is supposed to be. Andreas. -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz????ckerstr. 10, D-90443 N????rnberg From kettenis@wins.uva.nl Mon Jul 10 06:22:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Mon, 10 Jul 2000 06:22:00 -0000 Subject: Resolver related thread-safety fix Message-ID: <200007101321.e6ADLte07323@delius.kettenis.local> When converting the DNS NSS module to use the new thread-safe resolver functions, Andreas overlooked __hostalias. This patch corrects this. Mark 2000-07-10 Mark Kettenis * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r): Use res_hostalias instead of __hostalias for thread-safety. Index: resolv/nss_dns/dns-host.c =================================================================== RCS file: /cvs/glibc/libc/resolv/nss_dns/dns-host.c,v retrieving revision 1.23 diff -u -p -r1.23 dns-host.c --- resolv/nss_dns/dns-host.c 2000/05/27 08:16:24 1.23 +++ resolv/nss_dns/dns-host.c 2000/07/10 13:17:12 @@ -131,6 +131,7 @@ _nss_dns_gethostbyname2_r (const char *n int *h_errnop) { querybuf host_buffer; + char tmp[NS_MAXDNAME]; int size, type, n; const char *cp; int map = 0; @@ -161,7 +162,8 @@ _nss_dns_gethostbyname2_r (const char *n * this is also done in res_query() since we are not the only * function that looks up host names. */ - if (strchr (name, '.') == NULL && (cp = __hostalias (name)) != NULL) + if (strchr (name, '.') == NULL + && (cp = res_hostalias (&_res, name, tmp, sizeof (tmp))) != NULL) name = cp; n = res_nsearch (&_res, name, C_IN, type, host_buffer.buf, From hjl@valinux.com Mon Jul 10 08:04:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Mon, 10 Jul 2000 08:04:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) Message-ID: <20000710080357.A18762@valinux.com> I haven't heard any feedbacks about my proposal for the libgcc runtime ABI: http://gcc.gnu.org/ml/gcc-bugs/2000-07/msg00117.html But I think the current situation is quite broken. In glibc, we have --- /* This must match what's in frame.h in gcc. How can one do that? */ struct object { void *pc_begin; void *pc_end; void *fde_begin; void *fde_array; __SIZE_TYPE__ count; struct object *next; }; --- in elf/soinit.c. In gcc, we have --- /* This must match what's in frame.h. */ fprintf (stream, "struct object {\n"); fprintf (stream, " void *pc_begin;\n"); fprintf (stream, " void *pc_end;\n"); fprintf (stream, " void *fde_begin;\n"); fprintf (stream, " void *fde_array;\n"); fprintf (stream, " __SIZE_TYPE__ count;\n"); fprintf (stream, " struct object *next;\n"); fprintf (stream, "};\n"); --- in gcc/collect2.c. However, in gcc/frame.h, there are struct object { #ifdef IA64_UNWIND_INFO void *pc_base; /* This field will be set by find_fde. */ #endif void *pc_begin; void *pc_end; struct dwarf_fde *fde_begin; #ifdef IA64_UNWIND_INFO struct dwarf_fde *fde_end; #endif struct dwarf_fde **fde_array; size_t count; struct object *next; }; So as of today, the ia64 gcc/glibc are broken due to the mismatch in struct object. My libgcc runtime ABI proposal will fix it as well as lead to a fix for the original problem. It means gcc can change the implementation of ---runtime.h--- #ifndef __RUNTIME_H #define __RUNTIME_H 1 struct frame_object { /* It should be large enough for future expansion. */ void * dummy [16]; }; /* Note the following routines are exported interfaces from libgcc; do not change these interfaces. Instead create new interfaces. Also note references to these functions may be made weak in files where they are referenced. */ extern void __register_frame (void * ); extern void __register_frame_table (void *); extern void __deregister_frame (void *); /* Called either from crtbegin.o or a static constructor to register the unwind info for an object or translation unit, respectively. */ extern void __register_frame_info (void *, struct frame_object *); /* Similar, but BEGIN is actually a pointer to a table of unwind entries for different translation units. Called from the file generated by collect2. */ extern void __register_frame_info_table (void *, struct frame_object *); /* Called from crtend.o to deregister the unwind info for an object. */ extern void *__deregister_frame_info (void *); #endif /* __RUNTIME_H */ --- as long as we don't change the ABI defined in runtime.h. Thanks. -- H.J. Lu (hjl@gnu.org) From drepper@redhat.com Mon Jul 10 09:20:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 10 Jul 2000 09:20:00 -0000 Subject: Fix for sigaction Bug References: Message-ID: Andreas Jaeger writes: > The appended patch fixes this problem. Ok to commit? Yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kettenis@wins.uva.nl Mon Jul 10 10:56:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Mon, 10 Jul 2000 10:56:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <20000710080357.A18762@valinux.com> Message-ID: <200007101755.e6AHtp308067@delius.kettenis.local> Date: Mon, 10 Jul 2000 08:03:57 -0700 From: "H . J . Lu" I haven't heard any feedbacks about my proposal for the libgcc runtime ABI: http://gcc.gnu.org/ml/gcc-bugs/2000-07/msg00117.html But I think the current situation is quite broken. Indeed it is. And apparently people aren't very eager to do something about it. The fact that your "proposal" isn't really shocking might have something to do with it. Let me explain. The ABI you're proposing does already exist. Changing `sizeof (struct object)' or changing the calling convention of the functions mentioned in your runtime.h isn't possible anymore for supported targets with working exception support in gcc 2.95 or egcs 1.0.3 or so (and has indeed been impossible for quite a while now for some of those targets). So you're either just trying to formalize things, which is fine with me, or you're proposing something that cannot be done. Adding a new ABI without continued support for the old one isn't possible either unless you want to force people to recompile everything with the new gcc. On Linux (and the Hurd) the problem is even worse. Since the frame info registration functions are present in libc.so, you cannot simply add a new ABI without forcing everybody to patch and recompile libc. If we plan ahead it is certainly possible to ease the pain considerably, but this requires a lot of cooperation between the glibc and GCC teams, and depending on the solution that's chosen, probably quite a bit of time (in the order of months). If this isn't done, deploying GCC 3.0 on Linux will become a terrible nightmare. I'm having some problems with "libgcc runtime ABI". Right now libgcc is a pile of junk that contains some basic support functions (e.g. for long long and floating point arithmetic), the exception handling stuff (both registration of EH frame info, and the language independent EH runtime stuff), and some sort of C++ runtime (operator new, rtti, etc.). Your proposal is at best a specification of the "libgcc EH frame info registration ABI". In that respect, the name "runtime.h" seems not very appropriate to me. Mark From hjl@valinux.com Mon Jul 10 11:49:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Mon, 10 Jul 2000 11:49:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <20000710080357.A18762@valinux.com> <200007101755.e6AHtp308067@delius.kettenis.local> Message-ID: <20000710114452.A16231@valinux.com> On Mon, Jul 10, 2000 at 07:55:51PM +0200, Mark Kettenis wrote: > Date: Mon, 10 Jul 2000 08:03:57 -0700 > From: "H . J . Lu" > > I haven't heard any feedbacks about my proposal for the libgcc runtime > ABI: > > http://gcc.gnu.org/ml/gcc-bugs/2000-07/msg00117.html > > But I think the current situation is quite broken. > > Indeed it is. And apparently people aren't very eager to do something > about it. The fact that your "proposal" isn't really shocking might > have something to do with it. Let me explain. The ABI you're > proposing does already exist. Changing `sizeof (struct object)' or > changing the calling convention of the functions mentioned in your > runtime.h isn't possible anymore for supported targets with working > exception support in gcc 2.95 or egcs 1.0.3 or so (and has indeed been > impossible for quite a while now for some of those targets). So > you're either just trying to formalize things, which is fine with me, > or you're proposing something that cannot be done. > > Adding a new ABI without continued support for the old one isn't > possible either unless you want to force people to recompile > everything with the new gcc. > > On Linux (and the Hurd) the problem is even worse. Since the frame > info registration functions are present in libc.so, you cannot simply > add a new ABI without forcing everybody to patch and recompile libc. > If we plan ahead it is certainly possible to ease the pain > considerably, but this requires a lot of cooperation between the glibc > and GCC teams, and depending on the solution that's chosen, probably > quite a bit of time (in the order of months). If this isn't done, > deploying GCC 3.0 on Linux will become a terrible nightmare. It is too late now. > > I'm having some problems with "libgcc runtime ABI". Right now libgcc > is a pile of junk that contains some basic support functions (e.g. for > long long and floating point arithmetic), the exception handling stuff > (both registration of EH frame info, and the language independent EH > runtime stuff), and some sort of C++ runtime (operator new, rtti, > etc.). Your proposal is at best a specification of the "libgcc EH > frame info registration ABI". > > In that respect, the name "runtime.h" seems not very appropriate to > me. > My libgcc runtime ABI is the first step to address all of your concerns. The reason I choose "runtime.h" is a libgcc.so will be built from libgcc.a. I'd like to have a header file to describe the exported functions in libgcc.so. Most of the functions in libgcc are internal to compiler. But the ones listed in "runtime.h" are also used by glibc and collect2. In any case, the name of the header file is not important here. Once we define an exported ABI for libgcc, we can build a libgcc.so knowing that any binaries linked with libgcc.so using the exported ABI will work as long as libgcc.so conforms to the libgcc ABI. I don't think gcc should build libgcc.so at all. It should be the part of glibc or any system C libraries which use libgcc. When we build glibc, we can do # ld -shared -soname libgcc.so.3 \ -o libgcc-`gcc -dumpversion`.so ... \ --whole-archive `gcc -print-libgcc-file-name` We can install libgcc-`gcc -dumpversion`.so under /lib and have libgcc.so under /usr/lib. We can even make libgcc.so a linker script: --- GROUP ( /lib/libgccc.so.3 /usr/lib/libgcc_nonshared.a ) --- where /usr/lib/libgcc_nonshared.a contains the portion of basic support functions in libgcc.a. We then link libgcc.so with libc.so instead of libgcc.a. Now we have moved all the libgcc funtions from libc.so to libgcc.so. I think we can make it to work. -- H.J. Lu (hjl@gnu.org) From drepper@redhat.com Mon Jul 10 12:53:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 10 Jul 2000 12:53:00 -0000 Subject: Missing include in iconv/gconv_conf.c References: <200007081134.e68BYa730620@delius.kettenis.local> Message-ID: Mark Kettenis writes: > 2000-07-08 Mark Kettenis > > * iconv/gconv_conf.c: Include . I've applied the patch now. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Jul 10 13:01:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 10 Jul 2000 13:01:00 -0000 Subject: Move FD check to dl-sysdep.c References: <200007091757.e69Hvow25247@delius.kettenis.local> Message-ID: Mark Kettenis writes: > I think that sysdeps/generic/dl-sysdep.c conceptually is the right > place to put the call. I agree. I didn't know that the Hurd is using different mechanisms. I've applied the patch now. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Jul 10 13:43:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 10 Jul 2000 13:43:00 -0000 Subject: Resolver related thread-safety fix References: <200007101321.e6ADLte07323@delius.kettenis.local> Message-ID: Mark Kettenis writes: > When converting the DNS NSS module to use the new thread-safe resolver > functions, Andreas overlooked __hostalias. This patch corrects this. Thanks, I've applied the patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From rth@twiddle.net Mon Jul 10 15:34:00 2000 From: rth@twiddle.net (Richard Henderson) Date: Mon, 10 Jul 2000 15:34:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <20000710080357.A18762@valinux.com> <200007101755.e6AHtp308067@delius.kettenis.local> <20000710114452.A16231@valinux.com> Message-ID: <20000710153440.A26219@twiddle.net> On Mon, Jul 10, 2000 at 11:44:52AM -0700, H . J . Lu wrote: > I don't think gcc should build libgcc.so at all. It should be the > part of glibc or any system C libraries which use libgcc. I disagree entirely. I think libgcc should be its own thing and its own thing alone. We need to get glibc out of the business of providing libgcc functions. The best long-term way to do that, IMO, is once libgcc.so exists, have libc.so reference it as DT_AUXILIARY. That will provide for all backward compatibility wrt the symbols glibc currently exports. r~ From hjl@valinux.com Mon Jul 10 16:15:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Mon, 10 Jul 2000 16:15:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <20000710080357.A18762@valinux.com> <200007101755.e6AHtp308067@delius.kettenis.local> <20000710114452.A16231@valinux.com> <20000710153440.A26219@twiddle.net> Message-ID: <20000710161528.A13855@valinux.com> On Mon, Jul 10, 2000 at 03:34:40PM -0700, Richard Henderson wrote: > On Mon, Jul 10, 2000 at 11:44:52AM -0700, H . J . Lu wrote: > > I don't think gcc should build libgcc.so at all. It should be the > > part of glibc or any system C libraries which use libgcc. > > I disagree entirely. > > I think libgcc should be its own thing and its own thing alone. I agree libgcc.so should work with all gccs which conform to the libgcc.so ABI. > We need to get glibc out of the business of providing libgcc > functions. The best long-term way to do that, IMO, is once glibc shouldn't provide any libgcc functions. However, glibc will use some libgcc functions. That means libgcc.so has to be available when libc.so is loaded. I only proprose to let glibc decide where to put libgcc.so. gcc only provides a libgcc.a compiled with -fPIC and maybe a script like build-libgcc.so which will build libgcc.so from libgcc.a. Glibc will build libgcc.so from libgcc.a in gcc and install it at an appropriate place. -- H.J. Lu (hjl@gnu.org) From kettenis@wins.uva.nl Mon Jul 10 16:44:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Mon, 10 Jul 2000 16:44:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <20000710080357.A18762@valinux.com> <200007101755.e6AHtp308067@delius.kettenis.local> <20000710114452.A16231@valinux.com> <20000710153440.A26219@twiddle.net> Message-ID: <200007102343.e6ANhlS19569@delius.kettenis.local> Date: Mon, 10 Jul 2000 15:34:40 -0700 From: Richard Henderson On Mon, Jul 10, 2000 at 11:44:52AM -0700, H . J . Lu wrote: > I don't think gcc should build libgcc.so at all. It should be the > part of glibc or any system C libraries which use libgcc. I disagree entirely. It's certainly the GCC people who should control the libgcc.so ABI. And since a libgcc.so upgrade may be necessary when a new compiler is release, it's probably GCC that should install it. By all means it should be a "servicable component"; something you can upgrade without the need for upgrading all system C libraries with it. I think libgcc should be its own thing and its own thing alone. We need to get glibc out of the business of providing libgcc functions. The best long-term way to do that, IMO, is once libgcc.so exists, have libc.so reference it as DT_AUXILIARY. That will provide for all backward compatibility wrt the symbols glibc currently exports. The key word here is "long-term". Until we are in the situation you describe any significant changes to the frame info registration interface will cause serious binary compatibility problems on Linux. By the time of the next major GCC release ships (presumably with the frame registration functions in a shared library that's installed in /lib on most systems), we should have verified that something like the DT_AUXILIARY thing indeed works. You cannot say two months before the GCC 3.0 release "oh yeah, we were going to turn libgcc into a shared library, let's do it now" and expect things to work right away. Therefore planning on what to put in libgcc.so should start ASAP. Mark From kettenis@wins.uva.nl Mon Jul 10 16:54:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Mon, 10 Jul 2000 16:54:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <20000710080357.A18762@valinux.com> <200007101755.e6AHtp308067@delius.kettenis.local> <20000710114452.A16231@valinux.com> <20000710153440.A26219@twiddle.net> <20000710161528.A13855@valinux.com> Message-ID: <200007102354.e6ANsIU19577@delius.kettenis.local> Date: Mon, 10 Jul 2000 16:15:28 -0700 From: "H . J . Lu" On Mon, Jul 10, 2000 at 03:34:40PM -0700, Richard Henderson wrote: > We need to get glibc out of the business of providing libgcc > functions. The best long-term way to do that, IMO, is once glibc shouldn't provide any libgcc functions. However, glibc will use some libgcc functions. That means libgcc.so has to be available when libc.so is loaded. I only proprose to let glibc decide where to put libgcc.so. gcc only provides a libgcc.a compiled with -fPIC and maybe a script like build-libgcc.so which will build libgcc.so from libgcc.a. Glibc will build libgcc.so from libgcc.a in gcc and install it at an appropriate place. This isn't necessary at all. The shared libgcc belongs in /lib. If the GCC folks do their job properly, and take care of backwards compatibility issues, installing GCC can simply upgrade it if the version provided with the new GCC has the highest "version number". Lettenig glibc build libgcc.so from an archive installed by GCC is pointless and only puts limits on one's possibilities to use nice hacks. Mark From drepper@redhat.com Mon Jul 10 17:04:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 10 Jul 2000 17:04:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <20000710080357.A18762@valinux.com> <200007101755.e6AHtp308067@delius.kettenis.local> <20000710114452.A16231@valinux.com> <20000710153440.A26219@twiddle.net> <200007102343.e6ANhlS19569@delius.kettenis.local> Message-ID: Mark Kettenis writes: > we should have verified that something like the DT_AUXILIARY thing > indeed works. I don't think there is much danger here. I'm quite sure it works and if not, I can fix it easily. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Jul 10 17:09:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 10 Jul 2000 17:09:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <20000710080357.A18762@valinux.com> <200007101755.e6AHtp308067@delius.kettenis.local> <20000710114452.A16231@valinux.com> <20000710153440.A26219@twiddle.net> <20000710161528.A13855@valinux.com> <200007102354.e6ANsIU19577@delius.kettenis.local> Message-ID: Mark Kettenis writes: > This isn't necessary at all. The shared libgcc belongs in /lib. If > the GCC folks do their job properly, and take care of backwards > compatibility issues, installing GCC can simply upgrade it if the > version provided with the new GCC has the highest "version number". Letting it all to the gcc folks has one major drawback: they will either have to keep track of ABI changes for every single architecture/OS combination or they will have to bump the version number whenever something changed on any of the supported platforms. The latter has the concequences that after a while you'l have dozends of libgcc.so of which you cannot remove a single one unless you are making sure everything is recompiled. This latter approach will never get my blessing but of course I cannot prevent the gcc people from making this mistake. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kettenis@wins.uva.nl Mon Jul 10 17:15:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Mon, 10 Jul 2000 17:15:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <20000710080357.A18762@valinux.com> <200007101755.e6AHtp308067@delius.kettenis.local> <20000710114452.A16231@valinux.com> <20000710153440.A26219@twiddle.net> <200007102343.e6ANhlS19569@delius.kettenis.local> Message-ID: <200007110015.e6B0FHQ19663@delius.kettenis.local> Sender: drepper@cygnus.com Cc: rth@twiddle.net, hjl@valinux.com, libc-hacker@sourceware.cygnus.com, gcc@gcc.gnu.org Reply-To: drepper@cygnus.com (Ulrich Drepper) X-fingerprint: BE 3B 21 04 BC 77 AC F0 61 92 E4 CB AC DD B9 5A From: Ulrich Drepper Date: 10 Jul 2000 17:04:50 -0700 Content-Type: text/plain; charset=US-ASCII Mark Kettenis writes: > we should have verified that something like the DT_AUXILIARY thing > indeed works. I don't think there is much danger here. I'm quite sure it works and if not, I can fix it easily. I wasn't really questioning whether DT_AUXILIARY worked. I'm worried if the little schemes that we all think up here will work in the real world, when people start mixing shared libraries and programs produced by different compilers. That was the big problem with the __register_frame_info mess. IMHO we have to allow for an extended period of testing. Mark From drepper@redhat.com Mon Jul 10 17:58:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 10 Jul 2000 17:58:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <200007110052.BAA08376@phal.cygnus.co.uk> Message-ID: Joern Rennecke writes: > Or we could be lazy and use a major / minor number scheme for abi / libgcc2. No, this won't work. ELF has no understanding of minor versions. You'll have to keep track of the ABI numbering. What you don't have to do is bump the version number for every newly added interface. This is no problem and should be taken care of using versioning. But you'll have to bump the number for each and every actual change. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@lucon.org Mon Jul 10 18:12:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Mon, 10 Jul 2000 18:12:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <200007110052.BAA08376@phal.cygnus.co.uk> Message-ID: <20000710181158.A31177@lucon.org> On Mon, Jul 10, 2000 at 05:58:09PM -0700, Ulrich Drepper wrote: > Joern Rennecke writes: > > > Or we could be lazy and use a major / minor number scheme for abi / libgcc2. > > No, this won't work. ELF has no understanding of minor versions. > > You'll have to keep track of the ABI numbering. What you don't have > to do is bump the version number for every newly added interface. > This is no problem and should be taken care of using versioning. But > you'll have to bump the number for each and every actual change. > That is another reason why I prefer glibc builds libgcc.so from libgcc.a provided by gcc. Glibc has all the infrastructure needed to do it. I doubt it will be easy for gcc to do the same. Besides only very few OSes are affected by this. Why does gcc have to bother with it? It will be very hard for gcc to do it right for every target. IMHO, gcc should only provide a stable libgcc ABI and leave libgcc.so to each affected target. H.J. From drepper@redhat.com Mon Jul 10 21:27:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 10 Jul 2000 21:27:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <3051.963286489@upchuck> Message-ID: Jeffrey A Law writes: > What would you recommend then? Considering that we can not tie GCC to glibc > since GCC is used on a lot of systems that do not use glibc? I don't really know what to do, I haven't spend much time thinking about it. Your comment above is exactly amplifying my fear: gcc people cannot spend so many thoughts on one platform. Naturally, I don't blame you. This is exactly why HJ suggested to leve the generation of the libgcc.so to glibc or some additional new package. If gcc provides simply the libgcc with the interface(s) it currently supports the creation of libgcc.so outside gcc (which therefore can have many more demands on the environment like a ld which understands versioning) can - add more legacy interface which are needed but are not supported anymore by gcc or which do some data rewriting before calling the actual libgcc functions - create and install the actual libgcc.so with the appropriate soname The alternative is to find somebody (or a group) for each of the arch/OS combinations which care about compatibility at this level and have them maintain the data inside gcc and to significantly extend the build infrastructure to handle the soname and versioning requirements. Everybody who just dismissed HJ's proposal should stop and think about this for a moment. Will you be willing to do what I described inside gcc? How this actually should be implemented is unclear to me. It might be that the solution is a small shell script and possibly a few more .c files and create from the installed libgcc.a a .so file. It's also possible to pass a lot more information inside the libgcc.a file (remember: this is an archive and not at all limited to .o files). So it would be possible to put into libgcc.a all the sources and some kind of interface description. This certainly requires some more discussion and somebody with time to really think it through. HJ already made a proposal so we need to investigate it. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Tue Jul 11 00:51:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 11 Jul 2000 00:51:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <3051.963286489@upchuck> <200007110721.JAA01138@loewis.home.cs.tu-berlin.de> Message-ID: "Martin v. Loewis" writes: > Perhaps the target expert isn't too familiar with gcc sources. In that > case, she can get help on gcc@gcc.gnu.org. The problem is that this is causing much more pain than necessary. Adding something to gcc is hard. There are so many things to take care of since so many files are shared by many architecture. Standaline packages don't have this problem. > If his proposal was to provide a -fPIC libgcc object file collection > which is transformed into a shared library during glibc installation - > that won't work. I don't think users will want to rebuild glibc as > part of gcc installation. I don't think this works either. This is my I'm currently favouring a standaline package. But there might be situation where a new libc might require a new version of the libgcc.so and therefore there must be some kind of coupling between this new package and glibc. Perhaps something like an add-on (in the glibc-sense) which can also be used standalone). From jakub@redhat.com Tue Jul 11 06:44:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Tue, 11 Jul 2000 06:44:00 -0000 Subject: [PATCH] Header fixes Message-ID: <20000711154746.K17419@sunsite.ms.mff.cuni.cz> Hi! These two changes were necessary to compile libstdc++-v3 against glibc 2.1.91 headers. The latter one is needed because that library is being compiled with -Werror. 2000-07-11 Jakub Jelinek * math/bits/cmathcalls.h (cimag): Add __THROW. (creal, conj): Likewise. * wctype/wctype.h (_ISwbit): Avoid warnings about shifting left by negative value. --- libc/math/bits/cmathcalls.h.jj Mon Nov 9 19:20:54 1998 +++ libc/math/bits/cmathcalls.h Tue Jul 11 15:27:36 2000 @@ -135,21 +135,21 @@ __MATHDECL (_Mdouble_,creal, (_Mdouble_c /* Imaginary part of Z. */ extern __inline _Mdouble_ -__MATH_PRECNAME(cimag) (_Mdouble_complex_ __z) +__MATH_PRECNAME(cimag) (_Mdouble_complex_ __z) __THROW { return __imag__ __z; } /* Real part of Z. */ extern __inline _Mdouble_ -__MATH_PRECNAME(creal) (_Mdouble_complex_ __z) +__MATH_PRECNAME(creal) (_Mdouble_complex_ __z) __THROW { return __real__ __z; } /* Complex conjugate of Z. */ extern __inline _Mdouble_complex_ -__MATH_PRECNAME(conj) (_Mdouble_complex_ __z) +__MATH_PRECNAME(conj) (_Mdouble_complex_ __z) __THROW { return ~__z; } --- libc/wctype/wctype.h.jj Tue Jul 11 15:28:54 2000 +++ libc/wctype/wctype.h Tue Jul 11 15:29:24 2000 @@ -70,10 +70,10 @@ typedef unsigned long int wctype_t; # define _ISwbit(bit) (1 << (bit)) # else /* __BYTE_ORDER == __LITTLE_ENDIAN */ # define _ISwbit(bit) \ - ((bit) < 8 ? (int) (1UL << ((bit) + 24)) \ - : ((bit) < 16 ? (int) (1UL << ((bit) + 8)) \ - : ((bit) < 24 ? (int) (1UL << ((bit) - 8 )) \ - : (int) (1UL << ((bit) - 24 ))))) + ((bit) < 8 ? (int) ((1UL << (bit)) << 24) \ + : ((bit) < 16 ? (int) ((1UL << (bit)) << 8) \ + : ((bit) < 24 ? (int) ((1UL << (bit)) >> 8) \ + : (int) ((1UL << (bit)) >> 24)))) # endif enum Jakub From hjl@lucon.org Tue Jul 11 07:23:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Tue, 11 Jul 2000 07:23:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <3051.963286489@upchuck> <200007110721.JAA01138@loewis.home.cs.tu-berlin.de> Message-ID: <20000711072333.A760@lucon.org> On Tue, Jul 11, 2000 at 12:51:24AM -0700, Ulrich Drepper wrote: > > If his proposal was to provide a -fPIC libgcc object file collection > > which is transformed into a shared library during glibc installation - > > that won't work. I don't think users will want to rebuild glibc as > > part of gcc installation. > > I don't think this works either. This is my I'm currently favouring a > standaline package. But there might be situation where a new libc > might require a new version of the libgcc.so and therefore there must > be some kind of coupling between this new package and glibc. Perhaps > something like an add-on (in the glibc-sense) which can also be used > standalone). A standalone package, which can also be used as a glibc add-on, seems a reasonable solution. That will be target specific. I have to remind everyone that we have to have a stable, reasonable libgcc runtime ABI before we can build libgcc.so. We have to support any ABI functions forever. It doesn't mean gcc has to support the old ABI functions directly. But the standalone package has to. It has to be able to find a way to support old ABI functions somehow. We can do many things under Linux. But we still need some support from gcc. I am thinking libgcc.so may look like GROUP (/lib/libgcc.so /usr/lib/libgcc_nonshared.a) where /lib/libgcc.so only contains libgcc funtions which can only have one copy cross the executable and all DSOs. We should identify tham first. H.J. From aj@suse.de Tue Jul 11 09:05:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Tue, 11 Jul 2000 09:05:00 -0000 Subject: make check with static only builds Message-ID: With the help of Andreas Schwab I've fixed the localedata tests to run also with when doing a static only build. I've also fixed a bug in gen-locale when building in the sourcedirectory. Is the patch ok to commit? Andreas 2000-07-11 Andreas Schwab * Makeconfig (run-program-prefix): New rule. (built-program-cmd): Use run-program-prefix. 2000-07-11 Andreas Jaeger * Makefile (locale_test_suite): Always run test suite. ($(addprefix $(objpfx),$(CTYPE_FILES))): Add extra parameter for gen-locale.sh. (do-collate-test): Likewise. (do-tst-fmon): Likewise. (do-tst-locale): Likewise. (do-tst-rpmatch): Likewise. (do-tst-trans): Likewise. (do-tst-mbswcs): Likewise. (do-tst-ctype): Likewise. * sort-test.sh: Rewrite to work with static only builds. * tst-ctype.sh: Likewise. * tst-fmon.sh: Likewise. * tst-locale.sh: Likewise. * tst-msbwcs.sh: Likewise. * tst-rpmatch.sh: Likewise. * tst-trans.sh: Likewise. * gen-locale.sh (locfile): Fix it for building with sourcedir==builddir and for static only builds. ============================================================ Index: Makeconfig --- Makeconfig 2000/06/27 01:20:01 1.239 +++ Makeconfig 2000/07/11 15:57:21 @@ -475,20 +475,18 @@ # How to run a program we just linked with our library. # The program binary is assumed to be $(word 2,$^). built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^)) -ifneq (yes,$(build-shared)) -built-program-cmd = $(built-program-file) -else +ifeq (yes,$(build-shared)) comma = , sysdep-library-path = \ $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\ $(filter -Wl$(comma)-rpath-link=%,\ $(sysdep-LDFLAGS))))) -define built-program-cmd -$(elf-objpfx)$(rtld-installed-name) \ - --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ - $(built-program-file) -endef +run-program-prefix = $(elf-objpfx)$(rtld-installed-name) \ + --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) +else +run-program-prefix = endif +built-program-cmd = $(run-program-prefix) $(built-program-file) ifndef LD LD := ld -X ============================================================ Index: localedata/Makefile --- localedata/Makefile 2000/07/01 15:36:25 1.65 +++ localedata/Makefile 2000/07/11 15:57:21 @@ -76,7 +76,6 @@ include ../Makeconfig ifeq (no,$(cross-compiling)) -ifeq (yes,$(build-shared)) locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \ tst_iswctype tst_iswdigit tst_iswgraph \ tst_iswlower tst_iswprint tst_iswpunct \ @@ -94,7 +93,6 @@ tests = $(locale_test_suite) endif -endif # Files to install. install-others := $(addprefix $(inst_i18ndir)/, $(charmaps) $(locales) \ @@ -117,7 +115,6 @@ ifeq (no,$(cross-compiling)) -ifeq (yes,$(build-shared)) # We have to generate locales LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \ en_US.ISO-8859-1 ja_JP.EUC-JP @@ -130,9 +127,9 @@ # Dependency for the locale files. We actually make it depend only on # one of the files. $(addprefix $(objpfx),$(CTYPE_FILES)): %: \ - gen-locale.sh Makefile $(common-objpfx)locale/localedef \ + gen-locale.sh $(common-objpfx)locale/localedef Makefile \ $(addprefix charmaps/,$(CHARMAPS)) $(addprefix locales/,$(LOCALE_SRCS)) - @$(SHELL) -e gen-locale.sh $(common-objpfx) $@ + @$(SHELL) -e gen-locale.sh $(common-objpfx) '$(built-program-cmd)' $@ $(addsuffix .out,$(addprefix $(objpfx),$(locale_test_suite))): %: \ $(addprefix $(objpfx),$(CTYPE_FILES)) @@ -143,27 +140,26 @@ do-tst-mbswcs do-tst-ctype do-collate-test: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \ $(test-input-data) $(addprefix $(objpfx),$(CTYPE_FILES)) - $(SHELL) -e $< $(common-objpfx) $(test-input) + $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' $(test-input) do-tst-fmon: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data do-collate-test \ $(addprefix $(objpfx),$(CTYPE_FILES)) - $(SHELL) -e $< $(common-objpfx) tst-fmon.data -do-tst-locale: tst-locale.sh $(ld-test-srcs) \ + $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' tst-fmon.data +do-tst-locale: tst-locale.sh $(common-objpfx)locale/localedef $(ld-test-srcs) \ $(addprefix $(objpfx),$(CTYPE_FILES)) - $(SHELL) -e $< $(common-objpfx) + $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)' do-tst-rpmatch: tst-rpmatch.sh $(objpfx)tst-rpmatch do-tst-fmon \ $(addprefix $(objpfx),$(CTYPE_FILES)) - $(SHELL) -e $< $(common-objpfx) + $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)' do-tst-trans: tst-trans.sh $(objpfx)tst-trans \ $(addprefix $(objpfx),$(CTYPE_FILES)) - $(SHELL) -e $< $(common-objpfx) + $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' do-tst-mbswcs: tst-mbswcs.sh $(objpfx)tst-mbswcs1 $(objpfx)tst-mbswcs2 \ $(objpfx)tst-mbswcs3 $(objpfx)tst-mbswcs4 $(objpfx)tst-mbswcs5 \ $(addprefix $(objpfx),$(CTYPE_FILES)) - $(SHELL) -e $< $(common-objpfx) + $(SHELL) -e $< $(common-objpfx) '$(run-program-prefix)' do-tst-ctype: tst-ctype.sh $(objpfx)tst-ctype do-collate-test \ $(addprefix $(objpfx),$(CTYPE_FILES)) - $(SHELL) -e $< $(common-objpfx) -endif + $(SHELL) -e $< $(common-objpfx) '$(built-program-cmd)' endif # Sometimes the whole collection of locale files should be installed. ============================================================ Index: localedata/gen-locale.sh --- localedata/gen-locale.sh 2000/07/01 05:18:07 1.3 +++ localedata/gen-locale.sh 2000/07/11 15:57:21 @@ -19,6 +19,7 @@ # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. common_objpfx="$1"; shift +localedef="$1"; shift locfile="$1"; shift generate_locale () @@ -27,8 +28,7 @@ input=$2 out=$3 I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \ - ${common_objpfx}elf/ld.so --library-path $common_objpfx \ - ${common_objpfx}locale/localedef --quiet -c -f $charmap -i $input \ + ${localedef} --quiet -c -f $charmap -i $input \ ${common_objpfx}localedata/$out if [ $? -ne 0 ]; then @@ -38,8 +38,9 @@ fi } -locale=`echo $locfile|sed 's|.*/\([^/.]*\)[.].*/LC_CTYPE|\1|'` -charmap=`echo $locfile|sed 's|.*/[^/.]*[.]\(.*\)/LC_CTYPE|\1|'` +locfile=`echo $locfile|sed 's|.*/\([^/]*/LC_CTYPE\)|\1|'` +locale=`echo $locfile|sed 's|\([^.]*\)[.].*/LC_CTYPE|\1|'` +charmap=`echo $locfile|sed 's|[^.]*[.]\(.*\)/LC_CTYPE|\1|'` echo "Generating locale $locale.$charmap: this might take a while..." generate_locale $charmap $locale $locale.$charmap ============================================================ Index: localedata/sort-test.sh --- localedata/sort-test.sh 2000/06/29 19:10:40 1.7 +++ localedata/sort-test.sh 2000/07/11 15:57:21 @@ -1,6 +1,7 @@ #! /bin/sh common_objpfx=$1; shift +run_program_prefix=$1; shift lang=$* id=${PPID:-100} @@ -11,13 +12,13 @@ for l in $lang; do cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'` LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \ - LC_ALL=$l ${common_objpfx}elf/ld.so --library-path $common_objpfx \ + LC_ALL=$l ${run_program_prefix} \ ${common_objpfx}localedata/collate-test $id < $cns.in \ > ${common_objpfx}localedata/$cns.out || status=1 cmp -s $cns.in ${common_objpfx}localedata/$cns.out || status=1 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}/iconvdata \ - LC_ALL=$l ${common_objpfx}elf/ld.so --library-path $common_objpfx \ + LC_ALL=$l ${run_program_prefix} \ ${common_objpfx}localedata/xfrm-test $id < $cns.in \ > ${common_objpfx}localedata/$cns.xout || status=1 cmp -s $cns.in ${common_objpfx}localedata/$cns.xout || status=1 ============================================================ Index: localedata/tst-ctype.sh --- localedata/tst-ctype.sh 2000/06/30 04:06:14 1.7 +++ localedata/tst-ctype.sh 2000/07/11 15:57:21 @@ -19,6 +19,7 @@ # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. common_objpfx=$1; shift +tst_ctype=$1; shift status=0 # Run the test programs. @@ -30,8 +31,7 @@ input=/dev/null fi LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \ - LC_ALL=$loc ${common_objpfx}elf/ld.so --library-path $common_objpfx \ - ${common_objpfx}localedata/tst-ctype < $input \ + LC_ALL=$loc ${tst_ctype} < $input \ >> ${common_objpfx}localedata/tst-ctype.out || status=1 done ============================================================ Index: localedata/tst-fmon.sh --- localedata/tst-fmon.sh 2000/07/04 08:22:15 1.9 +++ localedata/tst-fmon.sh 2000/07/11 15:57:21 @@ -25,7 +25,8 @@ esac common_objpfx=$1 -datafile=$2 +run_program_prefix=$2 +datafile=$3 here=`pwd` @@ -37,19 +38,17 @@ fn=charmaps/ISO-8859-1 I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \ LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \ - ${common_objpfx}elf/ld.so --library-path $common_objpfx \ - ${common_objpfx}locale/localedef \ + ${run_program_prefix} ${common_objpfx}locale/localedef \ --quiet -i $cn -f $fn ${common_objpfx}localedata/$cns done # Run the tests. -IFS=" " # This is a TAB -while read locale format value expect; do +# There's a TAB for IFS +while IFS=" " read locale format value expect; do if [ -n "$format" ]; then LOCPATH=${common_objpfx}localedata \ GCONV_PATH=${common_objpfx}/iconvdata \ - ${common_objpfx}elf/ld.so --library-path $common_objpfx \ - ${common_objpfx}localedata/tst-fmon \ + ${run_program_prefix} ${common_objpfx}localedata/tst-fmon \ "$locale" "$format" "$value" "$expect" if [ $? -eq 0 ]; then if [ $DEBUG -eq 1 ]; then ============================================================ Index: localedata/tst-locale.sh --- localedata/tst-locale.sh 2000/07/04 08:21:58 1.10 +++ localedata/tst-locale.sh 2000/07/11 15:57:21 @@ -20,6 +20,7 @@ # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. common_objpfx=$1; shift +localedef=$1; shift test_locale () { @@ -32,8 +33,7 @@ fi I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata \ LOCPATH=${common_objpfx}localedata LC_ALL=C LANGUAGE=C \ - ${common_objpfx}elf/ld.so --library-path $common_objpfx \ - ${common_objpfx}locale/localedef --quiet -c -f $charmap -i $input \ + ${localedef} --quiet -c -f $charmap -i $input \ ${rep} ${common_objpfx}localedata/$out if [ $? -ne 0 ]; then ============================================================ Index: localedata/tst-mbswcs.sh --- localedata/tst-mbswcs.sh 2000/06/29 19:10:40 1.7 +++ localedata/tst-mbswcs.sh 2000/07/11 15:57:21 @@ -19,33 +19,29 @@ # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. common_objpfx=$1; shift +run_program_prefix=$1; shift status=0 # Run the test programs. LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \ -${common_objpfx}elf/ld.so --library-path $common_objpfx \ - ${common_objpfx}localedata/tst-mbswcs1 \ +${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs1 \ > ${common_objpfx}localedata/tst-mbswcs.out || status=1 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \ -${common_objpfx}elf/ld.so --library-path $common_objpfx \ - ${common_objpfx}localedata/tst-mbswcs2 \ +${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs2 \ >> ${common_objpfx}localedata/tst-mbswcs.out || status=1 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \ -${common_objpfx}elf/ld.so --library-path $common_objpfx \ - ${common_objpfx}localedata/tst-mbswcs3 \ +${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs3 \ >> ${common_objpfx}localedata/tst-mbswcs.out || status=1 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \ -${common_objpfx}elf/ld.so --library-path $common_objpfx \ - ${common_objpfx}localedata/tst-mbswcs4 \ +${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs4 \ >> ${common_objpfx}localedata/tst-mbswcs.out || status=1 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \ -${common_objpfx}elf/ld.so --library-path $common_objpfx \ - ${common_objpfx}localedata/tst-mbswcs5 \ +${run_program_prefix} ${common_objpfx}localedata/tst-mbswcs5 \ >> ${common_objpfx}localedata/tst-mbswcs.out || status=1 exit $status ============================================================ Index: localedata/tst-rpmatch.sh --- localedata/tst-rpmatch.sh 2000/06/30 04:05:20 1.5 +++ localedata/tst-rpmatch.sh 2000/07/11 15:57:21 @@ -20,14 +20,14 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. common_objpfx=$1 -IFS="&" +tst_rpmatch=$2 + rc=0 -while read locale string result dummy; do +while IFS=\& read locale string result dummy; do if [ "$locale" != "#" ]; then LOCPATH=${common_objpfx}localedata \ GCONV_PATH=${common_objpfx}/iconvdata \ - ${common_objpfx}elf/ld.so --library-path $common_objpfx \ - ${common_objpfx}localedata/tst-rpmatch $locale $string $result \ + ${tst_rpmatch} $locale $string $result \ || exit 1 fi done < ${common_objpfx}localedata/tst-trans.out exit $? -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From drepper@redhat.com Tue Jul 11 09:21:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 11 Jul 2000 09:21:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <4541.963328478@upchuck> Message-ID: Jeffrey A Law writes: > This seems totally backwards to me. GCC knows about things like it's > install directory, Right here you are wrong. The libgcc.so must never ever installed in a gcc-specific directory. Just think about what this would mean. > what version # to use for libgcc, This implies you are willing to track the version numbers for all the different target. Again, my argument is that you are *not* able to do this accurately since you cannot effort spending that much time on it. > what libraries have been built (do you really want to spread > multilib knowledge any further than it's already spread)? We are not talked about some stupid embedded systems with multilib needs. We are talking about systems where we need binary compatibility because of shared libraries. If you want to extend this to other, e.g., embedded systems, for whatever reason you can device another scheme since it will not have the same requirement. > I do not see what we gain by moving the creation of libgcc.so to another > package other than unnecessary complexity. I do not see that it simplifies > things. Then you really misunderstood the motifs. > But that can be done in gcc too I don't doubt this but will you have the manpower to keep this up? Because this is supposed to run on Linux where we use all kinds of features (for example its currently talked about using the libgcc.so in a DT_AUXILIARY entry). > > - add more legacy interface which are needed but are not supported > > anymore by gcc or which do some data rewriting before calling the > > actual libgcc functions > Agreed, if you're going to do this then I'd like to see it happen completely > outside gcc. I'm not sure how wise it is, but if we provide both libgcc.a > and libgcc.so, you'll still have this capability. So you basically already agree that the work has to be done outside gcc. > > > - create and install the actual libgcc.so with the appropriate soname > What about moving this into a different package makes it easier than having > it in gcc? I'm thinking about install paths, multilibs and the like -- GCC > knows about that stuff, and I'm not keen on expanding the number of packages > that need to know about such braindamage. Again, multilibs are uninteresting. The install directory will be /lib on Linux and similar directories for other systems. > > The alternative is to find somebody (or a group) for each of the > > arch/OS combinations which care about compatibility at this level and > > have them maintain the data inside gcc and to significantly extend the > > build infrastructure to handle the soname and versioning requirements. > Yup. That's how things have always been done in gcc-land. But I don't believe this will work. It didn't work so far. > > Everybody who just dismissed HJ's proposal should stop and think about > > this for a moment. Will you be willing to do what I described inside > > gcc? > Yes. You have to show me it works before I believe it. > Yup. You can hide all kinds of interesting things in .a files. But is > that really a good idea? Presumably you're looking at this as a way to > pass information from gcc to some external package which builds the > shared library. Right. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Tue Jul 11 09:50:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Tue, 11 Jul 2000 09:50:00 -0000 Subject: ldconfig problems References: <200007092109.RAA06606@neuralgia.linnaean.org> <200007100930.LAA12011@hawking.suse.de> Message-ID: Here's an updated patch. Is this one ok? Andreas 2000-07-10 Andreas Jaeger * elf/Makefile (SYSCONF-FLAGS): Added to pass sysconfdir to compiler. (CFLAGS-ldconfig.c): Added, uses SYSCONF-FLAGS. (CFLAGS-dl-cache.c): Likewise. (CFLAGS-cache.c): Likewise. * sysdeps/generic/dl-cache.h (LD_SO_CACHE): Use SYSCONFDIR to locate cache. * elf/ldconfig.c (LD_SO_CONF): Likewise. ============================================================ Index: elf/Makefile --- elf/Makefile 2000/07/01 15:36:11 1.156 +++ elf/Makefile 2000/07/11 16:49:16 @@ -215,6 +215,10 @@ $(objpfx)sprof: $(libdl) $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) +SYSCONF-FLAGS := -DSYSCONFDIR='"$(sysconfdir)"' +CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) +CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) +CFLAGS-cache.c = $(SYSCONF-FLAGS) test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names)))) generated += $(addsuffix .so,$(strip $(modules-names))) ============================================================ Index: elf/ldconfig.c --- elf/ldconfig.c 2000/05/10 09:14:27 1.4 +++ elf/ldconfig.c 2000/07/11 16:49:17 @@ -41,7 +41,7 @@ #include "dl-procinfo.h" #ifndef LD_SO_CONF -# define LD_SO_CONF "/etc/ld.so.conf" +# define LD_SO_CONF SYSCONFDIR "/ld.so.conf" #endif /* Get libc version number. */ @@ -152,7 +152,7 @@ is_hwcap (const char *name) { int hwcap_idx = _dl_string_hwcap (name); - + if (hwcap_idx != -1 && ((1 << hwcap_idx) & HWCAP_IMPORTANT)) return 1; return 0; ============================================================ Index: sysdeps/generic/dl-cache.h --- sysdeps/generic/dl-cache.h 2000/05/17 11:04:01 1.3 +++ sysdeps/generic/dl-cache.h 2000/07/11 16:49:17 @@ -27,7 +27,7 @@ #endif #ifndef LD_SO_CACHE -# define LD_SO_CACHE "/etc/ld.so.cache" +# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache" #endif #define CACHEMAGIC "ld.so-1.7.0" -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From aj@suse.de Tue Jul 11 09:50:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Tue, 11 Jul 2000 09:50:00 -0000 Subject: Patches for building in sourcedir Message-ID: Building the current glibc in the sourcedir and running make check gives problems like: /bin/sh -e tst-gettext.sh ../ tst-gettext: error while loading shared libraries: tst-gettext: cannot open shared object file: No such file or directory make[1]: *** [do-gettext-test] Error 127 The problem is this rule: do-gettext-test: tst-gettext.sh $(objpfx)tst-gettext $(SHELL) -e $< $(common-objpfx) $(objpfx) I'm appending a patch for this and similiar bugs. Ok to install? Andreas 2000-07-11 Andreas Jaeger * stdlib/Makefile (test-canon-ARGS): Fix for building in the source dir. * intl/Makefile (do-gettext-test): Likewise. * dirent/Makefile (opendir-tst1-ARGS): Likewise. ============================================================ Index: stdlib/Makefile --- stdlib/Makefile 2000/05/17 11:02:24 1.59 +++ stdlib/Makefile 2000/07/11 16:29:16 @@ -127,7 +127,7 @@ endif # Testdir has to be named stdlib and needs to be writable -test-canon-ARGS = --test-dir=${objdir}/stdlib +test-canon-ARGS = --test-dir=${common-objpfx}stdlib # Run a test on the header files we use. tests: $(objpfx)isomac ============================================================ Index: intl/Makefile --- intl/Makefile 2000/07/01 15:35:55 1.25 +++ intl/Makefile 2000/07/11 16:29:16 @@ -51,7 +51,7 @@ .PHONY: do-gettext-test tests: do-gettext-test do-gettext-test: tst-gettext.sh $(objpfx)tst-gettext - $(SHELL) -e $< $(common-objpfx) $(objpfx) + $(SHELL) -e $< $(common-objpfx) $(common-objpfx)intl/ endif endif endif ============================================================ Index: dirent/Makefile --- dirent/Makefile 2000/05/17 11:02:24 1.19 +++ dirent/Makefile 2000/07/11 16:42:29 @@ -1,4 +1,4 @@ -# Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc. +# Copyright (C) 1991,92,93,94,95,96,97,98,99,2000 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 @@ -32,4 +32,4 @@ include ../Rules -opendir-tst1-ARGS = --test-dir=${objdir} +opendir-tst1-ARGS = --test-dir=${common-objpfx}dirent -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From hjl@valinux.com Tue Jul 11 10:01:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Tue, 11 Jul 2000 10:01:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> Message-ID: <20000711100049.A15651@valinux.com> On Tue, Jul 11, 2000 at 10:34:05AM -0600, Jeffrey A Law wrote: > In message < m3bt04k58c.fsf@otr.mynet.cygnus.com >you write: > > Jeffrey A Law writes: > > > > > This seems totally backwards to me. GCC knows about things like it's > > > install directory, > > > > Right here you are wrong. The libgcc.so must never ever installed in > > a gcc-specific directory. Just think about what this would mean. > Yes, I'd forgotton about that. It's one of the issues that needs to > be addressed. However, I'm not going to say "must never", just that it's > an issues that must be resolved in one way or another. > I don't think Linux has much choice. It probably has to be installed along side with libc.so. > > > > > what version # to use for libgcc, > > > > This implies you are willing to track the version numbers for all the > > different target. Again, my argument is that you are *not* able to do > > this accurately since you cannot effort spending that much time on it. > But we need to -- we're not just building a linux compiler. We need this Look it this way. Since gcc is not a linux specific compiler and the libgcc/libc issuse is limited to very few targets, why should gcc spend HUGE amount of time up front and for continuing support? > capability across a number of systems to resolve a number of nasty problems. Can you name systems which have the same issue? Maybe we should talk to them to see what they want to do. > Punting it to an external package is just that -- punting. > > > > > what libraries have been built (do you really want to spread > > > multilib knowledge any further than it's already spread)? > > > > We are not talked about some stupid embedded systems with multilib > > needs. We are talking about systems where we need binary > > compatibility because of shared libraries. > Some native systems have multilibs. alphas for example, maybe sparcs. > And in the embedded linux world we will likely have systems that need > multilibs. We can't simply ignore those issues. Linux (glibc) has its own multilibs support, for SHARED LIBRARIES, not just for static libraries. When Ulrich said "multilibs are uninteresting", I take it meant comparing with the solution for multilibs SHARED LIBRARIES in glibc, the one in gcc looks dumb if not stupid. > > So you basically already agree that the work has to be done outside gcc. > No, I said that it is technically possible to do what you want outside > of GCC given what we provide in libgcc.a. I did _NOT_ say that the > "work has to be done outside gcc". Far from it. > Please keep in mind we are talking DSO here. gcc never has any good track record on the support for binary compatibility in DSOs. I put in something called "library interface." But it is not enough for backward binary compatibility. The glibc's track record is not perfect, but it is quite good and we have leaned a lot from our experiences. -- H.J. Lu (hjl@gnu.org) From kettenis@wins.uva.nl Tue Jul 11 10:37:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 11 Jul 2000 10:37:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <20000711100049.A15651@valinux.com> Message-ID: <200007111736.e6BHabh26848@delius.kettenis.local> Date: Tue, 11 Jul 2000 10:00:49 -0700 From: "H . J . Lu" I don't think Linux has much choice. It probably has to be installed along side with libc.so. It also might have to be installed whenever a new version of GCC is installed. In fact that's the only moment a new libgcc.so will have to be installed apart from bootstrapping the whole scheme. > > > > > what version # to use for libgcc, > > > > This implies you are willing to track the version numbers for all the > > different target. Again, my argument is that you are *not* able to do > > this accurately since you cannot effort spending that much time on it. > But we need to -- we're not just building a linux compiler. We need this Look it this way. Since gcc is not a linux specific compiler and the libgcc/libc issuse is limited to very few targets, why should gcc spend HUGE amount of time up front and for continuing support? In essence, the issues aren't really a libgcc/libc issue. Currently all ELF systems have similar problems with getting exceptions working in the presence of shared libraries. Most of the other systems with shared libraries probably suffer too. The fact that the Linux libc contains and reexports the frame info registration functions make things a little more complicated, and might induce the need for some additional tweaks. But the problem isn't Linux-specific by far. Mark From hjl@valinux.com Tue Jul 11 10:40:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Tue, 11 Jul 2000 10:40:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <20000711100049.A15651@valinux.com> <200007111736.e6BHabh26848@delius.kettenis.local> Message-ID: <20000711104028.A15772@valinux.com> On Tue, Jul 11, 2000 at 07:36:37PM +0200, Mark Kettenis wrote: > In essence, the issues aren't really a libgcc/libc issue. Currently > all ELF systems have similar problems with getting exceptions working > in the presence of shared libraries. Most of the other systems with > shared libraries probably suffer too. > > The fact that the Linux libc contains and reexports the frame info > registration functions make things a little more complicated, and I believe it is the cause of the problem. Otherwise, it will be libstdc++.so who contains and reexports the frame info registration functions, which is the part of gcc and handled by my "library interface" scheme. It is an entirely different issuse. > might induce the need for some additional tweaks. But the problem > isn't Linux-specific by far. > -- H.J. Lu (hjl@gnu.org) From kettenis@wins.uva.nl Tue Jul 11 10:41:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 11 Jul 2000 10:41:00 -0000 Subject: What to put in a shared libgcc Message-ID: <200007111740.e6BHet626853@delius.kettenis.local> Here's an analysis of the modules in libgcc.a for GCC 2.95.2 on i586-pc-linux-gnu. Feel free to put this up on the gcc web pages if you like (linked to the libgcc.so discussion page or so). Based on this analysis, I think the only stuff that should be moved into a shared libgcc on Linux/x86 is the frame registration stuff (frame.o) and probably parts of the language-independent exception handling stuff (libgcc.2[L_eh], i.e. the stuff that ends up in _eh.o). I left out the arithmetic support functions (such as __ashldi3, __floatdixf, etc.). These can go anywhere we like. That probably means keeping them in the libgcc archive, provided we can address the problem of reexporting themfrom shared libraries created with GCC, which at least on Linux, I think we can. The reason for putting as little stuff in the shared libgcc as possible, is simple. It's much easier to control a small ABI than a large one. And one can only add stuff, not remove. OK here we go. For some modules I provide the list of global symbols as reported by nm: __dummy.o: 00000000 T __dummy Could this be, eh..., a dummy function? We can put this wherever we want. __gcc_bcmp.o: 0000003b t Letext 00000000 T __gcc_bcmp Multiple copies don't matter, we can put this obe weherever we want. _bb.o: Functions for basic block profiling. I don't think these belong in the shared libgcc. Profiling isn't something that is supposed to be done on installed/distributed binaries, so binary compatibility isn't a problem. _eh.o: Functions for exception handling. I'm not sure about these. If there isn't a stable interface for this stuff it shouldn't be added to the shared libgcc. If the interface is stable, and the ABI is considered fixed, this might be added to the shared libgcc. That might even be essential to prevent problems from a mismatch with the frame registration functions. The presence of __terminate_func also suggests it might be a good idea. Otherwise set_terminate() might suffer from amnesia if additional shared libraries are being dlopen()'ed. There are plans to use some of this stuff in glibc to implement pthreads cleanup handlers, in order to let them do the right thing for multithreaded C++ programs. In that case the interaction with glibc's libpthread.so is important too. Putting things in the shared libgcc probably avoids any problems. Is there any reason to put setjmp/longjmp exception handling in the shared libgcc when DWARF2 unwind info is available? I don't think so since it's non-standard. The sj stuff doesn't need the frame stuff By the way, is there any reason why __default_terminate() isn't static? Or empty() for that matter. It looks like it isn't referenced anywhere in the GCC tree, except in the libgcc2.c [L_eh] itself. Is this part of an undocumented interface of some sorts or just an oversight? _eprintf.o: 00000000 T __eprintf U abort U fflush U fprintf U stderr Better left in the archive. It's certainly not essential that a single copy of __eprintf() is used. This function references abort(), fflush(), fprintf() and stderr. The interface of these is dictated by ISO C, and only depends on the sizeof (int) and sizeof (FILE *). If this ends up in a shared library the references will be bound to a specific version if we link with libc, or to the base version. _pure.o: 00000000 T __pure_virtial U __terminate The same argument as fot _eprintf.o applies. _shtab.o: 00000000 D __shtab Multiple copies may be used. Doesn't matter where this ends up. _varargs.o: 00000000 T __builtin_saveregs U abort Multiple copies may be used. Doesn't really matter where this ends up, although the argument used with _eprintf.o may be applied to prefer leaving it in the archive. exception.o: Depends on the C++ ABI. Should therefore not end up in the shared libgcc. Probably (parts of) it should be moved into a C++-specific runtime library. frame.o: 00000cbc T __deregister_frame 00000c04 T __deregister_frame_info 00000cec T __frame_state_for 00000b20 T __register_frame 00000aa0 T __register_frame_info 00000b54 T __register_frame_info_table 00000bd0 T __register_frame_table U abort U free U malloc w pthread_create w pthread_getspecific w pthread_key_create w pthread_key_delete w pthread_mutex_lock w pthread_mutex_trylock w pthread_mutex_unlock w pthread_once w pthread_setspecific Functions for EH frame info registration. This is the module that started all the trouble. There has to be a single copy of this module in the entire process. The module may be completely absent in programs that don't use exception handling, i.e. programs that never call __frame_state_for. That's why GCC's crtstuff.c goes to some trouble with weak references to __register_frame_info and __register_frame_table, although I'm not sure if that has the desired effect right now. I think the consensus is that the only chance of having exception handling work correctly on systems with shared libraries is to put this module in a shared libgcc. I'm a bit worried though about the fact that this program references pthreads functions. This means that changing the ABI for these functions in libc might have disastrous consequences. And since pthread_mutex_t isn't an opaque type, and might need to be extended to support new mutex attributes, changing the ABI may become necessary. Perhaps we should formalize an alternative interface for a basic mutex type in glibc such that libgcc can use that instead? Note that __deregister_frame, __register_frame and __register_frame_table are present for backward compatibility only. In principle they could be left out from the shared libgcc, which has the additional advantage that this drops the dependency on malloc() and free(). They're part glibc right now, but since they can be easily implemented in terms of the new functions we can provide an implementation in glibc for them. new.o: opdel.o: opdelnt.o: opnew.o: opnewnt.o: opvdel.o: opvdelnt.o: opvnew.o: opvnewnt.o: tinfo.o: tinfo2.o: These modules depend on the C++ ABI. Should therefore not end up in the shared libgcc. Probably should be moved into a C++-specific runtime library. From drepper@redhat.com Tue Jul 11 10:42:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 11 Jul 2000 10:42:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> Message-ID: Jeffrey A Law writes: > Yes, I'd forgotton about that. It's one of the issues that needs to > be addressed. However, I'm not going to say "must never", just that it's > an issues that must be resolved in one way or another. Every application will be linked against this library and therefore it must be available on the root filesystem where there is certainly no room for gcc. > But we need to -- we're not just building a linux compiler. We need this > capability across a number of systems to resolve a number of nasty problems. We don't have to care about these things on other platforms (perhaps on BSD but these people do their own stuff anyway). The problem only exists if the libc is using the code from libgcc and possibly re-exports it. > Some native systems have multilibs. alphas for example, maybe sparcs. > And in the embedded linux world we will likely have systems that need > multilibs. We can't simply ignore those issues. None of the systems we care about. > Multilibs are very interesting, and I don't think it's a given that the > install directory will be /lib. I believe that is still subject to debate. We are completely missing each other. You completely underestimate the work needed to keep this compatibility library up-to-date. Putting this in gcc means you cannot make a new release of gcc until every single platform is handled (means, you have to actually review all the interfaces for each OS/arch combination). If nobody is volunteering you have to do it yourself since otherwise you'll put out a gcc version which can create incompatible binaries or breaks existing one. This is wrong. Doing things outside gcc has the advantage of not delaying the release. The worst case is that the new release cannot be used on a certain platform but that's it. And this would be the fault of the people writing the libgcc.so for that arch/OS. It will also be up to the arch/OS groups to decide when binary compatibility is dropped and all compatibility stuff from libgcc.so should be dropped. In the end you might end up to have an individual configuration for each arch/OS/host/target combination. I don't believe for a second that you can centrally manage this. I don't know how to make this clearer, libgcc.so is a system library. Unless you want to get into the system library development you should not even consider handling the libgcc.so yourself. Besides, I have not heard a single convincing argument why libgcc.so should be generate as part of gcc. What do you want to achieve? -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kettenis@wins.uva.nl Tue Jul 11 10:46:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 11 Jul 2000 10:46:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <20000710080357.A18762@valinux.com> <200007101755.e6AHtp308067@delius.kettenis.local> <20000710114452.A16231@valinux.com> <20000710153440.A26219@twiddle.net> <200007102343.e6ANhlS19569@delius.kettenis.local> <200007110015.e6B0FHQ19663@delius.kettenis.local> <20000710174805.A3258@cygnus.com> Message-ID: <200007111746.e6BHkcj26869@delius.kettenis.local> Date: Mon, 10 Jul 2000 17:48:05 -0700 From: Richard Henderson > IMHO we have to allow for an extended period of testing. Indeed. I've been having good intentions toward getting this taken care of for quite some time. The barrier is the amount of horror I feel in trying to figure out libtool in a (canadian) cross environment. But it ought to get done soon... I'm certainly willing to put some work into it this summer. However, let's not let the urge to see some real code clobber our view on the bigger picture just yet. I've just posted an analysis of the contents of the GCC 2.95.2 libgcc.a to the gcc list. I hope that can serve as a guide on exactly what should be put into the shared libgcc. Let's first decide on what to put into it before providing the infrastructure to actually build it. Mark From drepper@redhat.com Tue Jul 11 10:51:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 11 Jul 2000 10:51:00 -0000 Subject: ldconfig problems References: <200007092109.RAA06606@neuralgia.linnaean.org> <200007100930.LAA12011@hawking.suse.de> Message-ID: Andreas Jaeger writes: > Here's an updated patch. Is this one ok? It works to the extend you planned it to. How I understood Roland (and how I would do this) is a bit different. I would have the prefix (either compiled in or passed on the ldconfig command line) determine which directories to search in a way similar to chroot(). I.e., no directory below the prefix directory or in a different tree is ever used. Example: - I'm installing in /test. This means the sysconfig dir is /test/etc, the libraries are in /test/lib etc - ldconfig would search for DSOs in /test/lib and perhaps /test/usr/lib (unless overwritten by a ld.so.conf file) - ldconfig will never look into /lib, /usr/lib etc unless told so This has the advantage that you can have a completely isolated testing arena without fearing to pickup old DSOs. If this is wanted, ldconfig can be told to look into the regular directories. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kettenis@wins.uva.nl Tue Jul 11 10:57:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 11 Jul 2000 10:57:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <200007110052.BAA08376@phal.cygnus.co.uk> Message-ID: <200007111756.e6BHutV26876@delius.kettenis.local> From: Joern Rennecke Date: Tue, 11 Jul 2000 01:52:47 +0100 (BST) Whoever the version number is bumped up for a target you have to use a number that is lager than the current libgcc2 number, and you have to update a comment next to the libgcc version number what the next number should be, unless there is already a larger number there. Or we could be lazy and use a major / minor number scheme for abi / libgcc2. I think the version number scheme isn't really an issue. People don't seem to get that you cannot remove things from the ABI and/or replace things in the ABI without causing severe binary compatibility problems with shared libraries, especially on systems where libc depends on the shared libgcc. Suppose you had for a long time a libgcc.so.1, and built several shared libraries with it. Now introduce libgcc.so.2 (because you had to break backwards compatibility for some reason) and start building programs with it. These programs cannot use the old shared libraries since libgcc.so.1 and libgcc.so.2 would probably clash. Now think of libc as one of these old shared libraries, and realise that things are hopelessly hosed. Recompiling libc won't help in this case, since that would mean you cannot use any old binaries at all. This means you'll have to bump libc's soname, which is something that people really don't like. The conclusion is that control over the libgcc.so ABI should be really tight. The less stuff it contains the better. Mark From kettenis@wins.uva.nl Tue Jul 11 10:59:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 11 Jul 2000 10:59:00 -0000 Subject: What to put in a shared libgcc Message-ID: <200007111759.e6BHxfp26885@delius.kettenis.local> [Sorry folks, tried to send this to gcc@gnu.org instead of gcc@gcc.gnu.org :-(] Here's an analysis of the modules in libgcc.a for GCC 2.95.2 on i586-pc-linux-gnu. Feel free to put this up on the gcc web pages if you like (linked to the libgcc.so discussion page or so). Based on this analysis, I think the only stuff that should be moved into a shared libgcc on Linux/x86 is the frame registration stuff (frame.o) and probably parts of the language-independent exception handling stuff (libgcc.2[L_eh], i.e. the stuff that ends up in _eh.o). I left out the arithmetic support functions (such as __ashldi3, __floatdixf, etc.). These can go anywhere we like. That probably means keeping them in the libgcc archive, provided we can address the problem of reexporting themfrom shared libraries created with GCC, which at least on Linux, I think we can. The reason for putting as little stuff in the shared libgcc as possible, is simple. It's much easier to control a small ABI than a large one. And one can only add stuff, not remove. OK here we go. For some modules I provide the list of global symbols as reported by nm: __dummy.o: 00000000 T __dummy Could this be, eh..., a dummy function? We can put this wherever we want. __gcc_bcmp.o: 0000003b t Letext 00000000 T __gcc_bcmp Multiple copies don't matter, we can put this obe weherever we want. _bb.o: Functions for basic block profiling. I don't think these belong in the shared libgcc. Profiling isn't something that is supposed to be done on installed/distributed binaries, so binary compatibility isn't a problem. _eh.o: Functions for exception handling. I'm not sure about these. If there isn't a stable interface for this stuff it shouldn't be added to the shared libgcc. If the interface is stable, and the ABI is considered fixed, this might be added to the shared libgcc. That might even be essential to prevent problems from a mismatch with the frame registration functions. The presence of __terminate_func also suggests it might be a good idea. Otherwise set_terminate() might suffer from amnesia if additional shared libraries are being dlopen()'ed. There are plans to use some of this stuff in glibc to implement pthreads cleanup handlers, in order to let them do the right thing for multithreaded C++ programs. In that case the interaction with glibc's libpthread.so is important too. Putting things in the shared libgcc probably avoids any problems. Is there any reason to put setjmp/longjmp exception handling in the shared libgcc when DWARF2 unwind info is available? I don't think so since it's non-standard. The sj stuff doesn't need the frame stuff By the way, is there any reason why __default_terminate() isn't static? Or empty() for that matter. It looks like it isn't referenced anywhere in the GCC tree, except in the libgcc2.c [L_eh] itself. Is this part of an undocumented interface of some sorts or just an oversight? _eprintf.o: 00000000 T __eprintf U abort U fflush U fprintf U stderr Better left in the archive. It's certainly not essential that a single copy of __eprintf() is used. This function references abort(), fflush(), fprintf() and stderr. The interface of these is dictated by ISO C, and only depends on the sizeof (int) and sizeof (FILE *). If this ends up in a shared library the references will be bound to a specific version if we link with libc, or to the base version. _pure.o: 00000000 T __pure_virtial U __terminate The same argument as fot _eprintf.o applies. _shtab.o: 00000000 D __shtab Multiple copies may be used. Doesn't matter where this ends up. _varargs.o: 00000000 T __builtin_saveregs U abort Multiple copies may be used. Doesn't really matter where this ends up, although the argument used with _eprintf.o may be applied to prefer leaving it in the archive. exception.o: Depends on the C++ ABI. Should therefore not end up in the shared libgcc. Probably (parts of) it should be moved into a C++-specific runtime library. frame.o: 00000cbc T __deregister_frame 00000c04 T __deregister_frame_info 00000cec T __frame_state_for 00000b20 T __register_frame 00000aa0 T __register_frame_info 00000b54 T __register_frame_info_table 00000bd0 T __register_frame_table U abort U free U malloc w pthread_create w pthread_getspecific w pthread_key_create w pthread_key_delete w pthread_mutex_lock w pthread_mutex_trylock w pthread_mutex_unlock w pthread_once w pthread_setspecific Functions for EH frame info registration. This is the module that started all the trouble. There has to be a single copy of this module in the entire process. The module may be completely absent in programs that don't use exception handling, i.e. programs that never call __frame_state_for. That's why GCC's crtstuff.c goes to some trouble with weak references to __register_frame_info and __register_frame_table, although I'm not sure if that has the desired effect right now. I think the consensus is that the only chance of having exception handling work correctly on systems with shared libraries is to put this module in a shared libgcc. I'm a bit worried though about the fact that this program references pthreads functions. This means that changing the ABI for these functions in libc might have disastrous consequences. And since pthread_mutex_t isn't an opaque type, and might need to be extended to support new mutex attributes, changing the ABI may become necessary. Perhaps we should formalize an alternative interface for a basic mutex type in glibc such that libgcc can use that instead? Note that __deregister_frame, __register_frame and __register_frame_table are present for backward compatibility only. In principle they could be left out from the shared libgcc, which has the additional advantage that this drops the dependency on malloc() and free(). They're part glibc right now, but since they can be easily implemented in terms of the new functions we can provide an implementation in glibc for them. new.o: opdel.o: opdelnt.o: opnew.o: opnewnt.o: opvdel.o: opvdelnt.o: opvnew.o: opvnewnt.o: tinfo.o: tinfo2.o: These modules depend on the C++ ABI. Should therefore not end up in the shared libgcc. Probably should be moved into a C++-specific runtime library. From greg@mcgary.org Tue Jul 11 10:59:00 2000 From: greg@mcgary.org (Greg McGary) Date: Tue, 11 Jul 2000 10:59:00 -0000 Subject: PATCH: fix warnings for build-bounded Message-ID: <200007111759.KAA28687@kayak.mcgary.org> 2000-07-11 Greg McGary * include/libc-symbols.h [!__ASSEMBLER__] (strong_alias): Add extra level of macro expansion. [!__ASSEMBLER__ && HAVE_WEAK_SYMBOLS] (weak_alias): nLikewise. * sysdeps/generic/bp-thunks.h: Ensure `struct timeval' definition is available at the time `select' prototype is declared. * sysdeps/unix/make-syscalls.sh: Remove unused variables. Collect non-versioned weak aliases. Consider only non-versioned aliases for the user-visible systemcall name. Do checks inline with call to primitive system call. * sysdeps/unix/sysv/linux/ptrace.c (ptrace): Add void cast to stand-alone bounds checks to suppress unused value warnings. * sysdeps/unix/sysv/linux/sysctl.c (__sysctl): Likewise. Index: include/libc-symbols.h =================================================================== RCS file: /cvs/glibc/libc/include/libc-symbols.h,v retrieving revision 1.16 diff -u -p -r1.16 libc-symbols.h --- libc-symbols.h 2000/06/27 17:05:41 1.16 +++ libc-symbols.h 2000/07/11 17:47:32 @@ -81,7 +81,8 @@ possible, instead of embedded assembly language. */ /* Define ALIASNAME as a strong alias for NAME. */ -# define strong_alias(name, aliasname) \ +# define strong_alias(name, aliasname) _strong_alias(name, aliasname) +# define _strong_alias(name, aliasname) \ extern __typeof (name) aliasname __attribute__ ((alias (#name))); /* This comes between the return type and function name in @@ -93,7 +94,8 @@ /* Define ALIASNAME as a weak alias for NAME. If weak aliases are not available, this defines a strong alias. */ -# define weak_alias(name, aliasname) \ +# define weak_alias(name, aliasname) _weak_alias (name, aliasname) +# define _weak_alias(name, aliasname) \ extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))); /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */ Index: sysdeps/generic/bp-thunks.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/generic/bp-thunks.h,v retrieving revision 1.2 diff -u -p -r1.2 bp-thunks.h --- bp-thunks.h 2000/07/06 00:48:38 1.2 +++ bp-thunks.h 2000/07/11 17:47:32 @@ -31,12 +31,19 @@ #include #include #include + +/* Get `struct timeval' definition for select. */ +#define __need_timeval +#include + #include #include #include #include #include +#include #include + #include #include #include Index: sysdeps/unix/make-syscalls.sh =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/make-syscalls.sh,v retrieving revision 1.18 diff -u -p -r1.18 make-syscalls.sh --- make-syscalls.sh 2000/07/08 07:12:48 1.18 +++ make-syscalls.sh 2000/07/11 17:47:32 @@ -23,14 +23,8 @@ ptrlet='[abBfNpPs]' argdig='[1-9]' fixarg='[^vV]'$argdig # fixed args (declare extern) -strarg=s$argdig # string arg (check with CHECK_STRING) -twoarg=f$argdig # fd pair arg (check with CHECK_N (..., 2) -objarg=p$argdig # object arg (check with CHECK_1) ptrarg=$ptrlet$argdig # pointer arg (toss bounds) -rtnarg='P'$argdig # pointer return value (add bounds) -bufarg='[bB]'$argdig # buffer arg (check with CHECK_N) intarg='[inv]'$argdig # scalar arg -borarg='[iv]'$argdig # boring arg (just pass it through) ############################################################################## @@ -193,8 +187,14 @@ shared-only-routines += $file x-,-,* | x*,*.[sS],*V*) ;; x*,-,*$ptrlet* | x*,*.[sS],*$ptrlet*) + nv_weak=`for name in $weak; do + case $name in + *@*) ;; + *) echo $name;; + esac; done` + # choose the name with the fewest leading underscores, preferably none - set `echo $strong $weak |tr ' \t' '\n' |sort -r` + set `echo $strong $nv_weak |tr '@ \t' ' \n\n' |sort -r` callname=$1 # convert signature string to individual numbered arg names @@ -237,31 +237,22 @@ shared-only-routines += $file -e 's/\('$ptrarg'\)/__typeof (\1v) *__unbounded/g' \ -e 's/\('$intarg'\)/__typeof (\1v)/g'`); \\'; \\" - # generate thunk bounds checks - for arg; do - next=$2; shift - case $arg in - B$argdig) echo " echo ' __ptrvalue (${arg}a) && \\'; \\" ;; - esac - case $arg in - n$argdig) len=$arg ;; ### save for possible use with return value. - $strarg) echo " echo ' CHECK_STRING (${arg}a); \\'; \\" ;; - $objarg) echo " echo ' CHECK_1 (${arg}a); \\'; \\" ;; - $twoarg) echo " echo ' CHECK_N (${arg}a, 2); \\'; \\" ;; - $bufarg) - case $next in - n$argdig) echo " echo ' CHECK_N (${arg}a, ${next}a); \\'; \\" ;; - N$argdig) echo " echo ' CHECK_N (${arg}a, *CHECK_1 (${next}a)); \\'; \\" ;; - *) echo "### BP Thunk Error: Expected length after buffer ###" ;; - esac ;; - esac - done + # stash length arg for use with mman calls that return pointers + len=`echo $args |sed -e 's/.*\('n$argdig'\).*/\1/'` # generate thunk epilogue funcall="($callname) (`echo $args | \ - sed -e 's/ /, /g' \ - -e 's/\('$ptrarg'\)/__ptrvalue (\1a)/g' \ - -e 's/\('$intarg'\)/\1a/g'`)" + sed -e 's/ /, /g' \ + -e 's/\('a$argdig'\)/__ptrvalue (\1a)/g' \ + -e 's/\('s$argdig'\)/CHECK_STRING (\1a)/g' \ + -e 's/\('p$argdig'\)/CHECK_1 (\1a)/g' \ + -e 's/\('f$argdig'\)/CHECK_N (\1a, 2)/g' \ + -e 's/\('b$argdig'\), \('n$argdig'\)/CHECK_N (\1a, \2), \2/g' \ + -e 's/\('b$argdig'\), \('N$argdig'\)/CHECK_N (\1a, *CHECK_1 (\2a)), __ptrvalue (\2a)/g' \ + -e 's/\('B$argdig'\), \('n$argdig'\)/CHECK_Nopt (\1a, \2), \2/g' \ + -e 's/\('B$argdig'\), \('N$argdig'\)/CHECK_Nopt (\1a, *CHECK_1 (\2a)), __ptrvalue (\2a)/g' \ + -e 's/\('[ivn]$argdig'\)/\1a/g'`)" + case $rtn in P*) echo " echo '{ __typeof ($rtn) *__bounded rtn; \\'; \\ echo ' __ptrlow (rtn) = __ptrvalue (rtn) = $funcall; \\'; \\ @@ -271,12 +262,10 @@ shared-only-routines += $file echo " echo '} \\'; \\" # generate thunk aliases - for name in $weak; do - case $name in - *@*) ;; - *) echo " echo 'weak_alias (BP_SYM ($strong), BP_SYM ($name)) \\'; \\" ;; - esac + for name in $nv_weak; do + echo " echo 'weak_alias (BP_SYM ($strong), BP_SYM ($name)) \\'; \\" done + # wrap up echo "\ echo ''; \\ Index: sysdeps/unix/sysv/linux/ptrace.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ptrace.c,v retrieving revision 1.8 diff -u -p -r1.8 ptrace.c --- ptrace.c 2000/07/07 02:19:05 1.8 +++ ptrace.c 2000/07/11 17:47:32 @@ -55,40 +55,40 @@ ptrace (enum __ptrace_request request, . case PTRACE_POKETEXT: case PTRACE_POKEDATA: case PTRACE_POKEUSER: - CHECK_1 ((int *) addr); - CHECK_1 ((int *) data); + (void) CHECK_1 ((int *) addr); + (void) CHECK_1 ((int *) data); break; case PTRACE_GETREGS: case PTRACE_SETREGS: #ifdef __i386__ - CHECK_1 ((struct user_regs_struct *) data); + (void) CHECK_1 ((struct user_regs_struct *) data); #else /* We don't know the size of data, so the best we can do is ensure that `data' is valid for at least one word. */ - CHECK_1 ((int *) data); + (void) CHECK_1 ((int *) data); #endif break; case PTRACE_GETFPREGS: case PTRACE_SETFPREGS: #ifdef __i386__ - CHECK_1 ((struct user_fpregs_struct *) data); + (void) CHECK_1 ((struct user_fpregs_struct *) data); #else /* We don't know the size of data, so the best we can do is ensure that `data' is valid for at least one word. */ - CHECK_1 ((int *) data); + (void) CHECK_1 ((int *) data); #endif break; case PTRACE_GETFPXREGS: case PTRACE_SETFPXREGS: #ifdef __i386__ - CHECK_1 ((struct user_fpxregs_struct *) data); + (void) CHECK_1 ((struct user_fpxregs_struct *) data); #else /* We don't know the size of data, so the best we can do is ensure that `data' is valid for at least one word. */ - CHECK_1 ((int *) data); + (void) CHECK_1 ((int *) data); #endif break; }; Index: sysdeps/unix/sysv/linux/sysctl.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sysctl.c,v retrieving revision 1.5 diff -u -p -r1.5 sysctl.c --- sysctl.c 2000/07/07 02:19:05 1.5 +++ sysctl.c 2000/07/11 17:47:32 @@ -40,9 +40,9 @@ __sysctl (int *name, int nlen, void *old newval: newval, newlen: newlen }; - CHECK_N (name, nlen); - CHECK_N (oldval, *oldlenp); - CHECK_N (newval, newlen); + (void) CHECK_N (name, nlen); + (void) CHECK_N (oldval, *oldlenp); + (void) CHECK_N (newval, newlen); return INLINE_SYSCALL (_sysctl, 1, __ptrvalue (&args)); } From drepper@redhat.com Tue Jul 11 11:41:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 11 Jul 2000 11:41:00 -0000 Subject: PATCH: fix warnings for build-bounded References: <200007111759.KAA28687@kayak.mcgary.org> Message-ID: Greg McGary writes: > 2000-07-11 Greg McGary > > * include/libc-symbols.h [!__ASSEMBLER__] (strong_alias): Seems OK. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@lucon.org Tue Jul 11 12:03:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Tue, 11 Jul 2000 12:03:00 -0000 Subject: glibc-2.1.91: segfault problem overcome via kludge References: <200007030746.AAA03027@adam.yggdrasil.com> Message-ID: <20000711120324.B1573@lucon.org> On Mon, Jul 03, 2000 at 10:43:00AM +0200, Andreas Jaeger wrote: > >>>>> Adam J Richter writes: > > Adam, > > please send your comments to libc-alpha@sourceware.cygnus.com - I've > set a CC and Reply-To. The testers of 2.1.91 will most probably not > read your comments on bug-glibc. > > I have overcome the segfaulting problem that I reported > > earlier tonight by installing each of the .so files with convoluted > > shell command. > > > As far as I can tell, the problem was due an incompatibility > > between versions of at least one of the .so files that glibc comprises. > > The problem occured when the new ld-linux.so.2 and libc.so.6 have been > > installed, but the other .so files have not yet been installed. > Can you describe the problem better? What exactly is wrong? What > needs to be fixed in glibc? > What happened to this bug report? http://sources.redhat.com/ml/libc-alpha/2000-07/msg00048.html http://sources.redhat.com/ml/libc-alpha/2000-07/msg00047.html H.J. From drepper@redhat.com Tue Jul 11 12:08:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 11 Jul 2000 12:08:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <200007111851.LAA01068@kankakee.wrs.com> Message-ID: Mike Stump writes: > > This is my I'm currently favouring a standaline package. But there > > might be situation where a new libc might require a new version of > > the libgcc.so > > Isn't this as desirable as a new version of emacs requiring a new > version of libgcc.so? No. The libgcc.so is a system library and closely coupled with the libc. Since the interface of the libgcc.so has to be controlled very strictly this means that updating it will not break existing binaries, only new functionality (or bug fixes exposed by a glibc upgrade) might become necessary. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Tue Jul 11 12:21:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 11 Jul 2000 12:21:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <200007111910.UAA08798@phal.cygnus.co.uk> Message-ID: Joern Rennecke writes: > Actually, the same is true without shared libraries, if the users just > want to keep using old .o files (inside or outside of static libraries) > together with ones compiled with a new compiler. In an ideal world, yes, you would allow this. But in general this is nothing we can promise. Only the encapsulation inside a DSO can make binary compatibility with somewhat changing interfaces a reality. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Tue Jul 11 12:29:00 2000 From: greg@mcgary.org (Greg McGary) Date: Tue, 11 Jul 2000 12:29:00 -0000 Subject: PATCH: fix warnings for build-bounded References: <200007111759.KAA28687@kayak.mcgary.org> Message-ID: Ulrich Drepper writes: > Greg McGary writes: > > > 2000-07-11 Greg McGary > > > > * include/libc-symbols.h [!__ASSEMBLER__] (strong_alias): > > Seems OK. I just finished checking for regressions: * successfully made build-static & build-shared * no binary differences for non-BP. From drepper@redhat.com Tue Jul 11 12:38:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 11 Jul 2000 12:38:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <200007111912.UAA08810@phal.cygnus.co.uk> Message-ID: Joern Rennecke writes: > I think this is a non-issue. We can control the generation of libgcc.so > by a target macro, so only those targets that are ready to have it > (and where it makes sense to have it to start with) will have it. I was not talking about the first release. I was talking about the next one. Once you introduced the libgcc.so stuff you'll have to keep it up-to-date and test it. If something is not sufficiently tested or updated, the new version might still run fine and people will start using it, but you created a new ABI. From that point on you not only have the provide the ABI of the previous release, you also have to support the errorneously introduced new ABI since this is what will be expected. It would be really advised that before gcc people take up the task of maintaining ABIs they look into the problems this involves in other projects. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Tue Jul 11 12:40:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 11 Jul 2000 12:40:00 -0000 Subject: glibc-2.1.91: segfault problem overcome via kludge References: <200007030746.AAA03027@adam.yggdrasil.com> <20000711120324.B1573@lucon.org> Message-ID: "H . J . Lu" writes: > What happened to this bug report? > > http://sources.redhat.com/ml/libc-alpha/2000-07/msg00048.html > http://sources.redhat.com/ml/libc-alpha/2000-07/msg00047.html I have not yet looked into all these installation issues. If somebody can confirm that this patch is correct we can add it. Otherwise I will have to try it myself. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@lucon.org Tue Jul 11 13:26:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Tue, 11 Jul 2000 13:26:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <200007111912.UAA08810@phal.cygnus.co.uk> Message-ID: <20000711132617.A1914@lucon.org> On Tue, Jul 11, 2000 at 12:38:04PM -0700, Ulrich Drepper wrote: > > It would be really advised that before gcc people take up the task of > maintaining ABIs they look into the problems this involves in other > projects. > Please take Ulrich's word for it. He was speaking from his experiences maintaining the glibc runtime ABI in such a way that it will work with all the existing binaries. It is a very difficult task. I don't think gcc should take it before people know what is involved. H.J. From hjl@valinux.com Tue Jul 11 13:43:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Tue, 11 Jul 2000 13:43:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> Message-ID: <20000711134337.A16026@valinux.com> On Tue, Jul 11, 2000 at 05:33:05PM -0300, Alexandre Oliva wrote: > On Jul 11, 2000, Ulrich Drepper wrote: > > > Every application will be linked against this library and therefore it > > must be available on the root filesystem where there is certainly no > > room for gcc. > > Will this mean I won't ever be allowed to install another release of > GCC without rebuilding glibc? This is insane! No. That is why Ulrich suggested it be a standalone package. > > > In the end you might end up to have an individual configuration for > > each arch/OS/host/target combination. > > This is the only reasonable approach. Can you think for a second of > having the SONAMEs of libgcc.so managed by people other than the > maintainers of ports? They're the ones who can tell when > backward-compatibility is broken for a certain platform. People who define the ABI don't necessarily to have to define the SONAME or maintain the shared library. You can not just simply break the backward-compatibility for libgcc.so since it will be a system library. It has to be controlled by the system. > > > I don't know how to make this clearer, libgcc.so is a system library. > > Is this just because glibc gets symbols from it? Yes. > > AFAIK, the main problem is with changing exception-handling > interfaces. Does glibc actually use these functions? Couldn't we glibc wants to use it in the future. > just arrange for glibc to not be linked with the exception-handling > part of libgcc, since any program that uses them would be linked with > libgcc anyway? No. > > Another option: couldn't libgcc's object files just be folded into > libc.so, without creating the hassle of yet another system library? That is what we do today and it doesn't work very well. If you don't know why, ...... > > > Besides, I have not heard a single convincing argument why libgcc.so > > should be generate as part of gcc. What do you want to achieve? > > We want to solve the very same problem you're trying to solve, but not > with a we-only-care-about-GNU/Linux-issues point of view. > As far as I know, only systems, where the shared C library uses gcc's frame based exception, has this problem. Could you please name the other systems? -- H.J. Lu (hjl@gnu.org) From hjl@valinux.com Tue Jul 11 14:37:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Tue, 11 Jul 2000 14:37:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <200007112126.XAA01019@loewis.home.cs.tu-berlin.de> Message-ID: <20000711143625.A16165@valinux.com> On Tue, Jul 11, 2000 at 11:26:57PM +0200, Martin v. Loewis wrote: > > > Besides, I have not heard a single convincing argument why libgcc.so > > should be generate as part of gcc. What do you want to achieve? > > It is likely that gcc maintainers will add functions to libgcc as they > please, and that the code generated by gcc will rely on these > functions being inside libgcc. So how should gcc proceed on a system > where these new functions are not present in the system libgcc? > It has happened: http://gcc.gnu.org/ml/gcc-bugs/2000-07/msg00018.html That is why we discuss libgcc.so here. -- H.J. Lu (hjl@gnu.org) From hjl@valinux.com Tue Jul 11 15:02:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Tue, 11 Jul 2000 15:02:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <20000711134337.A16026@valinux.com> Message-ID: <20000711150216.A16199@valinux.com> On Tue, Jul 11, 2000 at 06:53:07PM -0300, Alexandre Oliva wrote: > > >> Another option: couldn't libgcc's object files just be folded into > >> libc.so, without creating the hassle of yet another system library? > > > That is what we do today and it doesn't work very well. If you don't > > know why, ...... > > > Another possibility is that the EH-region data structures generated by > the compiler may change. In this case, the functions that manage > registering and de-registering of EH regions might not understand the > data they're given. The only way I see to solve this problem is to Right on. > rename the functions every time the data structures change, and > implement backward-compatibility replacement functions that convert > the data from the old format to the new one, then call the new > functions. That is how it may be done in libgcc.so. But you cannot do it when they are included in libc.so unless you rebuild libc.so. The idea is we can easily rebuild libgcc.so without rebuilding libc.so. > > > As far as I know, only systems, where the shared C library uses > > gcc's frame based exception, has this problem. Could you please > > name the other systems? > > I doubt that's the case. Any system that uses shared libraries should > be subject to the same problems, in case different modules are > compiled with incompatible versions of GCC. But this probably occurs That is partially solved by my "library interface" scheme in gcc. On any other system, you may change libstdc++ API and C++ ABI without breaking the existing binaries. BTW, my scheme doesn't work with libstdc++-v3 which uses libtool. It should be fixed. > more often on GNU/Linux precisely because libc isn't always compiled > by the compiler someone who installed their own version of GCC uses. > The Linux C library is the only C library I know to use the frame based exception in gcc. -- H.J. Lu (hjl@gnu.org) From drepper@redhat.com Tue Jul 11 15:10:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 11 Jul 2000 15:10:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <200007112126.XAA01019@loewis.home.cs.tu-berlin.de> Message-ID: "Martin v. Loewis" writes: > If you think you (as the glibc group, or as the Ulrich Drepper > individual) can maintain this over the years to come - why don't you > just go ahead and do it? I've never said I want to do this. I have enough to do. > It is likely that gcc maintainers will add functions to libgcc as they > please, and that the code generated by gcc will rely on these > functions being inside libgcc. So how should gcc proceed on a system > where these new functions are not present in the system libgcc? The libgcc ABI cannot simply be changed without good reason and preparation. This should be clear meanwhile. There must be much finer coordination. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@valinux.com Tue Jul 11 15:33:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Tue, 11 Jul 2000 15:33:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <20000711134337.A16026@valinux.com> <20000711150216.A16199@valinux.com> Message-ID: <20000711153338.A16252@valinux.com> On Tue, Jul 11, 2000 at 07:22:52PM -0300, Alexandre Oliva wrote: > I see. > > Are you aware that GCC is moving towards creating a shared libgcc? > > Why, then, should glibc people take over the creation of this shared > library for GNU/Linux systems? The GCC maintainers are going to have > to face this problem themselves, probably in a far more complicated > way since we don't care just about GNU/Linux. The problem is we, Ulrich and I, don't believe gcc will do it right for Linux in time. Very few people have the experiences of maintaining a shared libary which is kept binary compatible with binaries compiled years ago. > > On any other system, you may change libstdc++ API and C++ ABI without > > breaking the existing binaries. > > What about rebuilding C++ shared libraries with an ABI-incompatible > GCC? Do you claim this works on all platforms other than GNU/Linux? My scheme should work since it encodes the C library API, the libstdc++ API and the C++ compiler ABI in the soname of libstdc++.so. > I find it hard to believe. Try it. > > >> more often on GNU/Linux precisely because libc isn't always compiled > >> by the compiler someone who installed their own version of GCC uses. > > > The Linux C library is the only C library I know to use the frame based > > exception in gcc. > > What I mean is that the problem occurs more often on GNU/Linux because > libc also carries the symbols GCC EH depends upon. However, I believe > it should affect any other system when you link together shared > libraries created with ABI-incompatible versions of GCC. > It is only a problem for Linux because it happens to libc.so. If it is something else, we can deal with it some other easy way. -- H.J. Lu (hjl@gnu.org) From hjl@valinux.com Tue Jul 11 16:04:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Tue, 11 Jul 2000 16:04:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <20000711134337.A16026@valinux.com> <20000711150216.A16199@valinux.com> <20000711153338.A16252@valinux.com> Message-ID: <20000711160418.A16289@valinux.com> On Tue, Jul 11, 2000 at 07:47:41PM -0300, Alexandre Oliva wrote: > On Jul 11, 2000, "H . J . Lu" wrote: > > > The problem is we, Ulrich and I, don't believe gcc will do it right > > for Linux in time. > > Please post your patches, even if they initially only work on > GNU/Linux. Since we already have the encoding of ABI in the libstdc++ > SONAME only on GNU/Linux, we can probably start by building libgcc.so > only on GNU/Linux too. > I will do it as soon as I find some time. > > >> What about rebuilding C++ shared libraries with an ABI-incompatible > >> GCC? Do you claim this works on all platforms other than GNU/Linux? > > > My scheme should work since it encodes the C library API, the libstdc++ > > API and the C++ compiler ABI in the soname of libstdc++.so. > > It is my understanding that the encoding of the C library API is only > done on GNU/Linux. I'm talking about other platforms. > The maintainers of those platforms have to do it. -- H.J. Lu (hjl@gnu.org) From kettenis@wins.uva.nl Tue Jul 11 16:08:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 11 Jul 2000 16:08:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <20000711100049.A15651@valinux.com> <200007111736.e6BHabh26848@delius.kettenis.local> <20000711104028.A15772@valinux.com> <20000711151224.B4542@cygnus.com> Message-ID: <200007112307.e6BN7l128012@delius.kettenis.local> Date: Tue, 11 Jul 2000 15:12:24 -0700 From: Richard Henderson On Tue, Jul 11, 2000 at 10:40:28AM -0700, H . J . Lu wrote: > > The fact that the Linux libc contains and reexports the frame info > > registration functions make things a little more complicated, and > > I believe it is the cause of the problem. Otherwise, it will be > libstdc++.so who contains and reexports the frame info registration > functions, which is the part of gcc and handled by my "library > interface" scheme. It is an entirely different issuse. Not at all. It's exactly the same issue, with just the names changed. Indeed. Moreover, HJ's scheme doesn't even solve the problem of rexporting the frame info registration info. It may seem like it does, but that's only because the C++ ABI changed more frequently than the frame info registration. The only thing HJ's scheme *does* "solve" is dealing with the libio changes made between glibc 2.0 and glibc 2.1, that quite deliberately ignored the consequences for C++ (since the C++ ABI was in flux anyway at that time). It's incredibly ugly, and I hope it can be phased out in with Ggcc 3.0 r~ From drepper@redhat.com Tue Jul 11 16:20:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 11 Jul 2000 16:20:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <7130.963356511@upchuck> Message-ID: Jeffrey A Law writes: > Precisely. There's at least two (HP & DEC/Compaq) that have non-linux, > non-ELF systems which suffer from precisely the same core problems. But they almost certainly need different solutions. Anyway, this all is really becoming silly. I've never said that I wanted to write or maintain such a library. I just don't believe that the gcc people are able to maintain such a delicate interface for so many platforms in a timely fashion given that you will also get requests from the individual system library maintainers which have to be taken into account. You should stop making any incompatible changes before you can show a solution for the problem. Failing to do so, and the current situation is already in the state, means that nobody can really use the current compiler anymore since newly compiled binaries will crash. I suggest to revert any such change and start working on the solution of the interface problem. Then we will see whether you can stand behind your words. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Tue Jul 11 16:30:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 11 Jul 2000 16:30:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <7153.963356866@upchuck> Message-ID: Jeffrey A Law writes: > Not necessarily. One could certainly argue that if it's on the root > filesystem that it ought to be linked statically. Jeff, don't be ridiculous. First, you should look at the reality. Second, you are not the one who decides about this. This is what I meant by taking input from the maintainers of all the different systems you are targetting: they are setting the ground rules. Now you can (hopefully) see what I meant when I said you completely underestimate the work. You'll have to please dozends of different system implementors with your grand unified scheme. I personally don't care a bit about all these issues. I have no problem with recompiling my whole system since I use almost no program where this is not possible and for the few I cannot recompile I can find a way around this problem. But you can be sure you'll have a few million other people on your rear end if you screw this up. And not coming up with a solution soon will certainly be in this category. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kettenis@wins.uva.nl Tue Jul 11 16:37:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 11 Jul 2000 16:37:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <20000711134337.A16026@valinux.com> <20000711150216.A16199@valinux.com> Message-ID: <200007112337.e6BNbLX29646@delius.kettenis.local> Date: Tue, 11 Jul 2000 15:02:16 -0700 From: "H . J . Lu" > more often on GNU/Linux precisely because libc isn't always compiled > by the compiler someone who installed their own version of GCC uses. > The Linux C library is the only C library I know to use the frame based exception in gcc. Ehm, it's the GNU C Library (glibc for short) and it's also use on the Hurd (i386-unknown-gnu0.2) where we also include the same frame info. (Sorry, I couldn't resist) Mark From kettenis@wins.uva.nl Tue Jul 11 16:59:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 11 Jul 2000 16:59:00 -0000 Subject: What to put in a shared libgcc References: <7226.963357155@upchuck> Message-ID: <200007112358.e6BNwfL30003@delius.kettenis.local> Date: Tue, 11 Jul 2000 17:12:35 -0600 From: Jeffrey A Law In message < 200007111759.e6BHxfp26885@delius.kettenis.local >you write: > [Sorry folks, tried to send this to gcc@gnu.org instead of > gcc@gcc.gnu.org :-(] > > Here's an analysis of the modules in libgcc.a for GCC 2.95.2 on > i586-pc-linux-gnu. Feel free to put this up on the gcc web pages if > you like (linked to the libgcc.so discussion page or so). > > Based on this analysis, I think the only stuff that should be moved > into a shared libgcc on Linux/x86 is the frame registration stuff > (frame.o) and probably parts of the language-independent exception > handling stuff (libgcc.2[L_eh], i.e. the stuff that ends up in _eh.o). Actually, I *strongly* disagree with any notion that the contents of the two libraries should be different. Every major unix vendor has done this at some point in the last 10 years, and every time it's caused problems. Please, let's not make the same mistakes everyone else did, instead let's learn from them. The interfaces provided by the libraries need to be identical, anything else just makes life a living hell for application developers as well as tool developers. We've been doing it with glibc quite successfully. A typical Linux installation has /usr/lib/libc.a /usr/lib/libc_nonshared.a /usr/lib/libc.so /lib/libc.so.6 where /usr/lib/libc.so is the following linker script: /* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a ) It works quite well (although from time to time someone manages to replace the libc.so linker scrypt with a symlink to /lib/libc.so, usually with the help of an old version of that braindamaged tool called ldconfig). Of course not all linkers support this nifty trick, and we can't force evrybody to use GNU ld :-(. Now I am open to the idea that there's libgcc.{a,so} that has some set of routines and some other library that has additional routines. However, you have to be very careful about the things you do not include in libgcc -- for example the EH routines, which are the root of most of our recent problems. I'm not sure I understand what you're saying here. Do you mean libgcc.a or libgcc.so (or whatever it's called). I'd say that you should be very careful about what you *do* put in a shared library. There are parts in the current libgcc.a for which it would be very unwise to put them into the shared libgcc.so. If you want the contents of every lib*.so paralleled by a lib*.a, this would imply that you'd put all functions that don't go into libgcc.so will be moved to libgcc2.a (or whetever it'll be called). We can't do self-contained libraries that include copies of those routines, it simply doesn't work. Instead we need libraries which reference libgcc.so (or whatever it's called) to get those routines. Indeed. The EH stuff is the minimal stuff that should go into the shared library we're talking about in these discussions here. Mark From hjl@valinux.com Tue Jul 11 17:05:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Tue, 11 Jul 2000 17:05:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <20000711100049.A15651@valinux.com> <200007111736.e6BHabh26848@delius.kettenis.local> <20000711104028.A15772@valinux.com> <20000711151224.B4542@cygnus.com> <200007112307.e6BN7l128012@delius.kettenis.local> Message-ID: <20000711170535.A16362@valinux.com> On Wed, Jul 12, 2000 at 01:07:47AM +0200, Mark Kettenis wrote: > > I believe it is the cause of the problem. Otherwise, it will be > > libstdc++.so who contains and reexports the frame info registration > > functions, which is the part of gcc and handled by my "library > > interface" scheme. It is an entirely different issuse. > > Not at all. It's exactly the same issue, with just the names changed. > > Indeed. Moreover, HJ's scheme doesn't even solve the problem of > rexporting the frame info registration info. It may seem like it > does, but that's only because the C++ ABI changed more frequently than > the frame info registration. > > The only thing HJ's scheme *does* "solve" is dealing with the libio > changes made between glibc 2.0 and glibc 2.1, that quite deliberately > ignored the consequences for C++ (since the C++ ABI was in flux anyway > at that time). It's incredibly ugly, and I hope it can be phased out > in with Ggcc 3.0 > You really haven't seen my scheme in action. Check out the current RedHat rawhide. They have 2 C++ compilers. egcs 1.1.2 is used to compile KDE. # ls /usr/lib/libstdc++* /usr/lib/libstdc++-2-libc6.1-1-2.9.0.so /usr/lib/libstdc++-libc6.2-2.a.3 /usr/lib/libstdc++-2-libc6.2-1-2.9.0.a /usr/lib/libstdc++-libc6.2-2.so.3 /usr/lib/libstdc++-2-libc6.2-1-2.9.0.so /usr/lib/libstdc++.so.2.7.2 /usr/lib/libstdc++-3-libc6.2-2-2.10.0.a /usr/lib/libstdc++.so.2.7.2.8 /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so /usr/lib/libstdc++.so.2.8 /usr/lib/libstdc++-libc6.1-1.so.2 /usr/lib/libstdc++.so.2.8.0 /usr/lib/libstdc++-libc6.2-1.a.2 /usr/lib/libstdc++.so.2.9 /usr/lib/libstdc++-libc6.2-1.so.2 /usr/lib/libstdc++.so.2.9.dummy # rpm -qf /usr/lib/libstdc++-2-libc6.2-1-2.9.0.so kernelcc-c++-1.1.2-4 # rpm -qf /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so libstdc++-2.96-33 -- H.J. Lu (hjl@gnu.org) From kettenis@wins.uva.nl Tue Jul 11 17:55:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 11 Jul 2000 17:55:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <20000711100049.A15651@valinux.com> <200007111736.e6BHabh26848@delius.kettenis.local> <20000711104028.A15772@valinux.com> <20000711151224.B4542@cygnus.com> <200007112307.e6BN7l128012@delius.kettenis.local> <20000711170535.A16362@valinux.com> Message-ID: <200007120055.e6C0tCR30169@delius.kettenis.local> Date: Tue, 11 Jul 2000 17:05:35 -0700 From: "H . J . Lu" You really haven't seen my scheme in action. Check out the current RedHat rawhide. They have 2 C++ compilers. egcs 1.1.2 is used to compile KDE. # ls /usr/lib/libstdc++* /usr/lib/libstdc++-2-libc6.1-1-2.9.0.so /usr/lib/libstdc++-libc6.2-2.a.3 /usr/lib/libstdc++-2-libc6.2-1-2.9.0.a /usr/lib/libstdc++-libc6.2-2.so.3 /usr/lib/libstdc++-2-libc6.2-1-2.9.0.so /usr/lib/libstdc++.so.2.7.2 /usr/lib/libstdc++-3-libc6.2-2-2.10.0.a /usr/lib/libstdc++.so.2.7.2.8 /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so /usr/lib/libstdc++.so.2.8 /usr/lib/libstdc++-libc6.1-1.so.2 /usr/lib/libstdc++.so.2.8.0 /usr/lib/libstdc++-libc6.2-1.a.2 /usr/lib/libstdc++.so.2.9 /usr/lib/libstdc++-libc6.2-1.so.2 /usr/lib/libstdc++.so.2.9.dummy # rpm -qf /usr/lib/libstdc++-2-libc6.2-1-2.9.0.so kernelcc-c++-1.1.2-4 # rpm -qf /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so libstdc++-2.96-33 And you honestly believe this is a good thing? It illustrates that the libstdc++ are failing to properly version their library (which is somewhat understandable since they've punted binary compatibility for C++ until GCC 3.0). And by giving them your "interface scheme" you've provided them with the means to get away with it. Just slap a different soname on every permutation of things and you're not very likely to get complaints about binary incompatibilities. You see that you have both: libstdc++-2-libc6.1-1-2.9.0.so and: libstdc++-2-libc6.2-1-2.9.0.so I think those should be binary compatible (assuming this is a system where glibc 2.2 is the installed system C library). Mark From hjl@lucon.org Tue Jul 11 18:07:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Tue, 11 Jul 2000 18:07:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <20000711134337.A16026@valinux.com> <20000711150216.A16199@valinux.com> <200007112337.e6BNbLX29646@delius.kettenis.local> Message-ID: <20000711180727.A2866@lucon.org> On Wed, Jul 12, 2000 at 01:37:21AM +0200, Mark Kettenis wrote: > Date: Tue, 11 Jul 2000 15:02:16 -0700 > From: "H . J . Lu" > > > more often on GNU/Linux precisely because libc isn't always compiled > > by the compiler someone who installed their own version of GCC uses. > > > > The Linux C library is the only C library I know to use the frame based > exception in gcc. > > Ehm, it's the GNU C Library (glibc for short) and it's also use on the > Hurd (i386-unknown-gnu0.2) where we also include the same frame info. > Ooops. Sorry for omission :-). H.J. From hjl@lucon.org Tue Jul 11 20:33:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Tue, 11 Jul 2000 20:33:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <20000711100049.A15651@valinux.com> <200007111736.e6BHabh26848@delius.kettenis.local> <20000711104028.A15772@valinux.com> <20000711151224.B4542@cygnus.com> <200007112307.e6BN7l128012@delius.kettenis.local> <20000711170535.A16362@valinux.com> <200007120055.e6C0tCR30169@delius.kettenis.local> Message-ID: <20000711203323.A3227@lucon.org> On Wed, Jul 12, 2000 at 02:55:12AM +0200, Mark Kettenis wrote: > Date: Tue, 11 Jul 2000 17:05:35 -0700 > From: "H . J . Lu" > > You really haven't seen my scheme in action. Check out the current > RedHat rawhide. They have 2 C++ compilers. egcs 1.1.2 is used to > compile KDE. > > # ls /usr/lib/libstdc++* > /usr/lib/libstdc++-2-libc6.1-1-2.9.0.so /usr/lib/libstdc++-libc6.2-2.a.3 > /usr/lib/libstdc++-2-libc6.2-1-2.9.0.a /usr/lib/libstdc++-libc6.2-2.so.3 > /usr/lib/libstdc++-2-libc6.2-1-2.9.0.so /usr/lib/libstdc++.so.2.7.2 > /usr/lib/libstdc++-3-libc6.2-2-2.10.0.a /usr/lib/libstdc++.so.2.7.2.8 > /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so /usr/lib/libstdc++.so.2.8 > /usr/lib/libstdc++-libc6.1-1.so.2 /usr/lib/libstdc++.so.2.8.0 > /usr/lib/libstdc++-libc6.2-1.a.2 /usr/lib/libstdc++.so.2.9 > /usr/lib/libstdc++-libc6.2-1.so.2 /usr/lib/libstdc++.so.2.9.dummy > # rpm -qf /usr/lib/libstdc++-2-libc6.2-1-2.9.0.so > kernelcc-c++-1.1.2-4 > # rpm -qf /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so > libstdc++-2.96-33 > > And you honestly believe this is a good thing? It illustrates that I believe it is a working solution. It is far from perfect. But it is better than nothing. If you don't like mine, I'd like to hear yours. It'd better be working TODAY. > the libstdc++ are failing to properly version their library (which is > somewhat understandable since they've punted binary compatibility for > C++ until GCC 3.0). And by giving them your "interface scheme" you've Do you think why they can punt binary compatibility? Why haven't Linux users complained very loudly? > provided them with the means to get away with it. Just slap a > different soname on every permutation of things and you're not very > likely to get complaints about binary incompatibilities. Do you have any suggestions? Don't tell me GCC 3.0 will solve everything. Red Hat already uses gcc 2.96 in rawhide. One of the reasons I believe is gcc 2.95 and egcs 1.1.2 won't compile glibc 2.2. I hope they won't use gcc 2.96 in the public release. > > You see that you have both: libstdc++-2-libc6.1-1-2.9.0.so > and: libstdc++-2-libc6.2-1-2.9.0.so > > I think those should be binary compatible (assuming this is a system > where glibc 2.2 is the installed system C library). I don't know for sure. I believe they aren't C++ binary compatible. H.J. From hjl@valinux.com Tue Jul 11 21:49:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Tue, 11 Jul 2000 21:49:00 -0000 Subject: A sample implemenation (Re: My proposal for the libgcc runtime ABI) References: <5003.963333245@upchuck> <20000711134337.A16026@valinux.com> <20000711150216.A16199@valinux.com> <20000711153338.A16252@valinux.com> Message-ID: <20000711214907.A17048@valinux.com> On Tue, Jul 11, 2000 at 07:47:41PM -0300, Alexandre Oliva wrote: > On Jul 11, 2000, "H . J . Lu" wrote: > > > The problem is we, Ulrich and I, don't believe gcc will do it right > > for Linux in time. > > Please post your patches, even if they initially only work on > GNU/Linux. Since we already have the encoding of ABI in the libstdc++ > SONAME only on GNU/Linux, we can probably start by building libgcc.so > only on GNU/Linux too. > This is not a real patch. It just shows how it can done under Linux. You will need http://gcc.gnu.org/ml/gcc-bugs/2000-07/msg00117.html for . When it is used with glibc build, we can use ..../libgcc/libgcc.so `$(CC) -print-libgcc-file-name` or ..../libgcc/libgcc.so -lgcc instead of just -lgcc. H.J. ---- #!/bin/sh # This is a shell archive (produced by GNU sharutils 4.2.1). # To extract the files from this archive, save it to some FILE, remove # everything before the `!/bin/sh' line above, then type `sh FILE'. # # Made on 2000-07-11 21:42 PDT by . # Source directory was `/work/gnu/src/libgcc'. # # Existing files will *not* be overwritten unless `-c' is specified. # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 1081 -rw-r--r-- Makefile # 297 -rw-r--r-- dummy.c # save_IFS="${IFS}" IFS="${IFS}:" gettext_dir=FAILED locale_dir=FAILED first_param="$1" for dir in $PATH do if test "$gettext_dir" = FAILED && test -f $dir/gettext \ && ($dir/gettext --version >/dev/null 2>&1) then set `$dir/gettext --version 2>&1` if test "$3" = GNU then gettext_dir=$dir fi fi if test "$locale_dir" = FAILED && test -f $dir/shar \ && ($dir/shar --print-text-domain-dir >/dev/null 2>&1) then locale_dir=`$dir/shar --print-text-domain-dir` fi done IFS="$save_IFS" if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED then echo=echo else TEXTDOMAINDIR=$locale_dir export TEXTDOMAINDIR TEXTDOMAIN=sharutils export TEXTDOMAIN echo="$gettext_dir/gettext -s" fi if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"' elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"' elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then shar_touch='touch -am $3$4$5$6$2 "$8"' else shar_touch=: echo $echo 'WARNING: not restoring timestamps. Consider getting and' $echo "installing GNU \`touch', distributed in GNU File Utilities..." echo fi rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch # if mkdir _sh17043; then $echo 'x -' 'creating lock directory' else $echo 'failed to create lock directory' exit 1 fi # ============= Makefile ============== if test -f 'Makefile' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'Makefile' '(file already exists)' else $echo 'x -' extracting 'Makefile' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'Makefile' && LD=ld CC=/opt/gcc-3.0/bin/gcc X LN_S=ln -s X INSTALL_PROGRAM=install -c X slibdir=/lib X inst_slibdir=$(install_root)$(slibdir) X libgcc-a=$(shell $(CC) -print-libgcc-file-name) libgcc-so=$(shell $(CC) -print-libgcc-file-name | sed -e 's/a$$/so/') X soname=libgcc.so.3 libgcc=libgcc-$(shell $(CC) -dumpversion).so X libgcc.so: dummy.o $(libgcc-a) X $(LD) -shared -soname $(soname) -o $@ $^ X dummy.o: dummy.c X $(CC) -fPIC -O -c $< X install: $(install_root)$(libgcc-so) $(inst_slibdir)/$(soname) X $(inst_slibdir)/$(libgcc): $(libgcc) X mkdir -p $(@D) X rm -f $@.new X $(INSTALL_PROGRAM) $< $@.new X mv $@.new $@ X $(inst_slibdir)/$(soname): $(inst_slibdir)/$(libgcc) X mkdir -p $(@D) X rm -f $@.new X $(LN_S) $< $@.new X mv $@.new $@ X $(install_root)$(libgcc-so): libgcc.so $(libgcc-a) X mkdir -p $(@D) X (echo '/* GNU ld script';\ X echo ' Use the shared library, but some functions are only in';\ X echo ' the static library, so try that secondarily. */';\ X echo 'GROUP ( $(slibdir)/$(soname)' \ X '$(libgcc-a))' \ X ) > $@.new X mv -f $@.new $@ X clean: X rm -f dummy.o $(soname) libgcc.so SHAR_EOF (set 20 00 07 11 21 39 24 'Makefile'; eval "$shar_touch") && chmod 0644 'Makefile' || $echo 'restore of' 'Makefile' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'Makefile:' 'MD5 check failed' 7da3126882752574533e8b1919cdc416 Makefile SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'Makefile'`" test 1081 -eq "$shar_count" || $echo 'Makefile:' 'original size' '1081,' 'current size' "$shar_count!" fi fi # ============= dummy.c ============== if test -f 'dummy.c' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'dummy.c' '(file already exists)' else $echo 'x -' extracting 'dummy.c' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'dummy.c' && #include X static const void *dummy [] = { X (const void *) __register_frame, X (const void *) __register_frame_table, X (const void *) __deregister_frame, X (const void *) __register_frame_info, X (const void *) __register_frame_info_table, X (const void *) __deregister_frame_info }; SHAR_EOF (set 20 00 07 11 21 01 25 'dummy.c'; eval "$shar_touch") && chmod 0644 'dummy.c' || $echo 'restore of' 'dummy.c' 'failed' if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then md5sum -c << SHAR_EOF >/dev/null 2>&1 \ || $echo 'dummy.c:' 'MD5 check failed' a6d5eb1b19ef9afbc7a2b96e151ef6ae dummy.c SHAR_EOF else shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'dummy.c'`" test 297 -eq "$shar_count" || $echo 'dummy.c:' 'original size' '297,' 'current size' "$shar_count!" fi fi rm -fr _sh17043 exit 0 From kettenis@wins.uva.nl Tue Jul 11 23:38:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 11 Jul 2000 23:38:00 -0000 Subject: Bug in getent program Message-ID: <200007120638.e6C6cRN18814@delius.kettenis.local> There is a small bug in the getent program distributed with glibc. Right now $ getent services 25/tcp doesn't give you anything, while $ getent services 6400/tcp (that's 25 in network byte order) gives you something like smtp 25/tcp Here's a fix. Mark 2000-07-12 Mark Kettenis * nss/getent.c (services_keys): Pass port number in network byte order in call to getservbyport. Index: nss/getent.c =================================================================== RCS file: /cvs/glibc/libc/nss/getent.c,v retrieving revision 1.3 diff -u -p -r1.3 getent.c --- nss/getent.c 2000/01/12 10:27:23 1.3 +++ nss/getent.c 2000/07/12 06:37:58 @@ -366,7 +366,7 @@ services_keys (int number, char *key[]) *proto++ = '\0'; if (isdigit (key[i][0])) - serv = getservbyport (atol (key[i]), proto); + serv = getservbyport (htons (atol (key[i])), proto); else serv = getservbyname (key[i], proto); From aj@suse.de Wed Jul 12 00:22:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Wed, 12 Jul 2000 00:22:00 -0000 Subject: ldconfig problems References: <200007092109.RAA06606@neuralgia.linnaean.org> <200007100930.LAA12011@hawking.suse.de> Message-ID: >>>>> Ulrich Drepper writes: Uli> Andreas Jaeger writes: >> Here's an updated patch. Is this one ok? Uli> It works to the extend you planned it to. Uli> How I understood Roland (and how I would do this) is a bit different. Uli> I would have the prefix (either compiled in or passed on the ldconfig Uli> command line) determine which directories to search in a way similar Uli> to chroot(). I.e., no directory below the prefix directory or in a ldconfig has already a chroot option - but does a complete chroot here. -r ROOT Change to and use ROOT as root directory Uli> different tree is ever used. Example: Uli> - I'm installing in /test. This means the sysconfig dir is /test/etc, Uli> the libraries are in /test/lib etc Uli> - ldconfig would search for DSOs in /test/lib and perhaps /test/usr/lib Uli> (unless overwritten by a ld.so.conf file) Uli> - ldconfig will never look into /lib, /usr/lib etc unless told so You're right, my patch doesn't handle the libraries correctly. I'll change this - but that should be all. Have a look at the appended patch. Uli> This has the advantage that you can have a completely isolated testing Uli> arena without fearing to pickup old DSOs. If this is wanted, ldconfig Uli> can be told to look into the regular directories. I do have a problem with the location of the configuration (ld.so.conf) and the cache file (ld.so.cache). If the user specifies configure with --sysconfdir=/etc --prefix=/test, we can't use prefix for the sysconfig dir. Therefore I think my solution is ok. I've just tested the patch in a build with --prefix=/usr/src/test/glibc-2.2 and only files in that directory have been used. Is this version ok now? Andreas 2000-07-12 Andreas Jaeger * elf/Makefile (SYSCONF-FLAGS): Added to pass sysconfdir to compiler. (CFLAGS-cache.c): Added, uses SYSCONF-FLAGS. (CFLAGS-dl-cache.c): Likewise. (CFLAGS-ldconfig.c): Added, passes directory locations. * sysdeps/generic/dl-cache.h (LD_SO_CACHE): Use SYSCONFDIR to locate cache. * elf/ldconfig.c (LD_SO_CONF): Likewise. (main): Use configured LIBDIR and SLIBDIR. ============================================================ Index: elf/Makefile --- elf/Makefile 2000/07/01 15:36:11 1.156 +++ elf/Makefile 2000/07/12 07:15:15 @@ -215,6 +215,10 @@ $(objpfx)sprof: $(libdl) $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) +SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' +CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' -D'SLIBDIR="$(slibdir)"' +CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) +CFLAGS-cache.c = $(SYSCONF-FLAGS) test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names)))) generated += $(addsuffix .so,$(strip $(modules-names))) ============================================================ Index: elf/ldconfig.c --- elf/ldconfig.c 2000/05/10 09:14:27 1.4 +++ elf/ldconfig.c 2000/07/12 07:15:16 @@ -41,7 +41,7 @@ #include "dl-procinfo.h" #ifndef LD_SO_CONF -# define LD_SO_CONF "/etc/ld.so.conf" +# define LD_SO_CONF SYSCONFDIR "/ld.so.conf" #endif /* Get libc version number. */ @@ -152,7 +152,7 @@ is_hwcap (const char *name) { int hwcap_idx = _dl_string_hwcap (name); - + if (hwcap_idx != -1 && ((1 << hwcap_idx) & HWCAP_IMPORTANT)) return 1; return 0; @@ -802,8 +802,9 @@ if (!opt_only_cline) { /* Always add the standard search paths. */ - add_dir ("/lib"); - add_dir ("/usr/lib"); + add_dir (SLIBDIR); + if (strcmp (SLIBDIR, LIBDIR)) + add_dir (LIBDIR); parse_conf (config_file); } ============================================================ Index: sysdeps/generic/dl-cache.h --- sysdeps/generic/dl-cache.h 2000/05/17 11:04:01 1.3 +++ sysdeps/generic/dl-cache.h 2000/07/12 07:15:16 @@ -27,7 +27,7 @@ #endif #ifndef LD_SO_CACHE -# define LD_SO_CACHE "/etc/ld.so.cache" +# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache" #endif #define CACHEMAGIC "ld.so-1.7.0" -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From hjl@lucon.org Wed Jul 12 08:16:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Wed, 12 Jul 2000 08:16:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <200007112126.XAA01019@loewis.home.cs.tu-berlin.de> <200007120600.IAA00978@loewis.home.cs.tu-berlin.de> Message-ID: <20000712081611.D4653@lucon.org> On Wed, Jul 12, 2000 at 08:00:05AM +0200, Martin v. Loewis wrote: > > The libgcc ABI cannot simply be changed without good reason and > > preparation. This should be clear meanwhile. There must be much > > finer coordination. > > But given good reason and preparation, how could gcc then make use of > the added features, if libgcc.so is a third-party product? gcc has to well document the added ABI functions. It will be added to the target specific libgcc.so package after testing which is specific to each individual target. Some may choose to drop backward compatibilty and some may want to keep it. Some may come back to gcc and say that the changes are not acceptable unless such such modifications are made. It is very tricky stuff specific to each individual target system software. I don't believe gcc has the sources to do it right on all targets. IMHO, delegating it to each target is the only sane way to go. H.J. From hjl@lucon.org Wed Jul 12 08:19:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Wed, 12 Jul 2000 08:19:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <200007112126.XAA01019@loewis.home.cs.tu-berlin.de> <200007120601.IAA00981@loewis.home.cs.tu-berlin.de> Message-ID: <20000712081920.E4653@lucon.org> On Wed, Jul 12, 2000 at 08:01:14AM +0200, Martin v. Loewis wrote: > > > If you think you (as the glibc group, or as the Ulrich Drepper > > > individual) can maintain this over the years to come - why don't you > > > just go ahead and do it? > > > > I've never said I want to do this. I have enough to do. > > Are we having a theoretical discussion, then? Who is volunteering the > maintain this package over the years to come? > Can you tell me who are going to maintain Linux for years to come? We, VA Linux, have sold so many Linux machines. What do we do? The answer is you don't have to worry about it. Someone will maintain it, one way or the other, just like gcc, kernel, X11, glibc, binutils, ...... libgcc.so is no different. H.J. From greg@mcgary.org Wed Jul 12 09:39:00 2000 From: greg@mcgary.org (Greg McGary) Date: Wed, 12 Jul 2000 09:39:00 -0000 Subject: PATCH: random applications of BP_SYM Message-ID: <200007121639.JAA26376@kayak.mcgary.org> These are for completeness, and because someday BP libs might be shared, and they might be ported back to earlier glibc. (I don't want to do it, you don't want to do it, but never say never! 8^) Anyway, the changes are harmless. No build regressions or binary differences for ix86 & PPC build-shared & build-static. 2000-07-12 Greg McGary * sysdeps/generic/open64.c: Wrap extern symbols in BP_SYM (). * sysdeps/posix/open64.c: Likewise. * sysdeps/generic/fegetenv.c: Likewise. * sysdeps/powerpc/fpu/fegetenv.c: Likewise. * sysdeps/powerpc/fpu/fesetenv.c: Likewise. * sysdeps/powerpc/fpu/feupdateenv.c: Likewise. * sysdeps/powerpc/fpu/fgetexcptflg.c: Likewise. * sysdeps/powerpc/fpu/fraiseexcpt.c: Likewise. * sysdeps/powerpc/fpu/fsetexcptflg.c: Likewise. Index: sysdeps/generic/fegetenv.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/generic/fegetenv.c,v retrieving revision 1.4 diff -u -p -r1.4 fegetenv.c --- fegetenv.c 2000/04/04 06:03:27 1.4 +++ fegetenv.c 2000/07/11 19:55:07 @@ -20,6 +20,7 @@ #include #include +#include int fegetenv (fenv_t *envp) @@ -29,9 +30,9 @@ fegetenv (fenv_t *envp) } #if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) strong_alias (__fegetenv, __old_fegetenv) -compat_symbol (libm, __old_fegetenv, fegetenv, GLIBC_2_1); +compat_symbol (libm, BP_SYM (__old_fegetenv), BP_SYM (fegetenv), GLIBC_2_1); #endif -versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2); +versioned_symbol (libm, BP_SYM (__fegetenv), BP_SYM (fegetenv), GLIBC_2_2); stub_warning (fegetenv) #include Index: sysdeps/generic/open64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/generic/open64.c,v retrieving revision 1.2 diff -u -p -r1.2 open64.c --- open64.c 1999/12/19 05:24:21 1.2 +++ open64.c 2000/07/11 19:55:07 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995, 1996, 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996, 1997, 1999, 2000 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 @@ -20,6 +20,7 @@ #include #include #include +#include /* Open FILE with access OFLAG. If OFLAG includes O_CREAT, a third argument is the file protection. */ @@ -48,7 +49,7 @@ __libc_open64 (file, oflag) return -1; } strong_alias (__libc_open64, __open64) -weak_alias (__libc_open64, open64) +weak_alias (__libc_open64, BP_SYM (open64)) stub_warning (open64) #include Index: sysdeps/posix/open64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/posix/open64.c,v retrieving revision 1.4 diff -u -p -r1.4 open64.c --- open64.c 2000/03/16 07:04:49 1.4 +++ open64.c 2000/07/11 19:55:07 @@ -18,6 +18,7 @@ #include #include +#include /* Open FILE with access OFLAG. If OFLAG includes O_CREAT, a third argument is the file protection. */ @@ -36,5 +37,5 @@ __libc_open64 (const char *file, int ofl return __libc_open (file, oflag | O_LARGEFILE, mode); } -weak_alias (__libc_open64, __open64) -weak_alias (__libc_open64, open64) +weak_alias (__libc_open64, BP_SYM (__open64)) +weak_alias (__libc_open64, BP_SYM (open64)) Index: sysdeps/powerpc/fpu/fegetenv.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/powerpc/fpu/fegetenv.c,v retrieving revision 1.2 diff -u -p -r1.2 fegetenv.c --- fegetenv.c 2000/02/26 01:09:38 1.2 +++ fegetenv.c 2000/07/11 19:55:07 @@ -18,6 +18,7 @@ Boston, MA 02111-1307, USA. */ #include +#include int __fegetenv (fenv_t *envp) @@ -28,5 +29,5 @@ __fegetenv (fenv_t *envp) return 0; } strong_alias (__fegetenv, __old_fegetenv) -symbol_version (__old_fegetenv, fegetenv, GLIBC_2.1); -default_symbol_version (__fegetenv, fegetenv, GLIBC_2.2); +symbol_version (BP_SYM (__old_fegetenv), BP_SYM (fegetenv), GLIBC_2.1); +default_symbol_version (BP_SYM (__fegetenv), BP_SYM (fegetenv), GLIBC_2.2); Index: sysdeps/powerpc/fpu/fesetenv.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/powerpc/fpu/fesetenv.c,v retrieving revision 1.2 diff -u -p -r1.2 fesetenv.c --- fesetenv.c 2000/02/26 01:09:38 1.2 +++ fesetenv.c 2000/07/11 19:55:07 @@ -18,6 +18,7 @@ Boston, MA 02111-1307, USA. */ #include +#include int __fesetenv (const fenv_t *envp) @@ -28,5 +29,5 @@ __fesetenv (const fenv_t *envp) return 0; } strong_alias (__fesetenv, __old_fesetenv) -symbol_version (__old_fesetenv, fesetenv, GLIBC_2.1); -default_symbol_version (__fesetenv, fesetenv, GLIBC_2.2); +symbol_version (BP_SYM (__old_fesetenv), BP_SYM (fesetenv), GLIBC_2.1); +default_symbol_version (BP_SYM (__fesetenv), BP_SYM (fesetenv), GLIBC_2.2); Index: sysdeps/powerpc/fpu/feupdateenv.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/powerpc/fpu/feupdateenv.c,v retrieving revision 1.2 diff -u -p -r1.2 feupdateenv.c --- feupdateenv.c 2000/02/26 01:09:38 1.2 +++ feupdateenv.c 2000/07/11 19:55:07 @@ -19,6 +19,7 @@ Boston, MA 02111-1307, USA. */ #include +#include int __feupdateenv (const fenv_t *envp) @@ -39,5 +40,5 @@ __feupdateenv (const fenv_t *envp) return 0; } strong_alias (__feupdateenv, __old_feupdateenv) -symbol_version (__old_feupdateenv, feupdateenv, GLIBC_2.1); -default_symbol_version (__feupdateenv, feupdateenv, GLIBC_2.2); +symbol_version (BP_SYM (__old_feupdateenv), BP_SYM (feupdateenv), GLIBC_2.1); +default_symbol_version (BP_SYM (__feupdateenv), BP_SYM (feupdateenv), GLIBC_2.2); Index: sysdeps/powerpc/fpu/fgetexcptflg.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/powerpc/fpu/fgetexcptflg.c,v retrieving revision 1.2 diff -u -p -r1.2 fgetexcptflg.c --- fgetexcptflg.c 2000/02/26 01:09:38 1.2 +++ fgetexcptflg.c 2000/07/11 19:55:07 @@ -18,6 +18,7 @@ Boston, MA 02111-1307, USA. */ #include +#include int __fegetexceptflag (fexcept_t *flagp, int excepts) @@ -34,5 +35,5 @@ __fegetexceptflag (fexcept_t *flagp, int return 0; } strong_alias (__fegetexceptflag, __old_fegetexceptflag) -symbol_version (__old_fegetexceptflag, fegetexceptflag, GLIBC_2.1); -default_symbol_version (__fegetexceptflag, fegetexceptflag, GLIBC_2.2); +symbol_version (BP_SYM (__old_fegetexceptflag), BP_SYM (fegetexceptflag), GLIBC_2.1); +default_symbol_version (BP_SYM (__fegetexceptflag), BP_SYM (fegetexceptflag), GLIBC_2.2); Index: sysdeps/powerpc/fpu/fraiseexcpt.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/powerpc/fpu/fraiseexcpt.c,v retrieving revision 1.2 diff -u -p -r1.2 fraiseexcpt.c --- fraiseexcpt.c 2000/02/26 01:09:38 1.2 +++ fraiseexcpt.c 2000/07/11 19:55:07 @@ -18,6 +18,7 @@ Boston, MA 02111-1307, USA. */ #include +#include #undef feraiseexcept int @@ -55,5 +56,5 @@ __feraiseexcept (int excepts) return 0; } strong_alias (__feraiseexcept, __old_feraiseexcept) -symbol_version (__old_feraiseexcept, feraiseexcept, GLIBC_2.1); -default_symbol_version (__feraiseexcept, feraiseexcept, GLIBC_2.2); +symbol_version (BP_SYM (__old_feraiseexcept), BP_SYM (feraiseexcept), GLIBC_2.1); +default_symbol_version (BP_SYM (__feraiseexcept), BP_SYM (feraiseexcept), GLIBC_2.2); Index: sysdeps/powerpc/fpu/fsetexcptflg.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/powerpc/fpu/fsetexcptflg.c,v retrieving revision 1.2 diff -u -p -r1.2 fsetexcptflg.c --- fsetexcptflg.c 2000/02/26 01:09:38 1.2 +++ fsetexcptflg.c 2000/07/11 19:55:07 @@ -18,6 +18,7 @@ Boston, MA 02111-1307, USA. */ #include +#include int __fesetexceptflag (const fexcept_t *flagp, int excepts) @@ -50,5 +51,5 @@ __fesetexceptflag (const fexcept_t *flag return 0; } strong_alias (__fesetexceptflag, __old_fesetexceptflag) -symbol_version (__old_fesetexceptflag, fesetexceptflag, GLIBC_2.1); -default_symbol_version (__fesetexceptflag, fesetexceptflag, GLIBC_2.2); +symbol_version (BP_SYM (__old_fesetexceptflag), BP_SYM (fesetexceptflag), GLIBC_2.1); +default_symbol_version (BP_SYM (__fesetexceptflag), BP_SYM (fesetexceptflag), GLIBC_2.2); From drepper@redhat.com Wed Jul 12 09:59:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 12 Jul 2000 09:59:00 -0000 Subject: PATCH: random applications of BP_SYM References: <200007121639.JAA26376@kayak.mcgary.org> Message-ID: Greg McGary writes: > Anyway, the changes are harmless. No build regressions or binary > differences for ix86 & PPC build-shared & build-static. OK. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@lucon.org Wed Jul 12 10:01:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Wed, 12 Jul 2000 10:01:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <200007121648.MAA01960@disaster.jaj.com> Message-ID: <20000712100140.A5104@lucon.org> On Wed, Jul 12, 2000 at 12:48:12PM -0400, Phil Edwards wrote: > > > Jeffrey A Law writes: > > > Not necessarily. One could certainly argue that if it's on the root > > > filesystem that it ought to be linked statically. > > > > Jeff, don't be ridiculous. First, you should look at the reality. > > Well... he is. I speak as a system administrator now rather than a > developer; Jeff is quite correct in saying that this is an arguable point. > It is by no means ridiculous. > > I've had Linux boxes crash hard, and IRIX boxes crash hard, and Solaris, > and Alphas; and Linux has been the only one ever that was a nightmare to > repair due to all the dynamic linking tangles. Having root-partition > binaries be statically linked is /excellent/ preparation for problems. > Or even just for doing work in a /real/ single-user mode. I have been working on X11, kernel and libc for years. My Linux machines have crashed more than once. I have never found dynamic binaries under / is a big problem. Yes, it is different. You have to have some tools around when it happens. I have recuse floppy and CD. They are very useful to me. > > Oh, we'll all be bitching at the GCC maintainers anyway even if they get it > all correct. :-) But I'd rather have a delayed, well-though-out solution > instead of a quick "this works perfectly for Linux, the rest of y'all are > screwed for another 18 months". All we suggest is 1. Define a libgcc runtim ABI and stick to it. 2. Leave the libgcc.so issue to the target system people. Trust us. #2 is a very hard problem. > > GCC is finally getting some /serious/ recognition on non-Linux platforms. > Even non-programmers have heard of it and recognize that it is a quality > compiler, but many of them still incorrectly think of it as "the Linux > compiler" because that's where the attention goes. Please, folks, let's > not blow this now. That is Ulrich's point and mine. To include libgcc.so in gcc, gcc has to spend HUGE amount of sources on Linux alone just to get it right on Linux. By leaving it to each system, gcc won't take all the blames when bad things happen :-). H.J. From hjl@lucon.org Wed Jul 12 11:01:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Wed, 12 Jul 2000 11:01:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <200007112126.XAA01019@loewis.home.cs.tu-berlin.de> <200007120601.IAA00981@loewis.home.cs.tu-berlin.de> <20000712081920.E4653@lucon.org> <200007121744.TAA00903@loewis.home.cs.tu-berlin.de> Message-ID: <20000712110045.A5327@lucon.org> On Wed, Jul 12, 2000 at 07:44:02PM +0200, Martin v. Loewis wrote: > > Can you tell me who are going to maintain Linux for years to come? > > We, VA Linux, have sold so many Linux machines. What do we do? The > > answer is you don't have to worry about it. Someone will maintain it, > > one way or the other, just like gcc, kernel, X11, glibc, binutils, > > ...... libgcc.so is no different. > > That's not a convincing response. For each of the packages you cited, > there is some person or organization supporting it, in the sense of > ongoing development (gcc steering committee, Linus Torvalds, XFree > Consortium, Ulrich Drepper, Cygnus/Redhat). Those I trust that they > will be there five years from now, or hand it over before they go > away. > > Something being "Linux" is not a guarantee for ongoing support; many > projects have been abandoned, or stagnate forever (my NTFS driver is > an example; another is the bpe editor). > > Are you saing VA Linux would commit to maintain libgcc.so? That would > be convincing also. > I don't speak for VA Linux. But I can ensure you that VA Linux has a vast interest in an actively maintained Linux system. A working libgcc.so belongs to that category. I will bet Red Hat, SuSE, ..... and many other Linux system software vendors will be very interested in it also. BTW, I guess Ulrich Drepper wants a reasonable libgcc.so solution for glibc too. H.J. From greg@mcgary.org Wed Jul 12 12:10:00 2000 From: greg@mcgary.org (Greg McGary) Date: Wed, 12 Jul 2000 12:10:00 -0000 Subject: PATCH: remaining powerpc BP mods Message-ID: <200007121910.MAA25188@kayak.mcgary.org> No build-shared or build-static regressions. No binary differences anticipated for non-BP (comparison build in progress). 2000-07-12 Greg McGary * sysdeps/powerpc/bp-asm.h (DISCARD_BOUNDS): Rename from UNCHECK_BOUNDS. * sysdeps/powerpc/bits/setjmp.h (JB_SIZE): New constant. * sysdeps/powerpc/elf/libc-start.c (__libc_start_main): Wrap bounds around argv & envp and each of their string members. * sysdeps/powerpc/elf/start.S: Designate BP symbols. * sysdeps/unix/sysv/linux/powerpc/brk.S: Wrap entry-point symbol in BP_SYM (). Discard bounds of address arg. * sysdeps/unix/sysv/linux/powerpc/clone.S: Likewise. * sysdeps/unix/sysv/linux/powerpc/mmap64.c (__mmap64): Discard bounds on address arg, add bounds to return value. Index: sysdeps/powerpc/bp-asm.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/powerpc/bp-asm.h,v retrieving revision 1.1 diff -u -p -r1.1 bp-asm.h --- bp-asm.h 2000/06/30 21:35:51 1.1 +++ bp-asm.h 2000/07/12 19:04:36 @@ -30,7 +30,7 @@ /* Don't check bounds, just convert the BP register to its simple pointer value. */ -# define UNCHECK_BOUNDS(rBP) \ +# define DISCARD_BOUNDS(rBP) \ lwz rBP, oVALUE(rBP) /* Check low bound, with the side effect that the BP register is converted @@ -99,7 +99,7 @@ #else -# define UNCHECK_BOUNDS(rBP) +# define DISCARD_BOUNDS(rBP) # define CHECK_BOUNDS_LOW(rBP, rLOW, rHIGH) # define CHECK_BOUNDS_HIGH(rVALUE, rHIGH, TWLcc) # define CHECK_BOUNDS_HIGH_RTN(rVALUE, rHIGH, TWLcc) Index: sysdeps/powerpc/bits/setjmp.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/powerpc/bits/setjmp.h,v retrieving revision 1.5 diff -u -p -r1.5 setjmp.h --- setjmp.h 1998/08/09 22:17:22 1.5 +++ setjmp.h 2000/07/12 19:04:36 @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 2000 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 @@ -34,6 +34,7 @@ # define JB_GPRS 3 /* GPRs 14 through 31 are saved, 18 in total */ # define JB_CR 21 /* Condition code registers. */ # define JB_FPRS 22 /* FPRs 14 through 31 are saved, 18*2 words total */ +# define JB_SIZE (58*4) #endif #ifndef _ASM Index: sysdeps/powerpc/elf/libc-start.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/powerpc/elf/libc-start.c,v retrieving revision 1.4 diff -u -p -r1.4 libc-start.c --- libc-start.c 2000/03/31 05:44:27 1.4 +++ libc-start.c 2000/07/12 19:04:36 @@ -19,6 +19,8 @@ #include #include #include +#include +#include extern void __libc_init_first (int argc, char **argv, char **envp); @@ -29,18 +31,27 @@ extern void *__libc_stack_end; struct startup_info { - void *sda_base; + void *__unbounded sda_base; int (*main) (int, char **, char **, void *); int (*init) (int, char **, char **, void *); void (*fini) (void); }; int -__libc_start_main (int argc, char **argv, char **envp, - void *auxvec, void (*rtld_fini) (void), - struct startup_info *stinfo, - char **stack_on_entry) +/* GKM FIXME: GCC: this should get __BP_ prefix by virtue of the + BPs in the arglist of startup_info.main and startup_info.init. */ +BP_SYM (__libc_start_main) (int argc, char *__unbounded *__unbounded ubp_av, + char *__unbounded *__unbounded ubp_ev, + void *__unbounded auxvec, void (*rtld_fini) (void), + struct startup_info *__unbounded stinfo, + char *__unbounded *__unbounded stack_on_entry) { +#if __BOUNDED_POINTERS__ + char **argv; +#else +# define argv ubp_av +#endif + #ifndef SHARED /* The next variable is only here to work around a bug in gcc <= 2.7.2.2. If the address would be taken inside the expression the optimizer @@ -58,23 +69,22 @@ __libc_start_main (int argc, char **argv /* ...in which case, we have argc as the top thing on the stack, followed by argv (NULL-terminated), envp (likewise), and the auxilary vector. */ - argc = *(int *) stack_on_entry; - argv = stack_on_entry + 1; - envp = argv + argc + 1; - auxvec = envp; - while (*(char **) auxvec != NULL) + argc = *(int *__unbounded) stack_on_entry; + ubp_av = stack_on_entry + 1; + ubp_ev = ubp_av + argc + 1; + auxvec = ubp_ev; + while (*(char *__unbounded *__unbounded) auxvec != NULL) ++auxvec; ++auxvec; rtld_fini = NULL; } + INIT_ARGV_and_ENVIRON; + /* Store something that has some relationship to the end of the stack, for backtraces. This variable should be thread-specific. */ __libc_stack_end = stack_on_entry + 4; - /* Set the global _environ variable correctly. */ - __environ = envp; - /* Register the destructor of the dynamic linker if there is any. */ if (rtld_fini != NULL) atexit (rtld_fini); @@ -84,7 +94,7 @@ __libc_start_main (int argc, char **argv if (_dl_debug_impcalls) _dl_debug_message (1, "\ninitialize libc\n\n", NULL); #endif - __libc_init_first (argc, argv, envp); + __libc_init_first (argc, argv, __environ); /* Register the destructor of the program, if any. */ if (stinfo->fini) Index: sysdeps/powerpc/elf/start.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/powerpc/elf/start.S,v retrieving revision 1.3 diff -u -p -r1.3 start.S --- start.S 1999/10/11 22:09:38 1.3 +++ start.S 2000/07/12 19:04:36 @@ -1,5 +1,5 @@ /* Startup code for programs linked with GNU libc. - Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000 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 @@ -27,6 +27,7 @@ Boston, MA 02111-1307, USA. */ #include +#include "bp-sym.h" /* These are the various addresses we require. */ .section ".rodata" @@ -35,7 +36,7 @@ weak_extern(_fini) L(start_addresses): .long _SDA_BASE_ - .long JUMPTARGET(main) + .long JUMPTARGET(BP_SYM (main)) .long JUMPTARGET(_init) .long JUMPTARGET(_fini) ASM_SIZE_DIRECTIVE(L(start_addresses)) @@ -55,7 +56,7 @@ ENTRY(_start) lis r8,L(start_addresses)@ha lwzu r13,L(start_addresses)@l(r8) /* and continue in libc-start, in glibc. */ - b JUMPTARGET(__libc_start_main) + b JUMPTARGET(BP_SYM (__libc_start_main)) END(_start) /* Define a symbol for the first piece of initialized data. */ Index: sysdeps/unix/sysv/linux/powerpc/brk.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/brk.S,v retrieving revision 1.4 diff -u -p -r1.4 brk.S --- brk.S 2000/06/06 19:20:56 1.4 +++ brk.S 2000/07/12 19:04:36 @@ -20,10 +20,14 @@ #include #define _ERRNO_H 1 #include +#include +#include .comm __curbrk,4,4 .section ".text" -ENTRY(__brk) +ENTRY (BP_SYM (__brk)) + DISCARD_BOUNDS (r3) /* the bounds are meaningless, so toss 'em */ + stwu r1,-16(r1) stw r3,8(r1) DO_CALL(SYS_ify(brk)) @@ -45,6 +49,6 @@ ENTRY(__brk) blelr+ li r3,ENOMEM b JUMPTARGET(__syscall_error) -END (__brk) +END (BP_SYM (__brk)) -weak_alias (__brk, brk) +weak_alias (BP_SYM (__brk), BP_SYM (brk)) Index: sysdeps/unix/sysv/linux/powerpc/clone.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/clone.S,v retrieving revision 1.8 diff -u -p -r1.8 clone.S --- clone.S 1999/10/11 23:35:39 1.8 +++ clone.S 2000/07/12 19:04:36 @@ -1,5 +1,5 @@ /* Wrapper around clone system call. - Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000 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 @@ -20,14 +20,21 @@ #include #define _ERRNO_H 1 #include +#include +#include /* This is the only really unusual system call in PPC linux, but not because of any weirdness in the system call itself; because of all the freaky stuff we have to do to make the call useful. */ -/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ +/* int [r3] clone(int (*fn)(void *arg) [r3], void *child_stack [r4], + int flags [r5], void *arg [r6]); */ -ENTRY(__clone) +ENTRY (BP_SYM (__clone)) + /* GKM FIXME: add bounds checks, where sensible. */ + DISCARD_BOUNDS (r4) + DISCARD_BOUNDS (r6) + /* Check for child_stack == NULL || fn == NULL. */ cmpwi cr0,r4,0 cmpwi cr1,r3,0 @@ -82,6 +89,6 @@ L(parent): L(badargs): li r3,EINVAL b JUMPTARGET(__syscall_error) -END (__clone) +END (BP_SYM (__clone)) -weak_alias (__clone, clone) +weak_alias (BP_SYM (__clone), BP_SYM (clone)) Index: sysdeps/unix/sysv/linux/powerpc/mmap64.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/mmap64.c,v retrieving revision 1.3 diff -u -p -r1.3 mmap64.c --- mmap64.c 2000/02/17 00:33:01 1.3 +++ mmap64.c 2000/07/12 19:04:36 @@ -19,18 +19,18 @@ #include #include +#include #include #include - -#include +#include #include - #include "kernel-features.h" #ifdef __NR_mmap2 -extern __ptr_t __syscall_mmap2(__ptr_t, size_t, int, int, int, off_t); +extern void *__unbounded __syscall_mmap2(void *__unbounded, size_t, + int, int, int, off_t); #ifndef __ASSUME_MMAP2_SYSCALL static int have_no_mmap2; #endif @@ -50,9 +50,13 @@ __mmap64 (__ptr_t addr, size_t len, int int saved_errno = errno; #endif /* This will be always 12, no matter what page size is. */ - __ptr_t result = INLINE_SYSCALL (mmap2, 6, addr, len, prot, flags, - fd, (off_t) (offset >> PAGE_SHIFT)); - + __ptr_t result; + __ptrvalue (result) = INLINE_SYSCALL (mmap2, 6, __ptrvalue (addr), len, prot, + flags, fd, (off_t) (offset >> PAGE_SHIFT)); +#if __BOUNDED_POINTERS__ + __ptrlow (result) = __ptrvalue (result); + __ptrhigh (result) = __ptrvalue (result) + len; +#endif #ifndef __ASSUME_MMAP2_SYSCALL if (result != (__ptr_t) -1 || errno != ENOSYS) #endif From drepper@redhat.com Wed Jul 12 12:24:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 12 Jul 2000 12:24:00 -0000 Subject: PATCH: remaining powerpc BP mods References: <200007121910.MAA25188@kayak.mcgary.org> Message-ID: Greg McGary writes: > No build-shared or build-static regressions. > No binary differences anticipated for non-BP (comparison build in progress). Seems OK. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Jul 12 12:50:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 12 Jul 2000 12:50:00 -0000 Subject: make check with static only builds References: Message-ID: Andreas Jaeger writes: > Is the patch ok to commit? I've applied the patch though I fail to see why this can be desirable. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Jul 12 12:52:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 12 Jul 2000 12:52:00 -0000 Subject: Patches for building in sourcedir References: Message-ID: Andreas Jaeger writes: > I'm appending a patch for this and similiar bugs. > > Ok to install? I've applied the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Jul 12 12:53:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 12 Jul 2000 12:53:00 -0000 Subject: Bug in getent program References: <200007120638.e6C6cRN18814@delius.kettenis.local> Message-ID: Mark Kettenis writes: > 2000-07-12 Mark Kettenis > > * nss/getent.c (services_keys): Pass port number in network byte > order in call to getservbyport. I've applied the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@valinux.com Wed Jul 12 13:20:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Wed, 12 Jul 2000 13:20:00 -0000 Subject: Patch: export __res_hostalias Message-ID: <20000712132029.A24514@valinux.com> _nss_dns_gethostbyname2_r in resolv/nss_dns/dns-host.c now calls __res_hostalias due to 2000-07-10 Mark Kettenis * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r): Use res_hostalias instead of __hostalias for thread-safety. We should export it now. -- H.J. Lu (hjl@gnu.org) -- 2000-07-12 H.J. Lu * resolv/Versions (libresolv): Add __res_hostalias to GLIBC_2.2 for _nss_dns_gethostbyname2_r in resolv/nss_dns/dns-host.c. Index: resolv/Versions =================================================================== RCS file: /work/cvs/gnu/glibc/resolv/Versions,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 Versions --- resolv/Versions 2000/05/21 21:11:24 1.1.1.1 +++ resolv/Versions 2000/07/12 20:08:02 @@ -52,7 +52,7 @@ libresolv { } GLIBC_2.2 { __res_nmkquery; __res_nquery; __res_nquerydomain; __res_nsearch; - __ns_get16; + __ns_get16; __res_hostalias; } libnss_dns { From drepper@redhat.com Wed Jul 12 13:39:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 12 Jul 2000 13:39:00 -0000 Subject: Patch: export __res_hostalias References: <20000712132029.A24514@valinux.com> Message-ID: "H . J . Lu" writes: > _nss_dns_gethostbyname2_r in resolv/nss_dns/dns-host.c now calls > __res_hostalias due to [...] Agreed. I've applied the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Wed Jul 12 14:10:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 12 Jul 2000 14:10:00 -0000 Subject: ldconfig problems References: <200007092109.RAA06606@neuralgia.linnaean.org> <200007100930.LAA12011@hawking.suse.de> Message-ID: Andreas Jaeger writes: > Is this version ok now? I've applied the patch, thanks. If somebody still disagrees we'll learn about it eventually. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From bmark@us.ibm.com Wed Jul 12 15:16:00 2000 From: bmark@us.ibm.com (Mark Brown) Date: Wed, 12 Jul 2000 15:16:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <200007112126.XAA01019@loewis.home.cs.tu-berlin.de> <200007120601.IAA00981@loewis.home.cs.tu-berlin.de> <20000712081920.E4653@lucon.org> Message-ID: <396CEE4B.D62401FA@us.ibm.com> Hi- I'm fairly new to this list, and not on the gcc list at all, but I've been doing a lot of "listening and learning", and thought that I would share my practical experience with compiler/library interaction and ABI specification. One of my primary responsibilities at IBM is best described as "binary compatibility police". I'm the person who gets called when any customer's application/device driver/kernel extension stops working. We have to support binaries produced years ago on previous *versions* of AIX, not just previous releases. Also, I have work ABI specification documents, to be usable by clones and OEMs, for AIX on PowerPC, and a UNIX for IA-64. While I am not yet technically competent to discuss the particulars of gcc/Cruntime interaction, I do feel that I might be able to add content in general with regard to shared libs and ABIs. AIX is also an OS (like GNU/Linx) that has separate "ownership" of C runtime and compiler (though this is not true for other language runtime/compilers offered on AIX). IBM's C compiler is offered on platforms besides AIX. We learned early along that the low-level function (found in libgcc in this case) is best maintained by the platform, since the platform is ultimately responsible for the ABI in the users' view -- not the compiler. This is even true for the C++/thread exception handling work; the compiler team came to us and we did the work to come up with a design that maintained source and binary compatibility in our runtime. Yes, the compiler determines a lot of things basic to the total ABI, but the platform loader/library is where the "rubber meets the road" and that what this code in libgcc truly covers. I see the same situation applies here -- even more so, since gcc operates in places without shared libs or glibc at all. What I see is that the platforms need to assume ownership of this, but gcc needs to document the things it needs to see from it, and only the things it needs to see, and leave the rest to the platform- specific version of libgcc. Maybe the gcc team will "pick up" ownership for platforms that cannot maintain it themselves, but trying to maintain all of them is something I would not recommend. This is just opinion based on similar practical experience; I am still learning to understand H. J. Lu's idea and so cannot comment on it. -- Mark S. Brown bmark@us.ibm.com IBM RS/6000 AIX System Architecture 512.838.3926 T/L678.3926 IBM Corporation, Austin, Texas From hjl@lucon.org Wed Jul 12 17:17:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Wed, 12 Jul 2000 17:17:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <200007112126.XAA01019@loewis.home.cs.tu-berlin.de> <200007120601.IAA00981@loewis.home.cs.tu-berlin.de> <20000712081920.E4653@lucon.org> <396CEE4B.D62401FA@us.ibm.com> Message-ID: <20000712171734.A6735@lucon.org> On Wed, Jul 12, 2000 at 05:16:49PM -0500, Mark Brown wrote: > > AIX is also an OS (like GNU/Linx) that has separate "ownership" of > C runtime and compiler (though this is not true for other language > runtime/compilers offered on AIX). IBM's C compiler is offered on > platforms besides AIX. We learned early along that the > low-level function (found in libgcc in this case) is best maintained > by the platform, since the platform is ultimately responsible for > the ABI in the users' view -- not the compiler. This is even true for > the C++/thread exception handling work; the compiler team came to > us and we did the work to come up with a design that maintained > source and binary compatibility in our runtime. Yes, the compiler > determines a lot of things basic to the total ABI, but the platform > loader/library is where the "rubber meets the road" and that what > this code in libgcc truly covers. > > I see the same situation applies here -- even more so, since gcc > operates in places without shared libs or glibc at all. What I see > is that the platforms need to assume ownership of this, but gcc > needs to document the things it needs to see from it, and only > the things it needs to see, and leave the rest to the platform- > specific version of libgcc. Maybe the gcc team will "pick up" ownership > for platforms that cannot maintain it themselves, but trying to > maintain all of them is something I would not recommend. Thanks for your eloquent explanation. I agree with you almost 100%. > > This is just opinion based on similar practical experience; I am still > learning to understand H. J. Lu's idea and so cannot comment on > it. > My idea is very similar, if not identical, to yours. H.J. From hjl@valinux.com Wed Jul 12 17:31:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Wed, 12 Jul 2000 17:31:00 -0000 Subject: gconv_open patch (1) Message-ID: <20000712173048.A1722@valinux.com> This patch causes "make check" to fail in iconvdata. I got many /home/work/build/gnu/glibc/iconv/iconv_prog: illegal input sequence at position Backing it out makes "make check" to pass. -- H.J. Lu (hjl@gnu.org) From hjl@valinux.com Wed Jul 12 18:04:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Wed, 12 Jul 2000 18:04:00 -0000 Subject: Patch for gconv_open patch (1) Message-ID: <20000712180402.A1773@valinux.com> 2000-07-12 Bruno Haible * iconv/gconv_open.c (__gconv_open): Initialize result->__steps[cnt].__data. breaks "make check" in iconvdata. This kludge seems to work for me. -- H.J. Lu (hjl@gnu.org) -- 2000-07-12 H.J. Lu * iconv/gconv_open.c (__gconv_open): Initialize result->__steps[cnt].__data only if it is NULL. Index: iconv/gconv_open.c =================================================================== RCS file: /work/cvs/gnu/glibc/iconv/gconv_open.c,v retrieving revision 1.1.1.6 diff -u -p -r1.1.1.6 gconv_open.c --- iconv/gconv_open.c 2000/07/12 20:45:32 1.1.1.6 +++ iconv/gconv_open.c 2000/07/13 00:58:31 @@ -242,7 +242,8 @@ __gconv_open (const char *toset, const c break; } - result->__steps[cnt].__data = &result->__data[cnt]; + if (!result->__steps[cnt].__data) + result->__steps[cnt].__data = &result->__data[cnt]; /* If this is the last step we must not allocate an output buffer. */ From drepper@redhat.com Wed Jul 12 18:05:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 12 Jul 2000 18:05:00 -0000 Subject: gconv_open patch (1) References: <20000712173048.A1722@valinux.com> Message-ID: "H . J . Lu" writes: > Backing it out makes "make check" to pass. I already backed the patch out and am investigating it. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Wed Jul 12 18:16:00 2000 From: greg@mcgary.org (Greg McGary) Date: Wed, 12 Jul 2000 18:16:00 -0000 Subject: bounds checking ioctl data Message-ID: <200007130116.SAA30137@kayak.mcgary.org> I have the following defined in sysdeps/generic/bp-checks.h: ------------------------------------------------------------------------------ # if defined (_IOC_SIZESHIFT) && defined (_IOC_SIZEBITS) /* Extract the size of the ioctl parameter argument and check its bounds. */ # define CHECK_IOCTL(ARG, CMD) \ CHECK_N ((ARG), (((CMD) >> _IOC_SIZESHIFT) & ((1 << _IOC_SIZEBITS) - 1))) # else # define CHECK_IOCTL(ARG, CMD) __ptrvalue (ARG) # endif ------------------------------------------------------------------------------ The problem is that _IOC_SIZEBITS and _IOC_SIZESHIFT are not defined in glibc, but rather in the OS kernel sources. In order to make these work, should I clone these definitions in glibc? If so, where? Should it go in a file that's private to glibc, or should it be public so that conflicting definitions in the glibc part and the OS part will trigger diagnostics. Please advise. From hjl@lucon.org Wed Jul 12 19:35:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Wed, 12 Jul 2000 19:35:00 -0000 Subject: Many regex failures Message-ID: <20000712193501.A7288@lucon.org> The CVS at 7pm PDT on July 12, "make check" failed in posix: regexp: "[A-[.].]c]", string: "ab]!" -> no match, FAIL regexp: "[[:alnum:]]*", string: " aB28gH" -> wrong match (0 to 0): FAIL regexp: "[^[:alnum:]]*", string: "2 ,a" -> wrong match (0 to 0): FAIL regexp: "[[:alpha:]]*", string: " aBgH2" -> wrong match (0 to 0): FAIL regexp: "[[:digit:]]*", string: "a28" -> wrong match (0 to 0): FAIL regexp: "[[:punct:]]*", string: "a,2" -> wrong match (0 to 0): FAIL regexp: "[^[:space:]]*", string: " aB28gH, " -> wrong match (0 to 0): FAIL regexp: "[[:upper:]]*", string: "aBH2" -> wrong match (0 to 0): FAIL regexp: "[[:xdigit:]]*", string: "gaB28h" -> wrong match (0 to 0): FAIL regexp: "[^[:xdigit:]]*", string: "a gH,2" -> wrong match (0 to 0): FAIL regexp: "[A-[.].]c]", string: "ab]!" -> no match, FAIL H.J. From drepper@redhat.com Wed Jul 12 20:22:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 12 Jul 2000 20:22:00 -0000 Subject: Many regex failures References: <20000712193501.A7288@lucon.org> Message-ID: "H . J . Lu" writes: > The CVS at 7pm PDT on July 12, "make check" failed in posix: I'll try to look at it... -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@lucon.org Wed Jul 12 23:04:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Wed, 12 Jul 2000 23:04:00 -0000 Subject: The libgcc.so for glibc initiative Message-ID: <20000712230417.A7729@lucon.org> Hi, Folks, Given the current libgcc.so situation, I'd like to start the libgcc.so for glibc project. The goals are 1. Binary compatible with binaries linked with glibc 2.0, 2.1, 2.2 and above. 2. Stand alone as well as glibc add-on. 3. Can be used to upgrade libgcc.so from an installed gcc. 4. Support glibc and glibc only. 5. Support glibc 2.2 and above. 6. Support gcc 2.96 and above. It can be hosted on sourceforge or under glibc like linuxthreads. Any comments? H.J. From drepper@redhat.com Wed Jul 12 23:25:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 12 Jul 2000 23:25:00 -0000 Subject: libposix Message-ID: Has anybody ever seen a use of libposix? We are generating it but I personally never saw it being used. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Wed Jul 12 23:51:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Wed, 12 Jul 2000 23:51:00 -0000 Subject: bounds checking ioctl data References: <200007130116.SAA30137@kayak.mcgary.org> Message-ID: >>>>> Greg McGary writes: > I have the following defined in sysdeps/generic/bp-checks.h: > ------------------------------------------------------------------------------ > # if defined (_IOC_SIZESHIFT) && defined (_IOC_SIZEBITS) > /* Extract the size of the ioctl parameter argument and check its bounds. */ > # define CHECK_IOCTL(ARG, CMD) \ > CHECK_N ((ARG), (((CMD) >> _IOC_SIZESHIFT) & ((1 << _IOC_SIZEBITS) - 1))) > # else > # define CHECK_IOCTL(ARG, CMD) __ptrvalue (ARG) > # endif > ------------------------------------------------------------------------------ > The problem is that _IOC_SIZEBITS and _IOC_SIZESHIFT are not defined > in glibc, but rather in the OS kernel sources. In order to make these > work, should I clone these definitions in glibc? If so, where? > Should it go in a file that's private to glibc, or should it be public > so that conflicting definitions in the glibc part and the OS part will > trigger diagnostics. We already copy a number of definitions from kernel sources to glibc, cloning is no problem in general. The problem I see is that it's defined in which might get included in a number of user programs. We shouldn't add the defines in a user visible file so that it leads to conflicts if get's included. Adding a check that the definitions are correct would be fine but is IMO not required. Btw. already includes (on ix86-Linux) which includes - therefore you should have the definitions already by including . Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From drepper@redhat.com Wed Jul 12 23:52:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Wed, 12 Jul 2000 23:52:00 -0000 Subject: Many regex failures References: <20000712193501.A7288@lucon.org> Message-ID: "H . J . Lu" writes: > The CVS at 7pm PDT on July 12, "make check" failed in posix: > > regexp: "[A-[.].]c]", string: "ab]!" -> no match, FAIL OK, you scared me. The FAILs you see are all expected. Regex is simply that buggy. I looked at all the failing tests once to see whether there is an easy fix and I haven't found any. Regex must be rewritten completely and this is one of the things I plan to do once things settle down with the 2.2 release. There is absolutely no hope to use a single piece from the existing implementation since the most inner code is not prepared for multibyte characters. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Thu Jul 13 00:49:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Thu, 13 Jul 2000 00:49:00 -0000 Subject: libposix References: Message-ID: >>>>> Ulrich Drepper writes: > Has anybody ever seen a use of libposix? We are generating it but I > personally never saw it being used. I did a grep over the few sources I've installed locally and found the following in autoconf: /cvs/autoconf/INSTALL: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix and in /cvs/autoconf/acspecific.m4 # Guillermo Gomez says -lposix is necessary on A/UX. AC_CHECK_FUNC(remove) if test $ac_cv_func_remove = no; then AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix") fi Other files using autoconf where included this - but I couldn't find a reference to -lposix for a Linux system. So it looks that it not needed anywhere - just mentioned in all INSTALL documents as an example :-(. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From drepper@redhat.com Thu Jul 13 01:33:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 13 Jul 2000 01:33:00 -0000 Subject: libposix References: Message-ID: Andreas Jaeger writes: > So it looks that it not needed anywhere - just mentioned in all > INSTALL documents as an example :-(. So we might as well remove it. This is certainly no standard library. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Thu Jul 13 02:00:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Thu, 13 Jul 2000 02:00:00 -0000 Subject: libposix References: Message-ID: >>>>> Ulrich Drepper writes: > Andreas Jaeger writes: >> So it looks that it not needed anywhere - just mentioned in all >> INSTALL documents as an example :-(. > So we might as well remove it. This is certainly no standard library. I came to the same conclusion. Here's a patch. Andreas 2000-07-13 Andreas Jaeger * posix/Makefile: Remove build rules for libposix. ============================================================ Index: posix/Makefile --- posix/Makefile 2000/07/04 08:14:33 1.99 +++ posix/Makefile 2000/07/13 08:38:40 @@ -75,9 +75,6 @@ endif others := getconf install-bin := getconf -ifeq (yes,$(build-static)) -install-lib := libposix.a -endif gpl2lgpl := getopt.c getopt1.c getopt.h regex.c regex.h before-compile := testcases.h ptestcases.h @@ -111,9 +108,6 @@ tst-spawn-ARGS = -- $(built-program-cmd) tst-fnmatch-ENV = LOCPATH=$(common-objpfx)localedata - -$(objpfx)libposix.a: $(dep-dummy-lib); $(make-dummy-lib) -lib: $(objpfx)libposix.a testcases.h: TESTS TESTS2C.sed sed -f TESTS2C.sed < $< > $@T -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From aj@suse.de Thu Jul 13 02:59:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Thu, 13 Jul 2000 02:59:00 -0000 Subject: Memory bug fixed Message-ID: FYI: While searching for the memory leak in glob in noticed: - 0000000000 Free 162 was never alloc'd /usr/src/cvs/libc/misc/../sysdeps/unix/sysv/linux/getsysstats.c:287 The appended patch fixes this and has been committed. Andreas 2000-07-13 Andreas Jaeger * sysdeps/unix/sysv/linux/getsysstats.c (free_mem): Only free memory if it was allocated. ============================================================ Index: sysdeps/unix/sysv/linux/getsysstats.c --- sysdeps/unix/sysv/linux/getsysstats.c 2000/07/06 21:04:09 1.12 +++ sysdeps/unix/sysv/linux/getsysstats.c 2000/07/13 09:48:09 @@ -283,6 +283,7 @@ static void free_mem (void) { - free (mount_proc); + if (mount_proc != NULL) + free (mount_proc); } text_set_element (__libc_subfreeres, free_mem); -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From kettenis@wins.uva.nl Thu Jul 13 04:12:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Thu, 13 Jul 2000 04:12:00 -0000 Subject: The libgcc.so for glibc initiative References: <20000712230417.A7729@lucon.org> Message-ID: <200007131112.e6DBCMk00397@delius.kettenis.local> Date: Wed, 12 Jul 2000 23:04:17 -0700 From: "H . J . Lu" Hi, Folks, Given the current libgcc.so situation, I'd like to start the libgcc.so for glibc project. The goals are 1. Binary compatible with binaries linked with glibc 2.0, 2.1, 2.2 and above. 2. Stand alone as well as glibc add-on. 3. Can be used to upgrade libgcc.so from an installed gcc. 4. Support glibc and glibc only. 5. Support glibc 2.2 and above. 6. Support gcc 2.96 and above. It can be hosted on sourceforge or under glibc like linuxthreads. Any comments? There's nothing against experimenting with this, and using it as a temporary solution util the libgcc.so thing settles down a bit. However, presenting this somehow as thee official libgcc.so for glibc" is completely stupid. That would only piss of the GCC team, and since it's essential that we work with the GCC team on this thing (since they will still have control over the bits of code included in libgcc, and hence control huge parts of the ABI) this wouldn't be a terrible good idea. In other words, there can be no stable libgcc.so ABI if the GCC team doesn't agree on it. If this ever does become the official libgcc.so for glibc thing 6. Support gcc 2.96 and above. should become 6. Support gcc 3.0 and above. Since we shouldn't officially support an unreleased version of GCC. Of course we'll have a --i-really-want-to-use-and-experimental-gcc option, that makes it possible to create a libgcc.so from an experimental GCC (such as 2.96 right now) for testing purposes. Mark PS Personally I still think that the GCC team should do the libgcc.so. They control the interfaces. If they cannot keep the interfaces (reasonably) stable this whole thing is doomed anyway. This really is a much greater challange than the simple technicalities required for successfully building and installing the libgcc.so. From greg@mcgary.org Thu Jul 13 05:29:00 2000 From: greg@mcgary.org (Greg McGary) Date: Thu, 13 Jul 2000 05:29:00 -0000 Subject: bounds checking ioctl data References: <200007130116.SAA30137@kayak.mcgary.org> Message-ID: Andreas Jaeger writes: > Btw. already includes (on ix86-Linux) > which includes - therefore you should have the > definitions already by including . Thanks. I was laboring under the illusion that glibc was 100% self-contained for header files. Greg From bmark@us.ibm.com Thu Jul 13 07:15:00 2000 From: bmark@us.ibm.com (Mark Brown) Date: Thu, 13 Jul 2000 07:15:00 -0000 Subject: Many regex failures References: <20000712193501.A7288@lucon.org> Message-ID: <396DCEEB.CBADFC49@us.ibm.com> Ulrich Drepper wrote: > Regex must be rewritten completely and this is one of the things I > plan to do once things settle down with the 2.2 release. There is > absolutely no hope to use a single piece from the existing > implementation since the most inner code is not prepared for multibyte > characters. I will look to see if my employer can donate its version, which is designed for multibyte and unicode. This may take a little while -- lawyers and such. Mark -- Mark S. Brown bmark@us.ibm.com IBM RS/6000 AIX System Architecture 512.838.3926 T/L678.3926 IBM Corporation, Austin, Texas From schwab@suse.de Thu Jul 13 07:39:00 2000 From: schwab@suse.de (Andreas Schwab) Date: Thu, 13 Jul 2000 07:39:00 -0000 Subject: Memory bug fixed References: Message-ID: <200007131439.QAA10240@hawking.suse.de> Andreas Jaeger writes: |> FYI: While searching for the memory leak in glob in noticed: Did you try my patch yet? |> - 0000000000 Free 162 was never alloc'd /usr/src/cvs/libc/misc/../sysdeps/unix/sysv/linux/getsysstats.c:287 ??? free(0) is a no-op. Andreas. -- Andreas Schwab "And now for something SuSE Labs completely different." Andreas.Schwab@suse.de SuSE GmbH, Schanz????ckerstr. 10, D-90443 N????rnberg From aj@suse.de Thu Jul 13 07:50:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Thu, 13 Jul 2000 07:50:00 -0000 Subject: Memory bug fixed References: <200007131439.QAA10240@hawking.suse.de> Message-ID: >>>>> Andreas Schwab writes: > Andreas Jaeger writes: > |> FYI: While searching for the memory leak in glob in noticed: > Did you try my patch yet? Yes. Didn't you get my reply that it works fine? > |> - 0000000000 Free 162 was never alloc'd /usr/src/cvs/libc/misc/../sysdeps/unix/sysv/linux/getsysstats.c:287 > ??? free(0) is a no-op. Nevertheless we shouldn't call free (0). Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From hjl@lucon.org Thu Jul 13 07:57:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Thu, 13 Jul 2000 07:57:00 -0000 Subject: The libgcc.so for glibc initiative References: <20000712230417.A7729@lucon.org> <200007131112.e6DBCMk00397@delius.kettenis.local> Message-ID: <20000713075706.A9067@lucon.org> On Thu, Jul 13, 2000 at 01:12:22PM +0200, Mark Kettenis wrote: > Date: Wed, 12 Jul 2000 23:04:17 -0700 > From: "H . J . Lu" > > Hi, Folks, > > Given the current libgcc.so situation, I'd like to start the libgcc.so > for glibc project. The goals are > > 1. Binary compatible with binaries linked with glibc 2.0, 2.1, 2.2 and > above. > 2. Stand alone as well as glibc add-on. > 3. Can be used to upgrade libgcc.so from an installed gcc. > 4. Support glibc and glibc only. > 5. Support glibc 2.2 and above. > 6. Support gcc 2.96 and above. > > It can be hosted on sourceforge or under glibc like linuxthreads. Any > comments? > > There's nothing against experimenting with this, and using it as a > temporary solution util the libgcc.so thing settles down a bit. I am just to be realistic. There is no way I can see that gcc can provide a general solution for libgcc.so on all targets it supports. It will require the runtime support from the system vendors. I don't believe gcc can do it on itself. The end result may be a solution which sort of works, but falls far short for glibc. > However, presenting this somehow as thee official libgcc.so for glibc" > is completely stupid. That would only piss of the GCC team, and since If getting a reasonable libgcc.so solution for glibc means pisses of someone from the GCC team, there is nothing I can do about it. > it's essential that we work with the GCC team on this thing (since > they will still have control over the bits of code included in libgcc, > and hence control huge parts of the ABI) this wouldn't be a terrible > good idea. In other words, there can be no stable libgcc.so ABI if > the GCC team doesn't agree on it. I guess we have to yell at them when they break the ABI. That is what I did when they broke it on June 25.. Most of the gcc people never maintined a system runtime shared library before. They have no idea what takes to get things done. They should have listened to people who have done it, including Mark from IBM. Thanks Mark. > > If this ever does become the official libgcc.so for glibc thing > > 6. Support gcc 2.96 and above. > > should become > > 6. Support gcc 3.0 and above. > > Since we shouldn't officially support an unreleased version of GCC. > Of course we'll have a --i-really-want-to-use-and-experimental-gcc > option, that makes it possible to create a libgcc.so from an > experimental GCC (such as 2.96 right now) for testing purposes. That is what I meant. > > Mark > > PS Personally I still think that the GCC team should do the > libgcc.so. They control the interfaces. If they cannot keep the The problem is they don't know to do it right. They may screw things up before we know it. I don't think glibc can afford it. > interfaces (reasonably) stable this whole thing is doomed anyway. That is the only thing I want from them. > This really is a much greater challange than the simple technicalities I know. I want to add another one which may interfere the stable ABI since they want to get libgcc.so to work on all taregts. > required for successfully building and installing the libgcc.so. It is relatively trivial to support libgcc.so on glibc 2.2 since we control everything from as, ld to glibc. We have symbol versioning as well as working ELF visibility support in ld and ld.so. I said it only supported glibc 2.2. Try it on Solaris. If it is that simple, I will let gcc do it. They want a general soltion for libc 5, glibc 2.0, glibc 2.1, .......... I don't think the soltion they choose will work for us. The best thing which can happen may be gcc will do install.libgcc.so: if [ -x ...../upgrade.libgcc.so ]; then \ CC=...../bin/gcc ...../upgrade.libgcc.so; \ else \ install their own libgcc.so; \ fi But we have to make sure ...../upgrade.libgcc.so does the right thing first. H.J. From hjl@lucon.org Thu Jul 13 08:01:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Thu, 13 Jul 2000 08:01:00 -0000 Subject: The libgcc.so for glibc initiative References: <20000712230417.A7729@lucon.org> <200007131112.e6DBCMk00397@delius.kettenis.local> <20000713075706.A9067@lucon.org> Message-ID: <20000713080139.C9067@lucon.org> On Thu, Jul 13, 2000 at 07:57:06AM -0700, H . J . Lu wrote: > > > > PS Personally I still think that the GCC team should do the > > libgcc.so. They control the interfaces. If they cannot keep the > > The problem is they don't know to do it right. They may screw things That should be "they don't know how to do it right." > up before we know it. I don't think glibc can afford it. > > > interfaces (reasonably) stable this whole thing is doomed anyway. > > That is the only thing I want from them. > > > This really is a much greater challange than the simple technicalities > > I know. I want to add another one which may interfere the stable ABI That should be "I don't want to add another one". > since they want to get libgcc.so to work on all taregts. > I should have read it again before I sent it :-). H.J. From hjl@lucon.org Thu Jul 13 08:06:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Thu, 13 Jul 2000 08:06:00 -0000 Subject: Many regex failures References: <20000712193501.A7288@lucon.org> Message-ID: <20000713080557.D9067@lucon.org> On Wed, Jul 12, 2000 at 11:52:48PM -0700, Ulrich Drepper wrote: > "H . J . Lu" writes: > > > The CVS at 7pm PDT on July 12, "make check" failed in posix: > > > > regexp: "[A-[.].]c]", string: "ab]!" -> no match, FAIL > > OK, you scared me. The FAILs you see are all expected. Regex is > simply that buggy. I looked at all the failing tests once to see > whether there is an easy fix and I haven't found any. > It is a false alarm. When I recompiled it from scratch, "make check" passed. H.J. From aj@suse.de Thu Jul 13 08:37:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Thu, 13 Jul 2000 08:37:00 -0000 Subject: make check with static only builds References: Message-ID: >>>>> Ulrich Drepper writes: Uli> Andreas Jaeger writes: >> Is the patch ok to commit? Uli> I've applied the patch though I fail to see why this can be desirable. A complete build of static libs is faster - and the static lib might contain bugs the shared one hasn't. For example with the patch applied I now get on a static build: GCONV_PATH=/builds/glibc/20000621-static/iconvdata LC_ALL=C \ LOCPATH=/builds/glibc/20000621-static/localedata /builds/glibc/20000621-static/localedata/tst_mblen > /builds/glibc/20000621-static/localedata/tst_mblen.out make[2]: *** [/builds/glibc/20000621-static/localedata/tst_mblen.out] Error 1 make[2]: Leaving directory `/usr/src/cvs/libc/localedata' tst_mblen.out contains: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mblen:de_DE.ISO-8859-1:1:1:2:F:the return value is different from an expected value mblen:de_DE.ISO-8859-1:2:1:2:S:PASSED mblen:de_DE.ISO-8859-1:3:1:2:S:PASSED mblen:de_DE.ISO-8859-1:4:1:2:S:PASSED mblen:de_DE.ISO-8859-1:5:1:2:S:PASSED mblen:de_DE.ISO-8859-1:6:1:3:S:PASSED mblen:en_US.ANSI_X3.4-1968:1:1:2:S:PASSED mblen:en_US.ANSI_X3.4-1968:2:1:2:S:PASSED mblen:en_US.ANSI_X3.4-1968:3:1:2:S:PASSED mblen:en_US.ANSI_X3.4-1968:4:1:2:S:PASSED mblen:en_US.ANSI_X3.4-1968:5:1:2:S:PASSED mblen:en_US.ANSI_X3.4-1968:6:1:3:S:PASSED mblen:ja_JP.EUC-JP:1:1:2:F:the return value is different from an expected value mblen:ja_JP.EUC-JP:2:1:2:F:the return value is different from an expected value mblen:ja_JP.EUC-JP:3:1:2:F:the return value is different from an expected value mblen:ja_JP.EUC-JP:4:1:1:S:PASSED mblen:ja_JP.EUC-JP:4:1:2:S:PASSED mblen:ja_JP.EUC-JP:5:1:2:S:PASSED mblen:ja_JP.EUC-JP:6:1:3:S:PASSED ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I didn't investigate why this is broken, just noted it. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From drepper@redhat.com Thu Jul 13 08:43:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 13 Jul 2000 08:43:00 -0000 Subject: Memory bug fixed References: <200007131439.QAA10240@hawking.suse.de> Message-ID: Andreas Schwab writes: > ??? free(0) is a no-op. Exactly. I've paid close attention to these since it just increases the binary size. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Thu Jul 13 08:45:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 13 Jul 2000 08:45:00 -0000 Subject: Memory bug fixed References: <200007131439.QAA10240@hawking.suse.de> Message-ID: Andreas Jaeger writes: > Nevertheless we shouldn't call free (0). I don't agree. The if just increases the binary size. We should never increase the binary size if this is not performance critical. E.g., I would agree to having this `if' if this would be in code which runs normally. But this is debugging code and we don't care about speed (besides, it's executed exactly once). -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Thu Jul 13 09:00:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Thu, 13 Jul 2000 09:00:00 -0000 Subject: Memory bug fixed References: <200007131439.QAA10240@hawking.suse.de> Message-ID: >>>>> Ulrich Drepper writes: Uli> Andreas Jaeger writes: >> Nevertheless we shouldn't call free (0). Uli> I don't agree. The if just increases the binary size. We should Uli> never increase the binary size if this is not performance critical. Uli> E.g., I would agree to having this `if' if this would be in code which Uli> runs normally. But this is debugging code and we don't care about Uli> speed (besides, it's executed exactly once). I looked at shadow/fgetspent.c and there was also an if. The message in mtrace confused me. Shall I revert the patch and change fgetspent.c also? Should we teach mtrace to not emit an error message for free(0) ? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From drepper@redhat.com Thu Jul 13 09:14:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 13 Jul 2000 09:14:00 -0000 Subject: Memory bug fixed References: <200007131439.QAA10240@hawking.suse.de> Message-ID: Andreas Jaeger writes: > Shall I revert the patch and change fgetspent.c also? Should we teach > mtrace to not emit an error message for free(0) ? Yes and yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Thu Jul 13 09:40:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Thu, 13 Jul 2000 09:40:00 -0000 Subject: Memory bug fixed References: <200007131439.QAA10240@hawking.suse.de> Message-ID: >>>>> Ulrich Drepper writes: Uli> Andreas Jaeger writes: >> Shall I revert the patch and change fgetspent.c also? Should we teach >> mtrace to not emit an error message for free(0) ? Uli> Yes and yes. Here's a patch. Is this one ok? Andreas 2000-07-13 Andreas Jaeger * malloc/mtrace.pl (location): Ignore free(0). * sysdeps/unix/sysv/linux/getsysstats.c (free_mem): Revert last patch. * grp/fgetgrent.c (free_mem): Remove if - free (0) is valid. * inet/getnetgrent.c (free_mem): Likewise. * misc/mntent.c (free_mem): Likewise. * nss/getXXbyYY.c (free_mem): Likewise. * nss/getXXent.c (free_mem): Likewise. * pwd/fgetpwent.c (free_mem): Likewise. * shadow/fgetspent.c (free_mem): Likewise. ============================================================ Index: shadow/fgetspent.c --- shadow/fgetspent.c 1999/06/09 12:01:12 1.6 +++ shadow/fgetspent.c 2000/07/13 16:29:21 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1999, 2000 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 @@ -92,8 +92,7 @@ static void __attribute__ ((unused)) free_mem (void) { - if (buffer != NULL) - free (buffer); + free (buffer); } text_set_element (__libc_subfreeres, free_mem); ============================================================ Index: pwd/fgetpwent.c --- pwd/fgetpwent.c 1999/06/09 11:58:48 1.11 +++ pwd/fgetpwent.c 2000/07/13 16:29:21 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1996, 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1996, 1997, 1999, 2000 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 @@ -89,8 +89,7 @@ static void __attribute__ ((unused)) free_mem (void) { - if (buffer != NULL) - free (buffer); + free (buffer); } text_set_element (__libc_subfreeres, free_mem); ============================================================ Index: sysdeps/unix/sysv/linux/getsysstats.c --- sysdeps/unix/sysv/linux/getsysstats.c 2000/07/13 09:50:03 1.13 +++ sysdeps/unix/sysv/linux/getsysstats.c 2000/07/13 16:29:22 @@ -283,7 +283,6 @@ static void free_mem (void) { - if (mount_proc != NULL) - free (mount_proc); + free (mount_proc); } text_set_element (__libc_subfreeres, free_mem); ============================================================ Index: nss/getXXent.c --- nss/getXXent.c 1999/06/17 12:31:25 1.10 +++ nss/getXXent.c 2000/07/13 16:29:22 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1999, 2000 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 @@ -121,8 +121,7 @@ static void __attribute__ ((unused)) free_mem (void) { - if (buffer != NULL) - free (buffer); + free (buffer); } text_set_element (__libc_subfreeres, free_mem); ============================================================ Index: nss/getXXbyYY.c --- nss/getXXbyYY.c 1999/12/04 18:00:10 1.17 +++ nss/getXXbyYY.c 2000/07/13 16:29:22 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 1999, 2000 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 @@ -164,8 +164,7 @@ static void __attribute__ ((unused)) free_mem (void) { - if (buffer != NULL) - free (buffer); + free (buffer); } text_set_element (__libc_subfreeres, free_mem); ============================================================ Index: misc/mntent.c --- misc/mntent.c 1997/10/31 22:45:25 1.7 +++ misc/mntent.c 2000/07/13 16:29:22 @@ -1,5 +1,5 @@ /* Utilities for reading/writing fstab, mtab, etc. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 2000 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 @@ -60,8 +60,7 @@ __attribute__ ((unused)) free_mem (void) { - if (getmntent_buffer != NULL) - free (getmntent_buffer); + free (getmntent_buffer); } text_set_element (__libc_subfreeres, free_mem); ============================================================ Index: inet/getnetgrent.c --- inet/getnetgrent.c 1997/10/31 22:43:17 1.3 +++ inet/getnetgrent.c 2000/07/13 16:29:22 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 2000 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 @@ -56,8 +56,7 @@ __attribute__ ((unused)) free_mem (void) { - if (buffer != NULL) - free (buffer); + free (buffer); } text_set_element (__libc_subfreeres, free_mem); ============================================================ Index: grp/fgetgrent.c --- grp/fgetgrent.c 2000/04/21 15:59:39 1.15 +++ grp/fgetgrent.c 2000/07/13 16:29:22 @@ -89,8 +89,7 @@ static void __attribute__ ((unused)) free_mem (void) { - if (buffer != NULL) - free (buffer); + free (buffer); } text_set_element (__libc_subfreeres, free_mem); ============================================================ Index: malloc/mtrace.pl --- malloc/mtrace.pl 2000/07/07 08:03:07 1.6 +++ malloc/mtrace.pl 2000/07/13 16:29:22 @@ -139,6 +139,9 @@ if (defined $allocated{$allocaddr}) { undef $allocated{$allocaddr}; undef $wherewas{$allocaddr}; + } elsif ($allocaddr == 0) { + # Ignore free (0) + undef $wherewas{$allocaddr}; } else { printf ("- %#0@XXX@x Free %d was never alloc'd %s\n", hex($allocaddr), $nr, &location($where)); -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From drepper@redhat.com Thu Jul 13 10:34:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Thu, 13 Jul 2000 10:34:00 -0000 Subject: libposix References: Message-ID: Andreas Jaeger writes: > Here's a patch. Applied. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@valinux.com Thu Jul 13 13:42:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Thu, 13 Jul 2000 13:42:00 -0000 Subject: A patch for regex.c Message-ID: <20000713134158.A19920@valinux.com> posix/runptests failed on my 4GB RAM machine when run through make. It ran ok by hand. This patch fixes it. The comments indicate 4000 is a better choice. -- H.J. Lu (hjl@gnu.org) -- 2000-07-13 H.J. Lu * posix/regex.c (re_max_failures): Set to 4000. Index: posix/regex.c =================================================================== RCS file: /work/cvs/gnu/glibc/posix/regex.c,v retrieving revision 1.1.1.2 diff -u -p -r1.1.1.2 regex.c --- posix/regex.c 2000/07/12 18:50:17 1.1.1.2 +++ posix/regex.c 2000/07/13 20:35:54 @@ -1234,7 +1234,7 @@ typedef struct # if defined MATCH_MAY_ALLOCATE /* 4400 was enough to cause a crash on Alpha OSF/1, whose default stack limit is 2mb. */ -int re_max_failures = 20000; +int re_max_failures = 4000; # else int re_max_failures = 2000; # endif From jakub@redhat.com Thu Jul 13 14:16:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Thu, 13 Jul 2000 14:16:00 -0000 Subject: [PATCH] weak_alias fixes Message-ID: <20000713232045.T17419@sunsite.ms.mff.cuni.cz> Hi! Recently added macro indirection causes trouble with sysconf and getpt (because e.g. on linux getpt is weak alias to __bsd_getpt, not __getpt as it used to be and should be). Following patch should fix it: 2000-07-13 Jakub Jelinek * sysdeps/posix/sysconf.c: Undef __sysconf before weak_alias. * sysdeps/unix/bsd/getpt.c: Undef __getpt before weak_alias. --- libc/sysdeps/posix/sysconf.c.jj Thu Apr 13 05:06:46 2000 +++ libc/sysdeps/posix/sysconf.c Thu Jul 13 17:08:05 2000 @@ -1091,4 +1091,5 @@ __sysconf (name) } } +#undef __sysconf weak_alias (__sysconf, sysconf) --- libc/sysdeps/unix/bsd/getpt.c.jj Tue Jan 4 11:11:59 2000 +++ libc/sysdeps/unix/bsd/getpt.c Thu Jul 13 17:09:25 2000 @@ -74,4 +74,6 @@ __getpt (void) __set_errno (ENOENT); return -1; } + +#undef __getpt weak_alias (__getpt, getpt) Jakub From bmark@us.ibm.com Thu Jul 13 14:19:00 2000 From: bmark@us.ibm.com (Mark Brown) Date: Thu, 13 Jul 2000 14:19:00 -0000 Subject: The libgcc.so for glibc initiative References: <20000712230417.A7729@lucon.org> <200007131112.e6DBCMk00397@delius.kettenis.local> <20000713075706.A9067@lucon.org> Message-ID: <396E325F.93C60630@us.ibm.com> H.J. - I'm going to try another angle on the problem.... "H . J . Lu" wrote: > On Thu, Jul 13, 2000 at 01:12:22PM +0200, Mark Kettenis wrote: > > From: "H . J . Lu" > > Given the current libgcc.so situation, I'd like to start the libgcc.so > > for glibc project. The goals are > > > > 1. Binary compatible with binaries linked with glibc 2.0, 2.1, 2.2 and > > above. > > 2. Stand alone as well as glibc add-on. > > 3. Can be used to upgrade libgcc.so from an installed gcc. > > 4. Support glibc and glibc only. > > 5. Support glibc 2.2 and above. > > 6. Support gcc 2.96 and above. > > > > It can be hosted on sourceforge or under glibc like linuxthreads. Any > > comments? > > > > There's nothing against experimenting with this, and using it as a > > temporary solution util the libgcc.so thing settles down a bit. > > I am just to be realistic. There is no way I can see that gcc can > provide a general solution for libgcc.so on all targets it supports. > It will require the runtime support from the system vendors. I don't > believe gcc can do it on itself. The end result may be a solution > which sort of works, but falls far short for glibc. Given that having "one solution for all platforms" does not sound realistic; and having a libgcc that works well for Linux glibc *is* important -- is there anything that prevents some glibc person(s) working with the gcc libgcc maintainer for Linux, to produce a libgcc that meets our needs? Maybe even produce a spec so that future versions of the libgcc-for-linux will stay compatible? While libgcc.so may be a per-platform issue, I do not see why we cannot work with/educate the appropriate gcc maintainer on this; as long as part of the education includes why we need a libgcc that meets *all* of the glibc needs. Mark -- Mark S. Brown bmark@us.ibm.com IBM RS/6000 AIX System Architecture 512.838.3926 T/L678.3926 IBM Corporation, Austin, Texas From hjl@lucon.org Thu Jul 13 14:28:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Thu, 13 Jul 2000 14:28:00 -0000 Subject: The libgcc.so for glibc initiative References: <20000712230417.A7729@lucon.org> <200007131112.e6DBCMk00397@delius.kettenis.local> <20000713075706.A9067@lucon.org> <396E325F.93C60630@us.ibm.com> Message-ID: <20000713142846.A10436@lucon.org> On Thu, Jul 13, 2000 at 04:19:28PM -0500, Mark Brown wrote: > > Given that having "one solution for all platforms" does not sound realistic; > and having a libgcc that works well for Linux glibc *is* important -- is there > anything that prevents some glibc person(s) working with the gcc libgcc > maintainer for Linux, to produce a libgcc that meets our needs? Maybe even > produce a spec so that future versions of the libgcc-for-linux will stay > compatible? We can give it another try. > > While libgcc.so may be a per-platform issue, I do not see why we cannot > work with/educate the appropriate gcc maintainer on this; as long as > part of the education includes why we need a libgcc that meets *all* > of the glibc needs. Last time when I tried it, they didn't wany any solution which only works for glibc. They want a solution which works on all targets gcc supports. That is why I said the solution they chose would fall far short for glibc. H.J. From bmark@us.ibm.com Thu Jul 13 15:14:00 2000 From: bmark@us.ibm.com (Mark Brown) Date: Thu, 13 Jul 2000 15:14:00 -0000 Subject: The libgcc.so for glibc initiative References: <20000712230417.A7729@lucon.org> <200007131112.e6DBCMk00397@delius.kettenis.local> <20000713075706.A9067@lucon.org> <396E325F.93C60630@us.ibm.com> <20000713142846.A10436@lucon.org> Message-ID: <396E3F1B.93F9F728@us.ibm.com> "H . J . Lu" wrote: > > While libgcc.so may be a per-platform issue, I do not see why we cannot > > work with/educate the appropriate gcc maintainer on this; as long as > > part of the education includes why we need a libgcc that meets *all* > > of the glibc needs. > > Last time when I tried it, they didn't wany any solution which only > works for glibc. They want a solution which works on all targets gcc > supports. That is why I said the solution they chose would fall far > short for glibc. I had a discussion on this point with another gcc SC member, David Edelsohn. He is of the opinion that looking at libgcc as a per-platform item is a valid viewpoint, and agrees that maybe there needs to be a version done for gibc. He's not the only one who feels that way -- don't know if he represents the majority or not. this leads me to believe that if we approach this in a non-confrontational matter we might get what we need in this way. Mark -- Mark S. Brown bmark@us.ibm.com IBM RS/6000 AIX System Architecture 512.838.3926 T/L678.3926 IBM Corporation, Austin, Texas From hjl@lucon.org Thu Jul 13 15:44:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Thu, 13 Jul 2000 15:44:00 -0000 Subject: The libgcc.so for glibc initiative References: <20000712230417.A7729@lucon.org> <200007131112.e6DBCMk00397@delius.kettenis.local> <20000713075706.A9067@lucon.org> <396E325F.93C60630@us.ibm.com> <20000713142846.A10436@lucon.org> <396E3F1B.93F9F728@us.ibm.com> Message-ID: <20000713154418.A10677@lucon.org> On Thu, Jul 13, 2000 at 05:13:50PM -0500, Mark Brown wrote: > > > "H . J . Lu" wrote: > > > While libgcc.so may be a per-platform issue, I do not see why we cannot > > > work with/educate the appropriate gcc maintainer on this; as long as > > > part of the education includes why we need a libgcc that meets *all* > > > of the glibc needs. > > > > Last time when I tried it, they didn't wany any solution which only > > works for glibc. They want a solution which works on all targets gcc > > supports. That is why I said the solution they chose would fall far > > short for glibc. > > I had a discussion on this point with another gcc SC member, David > Edelsohn. He is of the opinion that looking at libgcc as a per-platform > item is a valid viewpoint, and agrees that maybe there needs to be a version > done for gibc. He's not the only one who feels that way -- don't know if he > represents the majority or not. I am very glad to hear that. > > this leads me to believe that if we approach this in a non-confrontational > matter we might get what we need in this way. The main objection comes from Jeff Law. Here is his typical view on glibc and Linux in general: http://gcc.gnu.org/ml/gcc/2000-07/msg00376.html He doesn't start thinking this way just a few days ago. I learned it years ago. And I think he will object anything I propose for glibc/Linux. Maybe someone else besides me and Ulrich should push the issue with a different approach. However, we cannot just wait here for something to happen in the meantime. Thanks for your time. H.J. From kettenis@wins.uva.nl Thu Jul 13 16:12:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Thu, 13 Jul 2000 16:12:00 -0000 Subject: The libgcc.so for glibc initiative References: <20000712230417.A7729@lucon.org> <200007131112.e6DBCMk00397@delius.kettenis.local> <20000713075706.A9067@lucon.org> <396E325F.93C60630@us.ibm.com> <20000713142846.A10436@lucon.org> <396E3F1B.93F9F728@us.ibm.com> <20000713154418.A10677@lucon.org> Message-ID: <200007132312.e6DNCLM00809@delius.kettenis.local> Date: Thu, 13 Jul 2000 15:44:18 -0700 From: "H . J . Lu" On Thu, Jul 13, 2000 at 05:13:50PM -0500, Mark Brown wrote: > > > "H . J . Lu" wrote: > > > While libgcc.so may be a per-platform issue, I do not see why we cannot > > > work with/educate the appropriate gcc maintainer on this; as long as > > > part of the education includes why we need a libgcc that meets *all* > > > of the glibc needs. > > > > Last time when I tried it, they didn't wany any solution which only > > works for glibc. They want a solution which works on all targets gcc > > supports. That is why I said the solution they chose would fall far > > short for glibc. What's wrong with requesting a solution that isn't Linux/glibc specific for a problem that isn't Linux/glibc specific? > I had a discussion on this point with another gcc SC member, > David Edelsohn. He is of the opinion that looking at libgcc as a > per-platform item is a valid viewpoint, and agrees that maybe > there needs to be a version done for gibc. He's not the only one > who feels that way -- don't know if he represents the majority or > not. I am very glad to hear that. Looking at libgcc as a per-platform item may be a valid viewpoint, but certainly not the only one. There's a huge part of the current libgcc that's pretty much per-architecture. There's also a lot of C++ support code for which I cannot find a reason not to share among platforms. > > this leads me to believe that if we approach this in a non-confrontational > matter we might get what we need in this way. The main objection comes from Jeff Law. Here is his typical view on glibc and Linux in general: http://gcc.gnu.org/ml/gcc/2000-07/msg00376.html And what's wrong with that? `All the world's not Linux' sounds like a good attitude for a compiler that already works on a lot of platforms and should be portable to others without much effort. He doesn't start thinking this way just a few days ago. I learned it years ago. And I think he will object anything I propose for glibc/Linux. Maybe someone else besides me and Ulrich should push the issue with a different approach. However, we cannot just wait here for something to happen in the meantime. Please keep your personal grudge against Jeff out of this HJ. Mark From hjl@lucon.org Thu Jul 13 19:24:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Thu, 13 Jul 2000 19:24:00 -0000 Subject: The libgcc.so for glibc initiative References: <20000712230417.A7729@lucon.org> <200007131112.e6DBCMk00397@delius.kettenis.local> <20000713075706.A9067@lucon.org> <396E325F.93C60630@us.ibm.com> <20000713142846.A10436@lucon.org> <396E3F1B.93F9F728@us.ibm.com> <20000713154418.A10677@lucon.org> <200007132312.e6DNCLM00809@delius.kettenis.local> Message-ID: <20000713192434.B11412@lucon.org> On Fri, Jul 14, 2000 at 01:12:21AM +0200, Mark Kettenis wrote: > > > > > > Last time when I tried it, they didn't wany any solution which only > > > works for glibc. They want a solution which works on all targets gcc > > > supports. That is why I said the solution they chose would fall far > > > short for glibc. > > What's wrong with requesting a solution that isn't Linux/glibc > specific for a problem that isn't Linux/glibc specific? > Nothing if you can find one. > > I had a discussion on this point with another gcc SC member, > > David Edelsohn. He is of the opinion that looking at libgcc as a > > per-platform item is a valid viewpoint, and agrees that maybe > > there needs to be a version done for gibc. He's not the only one > > who feels that way -- don't know if he represents the majority or > > not. > > I am very glad to hear that. > > Looking at libgcc as a per-platform item may be a valid viewpoint, but > certainly not the only one. There's a huge part of the current libgcc > that's pretty much per-architecture. There's also a lot of C++ > support code for which I cannot find a reason not to share among > platforms. > Do you have an alternative? I am not against a solution which works for all targets and also meets the glibc requirement. Thanks. H.J. From wmglo@dent.med.uni-muenchen.de Fri Jul 14 02:11:00 2000 From: wmglo@dent.med.uni-muenchen.de (Wolfram Gloger) Date: Fri, 14 Jul 2000 02:11:00 -0000 Subject: Memory bug fixed References: <200007131439.QAA10240@hawking.suse.de> Message-ID: <20000714091119.11905.qmail@md.dent.med.uni-muenchen.de> > From: Andreas Jaeger > > >>>>> Ulrich Drepper writes: > > Uli> Andreas Jaeger writes: > >> Shall I revert the patch and change fgetspent.c also? Should we teach > >> mtrace to not emit an error message for free(0) ? > > Uli> Yes and yes. > > Here's a patch. Is this one ok? > > Andreas > > 2000-07-13 Andreas Jaeger > > * malloc/mtrace.pl (location): Ignore free(0). > > * sysdeps/unix/sysv/linux/getsysstats.c (free_mem): Revert last > patch. > > * grp/fgetgrent.c (free_mem): Remove if - free (0) is valid. Just to add my 2 cents -- this is exactly the right approach. Keep in mind that free(0) extends to C++, and `delete p' with p==0 is even more common than in C. Memory debuggers should always ignore it, at the very least there needs to be a switch in them defaulting to `off' WRT to checking for free(0) explicitly. Regards, Wolfram. From aj@suse.de Fri Jul 14 02:16:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Fri, 14 Jul 2000 02:16:00 -0000 Subject: Memory bug fixed References: <200007131439.QAA10240@hawking.suse.de> <200007140856.KAA61337@max.zk-i.med.uni-muenchen.de> Message-ID: >>>>> Wolfram Gloger writes: >> From: Andreas Jaeger >> >> >>>>> Ulrich Drepper writes: >> Uli> Andreas Jaeger writes: >> >> Shall I revert the patch and change fgetspent.c also? Should we teach >> >> mtrace to not emit an error message for free(0) ? >> Uli> Yes and yes. >> >> Here's a patch. Is this one ok? >> >> Andreas >> >> 2000-07-13 Andreas Jaeger >> >> * malloc/mtrace.pl (location): Ignore free(0). >> >> * sysdeps/unix/sysv/linux/getsysstats.c (free_mem): Revert last >> patch. >> >> * grp/fgetgrent.c (free_mem): Remove if - free (0) is valid. Wolfram> Just to add my 2 cents -- this is exactly the right approach. Keep in Wolfram> mind that free(0) extends to C++, and `delete p' with p==0 is even Wolfram> more common than in C. Memory debuggers should always ignore it, at Wolfram> the very least there needs to be a switch in them defaulting to `off' Wolfram> WRT to checking for free(0) explicitly. I've added my patch but didn't add the mtrace.pl change since Uli commited last night: * malloc/mtrace.c (tr_freehook): Return immediately if ptr is NULL. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From drepper@redhat.com Fri Jul 14 02:22:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 14 Jul 2000 02:22:00 -0000 Subject: big new file Message-ID: After a few more revisions the gb18030 file is now usable. I don't know whether it's correct. Hopefully we'll get a test suite. The source file is still 2.8MB in size. The good news is that the binary is <300kB (instead of the 14MB the original submission produced). -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From aj@suse.de Fri Jul 14 04:06:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Fri, 14 Jul 2000 04:06:00 -0000 Subject: big new file References: Message-ID: >>>>> Ulrich Drepper writes: > After a few more revisions the gb18030 file is now usable. I don't > know whether it's correct. Hopefully we'll get a test suite. > The source file is still 2.8MB in size. The good news is that the > binary is <300kB (instead of the 14MB the original submission produced). Whow! Fine. Is there no corresponding charmap file for the localedata dir? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From kettenis@wins.uva.nl Fri Jul 14 07:25:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Fri, 14 Jul 2000 07:25:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <20000711134337.A16026@valinux.com> <20000711150216.A16199@valinux.com> Message-ID: <200007141425.e6EEP5R02346@delius.kettenis.local> From: Alexandre Oliva Date: 13 Jul 2000 18:35:37 -0300 On Jul 11, 2000, Alexandre Oliva wrote: > Why, then, should glibc people take over the creation of this shared > library for GNU/Linux systems? Now here's one additional, interesting problem. Assume libgcc is a shared library. It has obviously been linked with some version of libc, given that it uses symbols from libc. This means it will have a dependency on some particular libc SONAME encoded in it. That isn't necessary per se. You can have undefined references in a shared library. Now think of glibc: since it uses libgcc, it will also have some particular libgcc SONAME encoded in it. But libgcc already depended on libc, so we have a circularity. No big deal: each library will only be loaded once, and everything is fine, right? Despite the minor problem of how to bootstrap this situation. The bootstrapping problem is solvable with DT_AUXILIARY. If libc contains a DT_AUXILIARY entry for libgcc, instead of an ordinary dependency (DT_NEEDED), libc will only use libgcc if it does exist. This means that libc itself would still have to contain copies of the stuff from libgcc that it explicitly exports now, but these could become dummy versions in the long run. But there's a major problem too. What if I decide to upgrade one of GCC or glibc. What now? New programs I create will depend on the most recent libgcc and glibc, but one of the libraries (the one that was not updated) will depend on the older version of the other. So, if I had upgraded GCC, I'd have two different, potentially incompatible versions, of libgcc loaded into the same process. I'm afraid this may not work. That's why the initial message on the gcc lists where the GCC devlopers announced their intention to turn libgcc into a shared library worried me so much. The current libgcc.a contains some stuff that IMHO isn't suitable to put into the shared libgcc. Tightly controlling the libgcc.so ABI is extremely important. The SONAME of libgcc can *never* change (at least not without changing the libc SONAME too) on Linux and the Hurd. On the bright side these systems use the complete GNU toolchain which means that we have a lot more tools to avoid this than other platforms. This discussion has far too much focussed on the question who'll have to build the shared libgcc. And that part of the discussion hasn't been terribly productive. And actually building a shared libgcc *before* the GCC team is committed to mainting binary compatibility of the stuff we're going to put into it is pointless. Instead I'd like to start working with the GCC team on establishing an ABI for that shared libgcc. I could sure use some assistence on that from GCC developers interested in Linux. Mark From drepper@redhat.com Fri Jul 14 08:39:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 14 Jul 2000 08:39:00 -0000 Subject: big new file References: Message-ID: Andreas Jaeger writes: > Is there no corresponding charmap file for the localedata dir? I don't have any yet. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kettenis@wins.uva.nl Fri Jul 14 09:28:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Fri, 14 Jul 2000 09:28:00 -0000 Subject: Fix for PR libc/1686 Message-ID: <200007141628.e6EGS4D13965@delius.kettenis.local> Here's the promised patch. I'll close the PR once this has been installed. Mark 2000-07-14 Mark Kettenis * configure.in: Check for pwd binary. * config.make.in: Add PWD_P to be subsituted. * Makerules: Use $(PWD_P) instead of /bin/pwd. Index: configure.in =================================================================== RCS file: /cvs/glibc/libc/configure.in,v retrieving revision 1.281 diff -u -p -r1.281 configure.in --- configure.in 2000/07/06 23:28:54 1.281 +++ configure.in 2000/07/14 16:23:31 @@ -505,6 +505,16 @@ if test "$INSTALL" = "${srcdir}/scripts/ fi AC_PROG_LN_S +# We need the physical current working directory. We cannot use the +# "pwd -P" shell builtin since that's not portable. Instead we try to +# find a pwd binary. Note that assigning to the PWD environment +# variable might have some interesting side effects, so we don't do +# that. +AC_PATH_PROG(PWD_P, pwd, no) +if test "$PWD_P" = no; then + AC_MSG_ERROR(*** A pwd binary could not be found.) +fi + # These programs are version sensitive. AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v, Index: Makerules =================================================================== RCS file: /cvs/glibc/libc/Makerules,v retrieving revision 1.339 diff -u -p -r1.339 Makerules --- Makerules 2000/06/21 18:15:14 1.339 +++ Makerules 2000/07/14 16:23:32 @@ -985,7 +985,7 @@ endif s = $(sysdep_dir)/generic $(objpfx)stubs: $(+depfiles) # Use /dev/null since `...` might expand to empty. - (s=`cd $s && /bin/pwd`; \ + (s=`cd $s && $(PWD_P)`; \ $(patsubst %/,cd % &&,$(objpfx)) \ sed -n 's/^stub_warning *(\([^)]*\).*$$/#define __stub_\1/p' \ `sed -n -e '\@ $s/[^ ]*\.c@{; s@^.* $s/\([^ ]*\.c\).*$$@'"$$s"'/\1@; h; }' \ Index: config.make.in =================================================================== RCS file: /cvs/glibc/libc/config.make.in,v retrieving revision 1.68 diff -u -p -r1.68 config.make.in --- config.make.in 2000/05/23 19:22:55 1.68 +++ config.make.in 2000/07/14 16:23:32 @@ -75,6 +75,7 @@ RANLIB = @RANLIB@ MAKEINFO = @MAKEINFO@ AS = $(CC) -c MIG = @MIG@ +PWD_P = @PWD_P@ # Installation tools. INSTALL = @INSTALL@ From drepper@redhat.com Fri Jul 14 09:43:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 14 Jul 2000 09:43:00 -0000 Subject: Fix for PR libc/1686 References: <200007141628.e6EGS4D13965@delius.kettenis.local> Message-ID: Mark Kettenis writes: > Here's the promised patch. > > I'll close the PR once this has been installed. I've installed the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kettenis@wins.uva.nl Fri Jul 14 12:25:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Fri, 14 Jul 2000 12:25:00 -0000 Subject: Update to BIND-8.2.3-TB5 Message-ID: <200007141925.e6EJPFj14307@delius.kettenis.local> I've basically done all the work to update the resolver to BIND-8.2.3-TB5. This is the current beta release, and < http://www.isc.org/products/BIND > says that "This is prerelease code and is not intended for production use." However, the announcement says that it is a release candidate, and the code contains some bug fixes and real improvements, so I'm pretty confident that we can safely use this code. And I intend to closely track the official BIND distribution and update glibc accordingly. However there are some things I'd like your opinion on: * I've tried to reduce the diffs with the official BIND sources to a minimum. This means that my patch will contain some gratitious white-space changes and that I've reintroduced __P is . The rationale being that it is easier to spot any real changes when imporing a new BIND version. * I've changed all RCS $Id$ strings into $BINDId$. This should prevent CVS from doing its keyword substitution, such that we retain the origional version information. Again this makes it easier to spot which files have been changed in BIND with respect to the previous import. * I've changed the implementation of how the resolver behaves in a multi-threaded context as follows: 1. The "old" thread-unsafe interfaces (e.g. res_init(), res_query(), res_search() etc.) always act on a static resolver state (the global variable _res). 2. All threads, except the main thread, have their own resolver state, and _res is a macro that uses the function __res_state() to get the per-thread resolver state. The main thread continues to use the static resolver state in the global variable _res (which is normally hidden by the _res macro). The motivation for this setup is that it makes it possible to use legacy code that uses the "old" interfaces in the main thread without any problems (including setting _res.options before calling res_init()). Solaris has a similar restriction. Even code that sets _res.options in the main thread and calls the "old" interfaces in other threads will still work as expected if locking is used to prevent two threads from concurrently using the static resolver state. Modifying _res.options in other threads will seem to have no effect when using these "old" interfaces. To be really thread-safe, programs should use the new interfaces of course. The macro _res is there for their (and our, since we use it in the dns NSS module) convenience to avoid the need of allocating their own. Of course this was already how Andreas implemented things, except that for some curious reason he modified res_libc.c such that res_init() now uses the thread-specific resolver state, whereas the rest of the old functions still use the static resolver state. That cannot be right, and I think that's why people noticed some problems. If people agree with this, I'll try to wrap up some documentation. * BIND-8.2.3-TB5 uses a double underscore on all exported functions. Are there strong reasons not to do this? If not, I'll add an alias for the old symbols that didn't have the double underscore and additionally export the double underscored version, and I'll export those new functions that are documented in the resolver(3) man page that comes with BIND-8.2.3-TB5 with a double underscore. I think this might avoid some problems with programs that link with libbind (which also contains the reolver code and use our dns NSS module. The alternative is to export all documented symbols without the double underscore, and add aliases for those symbols that were previously exported with a double underscore. Mark From kettenis@wins.uva.nl Fri Jul 14 13:27:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Fri, 14 Jul 2000 13:27:00 -0000 Subject: Fix compiler warning Message-ID: <200007142027.e6EKRW227016@delius.kettenis.local> Subject says it all. Mark 2000-07-14 Mark Kettenis * dlfcn/dlerror.c (free_key_mem): Add cast to silence compiler warning. Index: dlfcn/dlerror.c =================================================================== RCS file: /cvs/glibc/libc/dlfcn/dlerror.c,v retrieving revision 1.5 diff -u -p -r1.5 dlerror.c --- dlfcn/dlerror.c 2000/07/13 19:39:54 1.5 +++ dlfcn/dlerror.c 2000/07/14 20:26:35 @@ -159,7 +159,7 @@ free_key_mem (void *mem) if (result->errstring != NULL && strcmp (result->errstring, "out of memory") != 0) - free (result->errstring); + free ((char *)result->errstring); free (mem); __libc_setspecific (key, NULL); From hjl@lucon.org Fri Jul 14 13:29:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Fri, 14 Jul 2000 13:29:00 -0000 Subject: Fix compiler warning References: <200007142027.e6EKRW227016@delius.kettenis.local> Message-ID: <20000714132914.A13885@lucon.org> On Fri, Jul 14, 2000 at 10:27:32PM +0200, Mark Kettenis wrote: > Subject says it all. > > Mark > > > 2000-07-14 Mark Kettenis > > * dlfcn/dlerror.c (free_key_mem): Add cast to silence compiler > warning. > > > Index: dlfcn/dlerror.c > =================================================================== > RCS file: /cvs/glibc/libc/dlfcn/dlerror.c,v > retrieving revision 1.5 > diff -u -p -r1.5 dlerror.c > --- dlfcn/dlerror.c 2000/07/13 19:39:54 1.5 > +++ dlfcn/dlerror.c 2000/07/14 20:26:35 > @@ -159,7 +159,7 @@ free_key_mem (void *mem) > > if (result->errstring != NULL > && strcmp (result->errstring, "out of memory") != 0) > - free (result->errstring); > + free ((char *)result->errstring); > Why not (void *) which is used in prototype? H.J. From drepper@redhat.com Fri Jul 14 13:37:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 14 Jul 2000 13:37:00 -0000 Subject: Fix compiler warning References: <200007142027.e6EKRW227016@delius.kettenis.local> Message-ID: Mark Kettenis writes: > 2000-07-14 Mark Kettenis > > * dlfcn/dlerror.c (free_key_mem): Add cast to silence compiler > warning. I've checked in the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Fri Jul 14 13:39:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 14 Jul 2000 13:39:00 -0000 Subject: Fix compiler warning References: <200007142027.e6EKRW227016@delius.kettenis.local> <20000714132914.A13885@lucon.org> Message-ID: "H . J . Lu" writes: > Why not (void *) which is used in prototype? Mark copied only what I did in similar places (or at least I can explain it this way). I prefer char* here since it shows that this is actually a modifiable string. If I use a cast to void* I normally do something much dirtier, like casting a long to a pointer. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kettenis@wins.uva.nl Fri Jul 14 13:41:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Fri, 14 Jul 2000 13:41:00 -0000 Subject: Fix compiler warning References: <200007142027.e6EKRW227016@delius.kettenis.local> <20000714132914.A13885@lucon.org> Message-ID: <200007142041.e6EKfp527165@delius.kettenis.local> Date: Fri, 14 Jul 2000 13:29:14 -0700 From: "H . J . Lu" On Fri, Jul 14, 2000 at 10:27:32PM +0200, Mark Kettenis wrote: > Subject says it all. > > Mark > > > 2000-07-14 Mark Kettenis > > * dlfcn/dlerror.c (free_key_mem): Add cast to silence compiler > warning. > > > Index: dlfcn/dlerror.c > =================================================================== > RCS file: /cvs/glibc/libc/dlfcn/dlerror.c,v > retrieving revision 1.5 > diff -u -p -r1.5 dlerror.c > --- dlfcn/dlerror.c 2000/07/13 19:39:54 1.5 > +++ dlfcn/dlerror.c 2000/07/14 20:26:35 > @@ -159,7 +159,7 @@ free_key_mem (void *mem) > > if (result->errstring != NULL > && strcmp (result->errstring, "out of memory") != 0) > - free (result->errstring); > + free ((char *)result->errstring); > Why not (void *) which is used in prototype? A matter of taste I think. The cast is neccessary to get rid of the "const", not because it isn't a pointer type. There are a couple of similar cases in the same file and Ulrich used (char *) there too. By the way, to be consistent with the rest of the code there should be a space between (char *) and result->errstring. Mark From hjl@lucon.org Fri Jul 14 13:46:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Fri, 14 Jul 2000 13:46:00 -0000 Subject: bug in dynamic linker References: <963602772.24226.ezmlm@sources.redhat.com> Message-ID: <20000714134624.A13985@lucon.org> On Fri, Jul 14, 2000 at 04:35:03PM -0400, Peter A Barros wrote: > > I have been getting this error message when i try to do an ldd on certain > files. I upgraded from binutils 2.95 to 2.10 hoping it would solve the > problem, but it did not. Here's what it looks like: > > BUG IN DYNAMIC LINKER ld.so: dl-version.c: 210: _dl_check_map_versions: > Assertion 'needed != ((void *)0)' failed! > > I recently installed RedHat 6.2, XFree 4.0.1, on a i686 pentium II w 400 > MHz > > I realize there's already been alot of discussion about this particular > error, but i swear I could not find the *solution* to it. > Its probably out there, but I just can't find it. > > If someone would be so kind as to spell it out for me, I would be very > grateful The dynamic linker is in glibc, not binutils. Please tell us exactly how to reproduce it. H.J. From drepper@redhat.com Fri Jul 14 14:01:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 14 Jul 2000 14:01:00 -0000 Subject: bug in dynamic linker References: <963602772.24226.ezmlm@sources.redhat.com> <20000714134624.A13985@lucon.org> Message-ID: "H . J . Lu" writes: > The dynamic linker is in glibc, not binutils. Please tell us exactly > how to reproduce it. But the problem is nevertheless most probably in binutils. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kettenis@wins.uva.nl Fri Jul 14 15:46:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Fri, 14 Jul 2000 15:46:00 -0000 Subject: Alleged bug in resolver code Message-ID: <200007142246.e6EMkjo00373@delius.kettenis.local> Hi HJ, Back in may you reported the following: Hi, I am working on several bugs in glibc 2.2. I had an impression that glibc 2.2 was very unstable. I was wondering how many people were using glibc 2.2. To start, There are struct __res_state _res; and void res_close(void) { res_nclose(&_res); } void res_nclose(res_state statp) { if (statp->_sock >= 0) { (void) close(statp->_sock); statp->_sock = -1; statp->_flags &= ~(RES_F_VC | RES_F_CONN); } } since _res._sock is 0, close (0) is called. It is very bad when 0 may be a valid fd for something else. I'm willing to believe that you actualy saw if bug, but the suggested fix (initializing _res._sock to -1, and doing the same for the per-thread resolver state) that was checked in cannot be the right solution. You see, calling res_close() without first sucessfully having called res_init(), or calling res_nclose(statp) without res_ninit(statp) is simply a programming mistake, and will obviously invoke undefined behaviour (such as close(0)). This behaviour isn't any different than what the resolver in glibc 2.1 did. As such, what you describe here obviously isn't a bug. Now there is actually a problem with res_init() in multi-threaded programs that might have caused the problems you were seeing. Unfortunately your report didn't provide a test-case either. Could you privide one? If so I'm willing to do some additional testing, before sending my updated BIND code to Ulrich. Mark From hjl@lucon.org Fri Jul 14 15:56:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Fri, 14 Jul 2000 15:56:00 -0000 Subject: Alleged bug in resolver code References: <200007142246.e6EMkjo00373@delius.kettenis.local> Message-ID: <20000714155602.A14421@lucon.org> On Sat, Jul 15, 2000 at 12:46:45AM +0200, Mark Kettenis wrote: > Hi HJ, > > Back in may you reported the following: > > Hi, > > I am working on several bugs in glibc 2.2. I had an impression that > glibc 2.2 was very unstable. I was wondering how many people were > using glibc 2.2. To start, > > There are > > struct __res_state _res; > > and > > void > res_close(void) { > res_nclose(&_res); > } > > void > res_nclose(res_state statp) { > if (statp->_sock >= 0) { > (void) close(statp->_sock); > statp->_sock = -1; > statp->_flags &= ~(RES_F_VC | RES_F_CONN); > } > } > > since _res._sock is 0, close (0) is called. It is very bad > when 0 may be a valid fd for something else. > > I'm willing to believe that you actualy saw if bug, but the suggested > fix (initializing _res._sock to -1, and doing the same for the > per-thread resolver state) that was checked in cannot be the right > solution. You see, calling res_close() without first sucessfully > having called res_init(), or calling res_nclose(statp) without > res_ninit(statp) is simply a programming mistake, and will obviously > invoke undefined behaviour (such as close(0)). This behaviour isn't > any different than what the resolver in glibc 2.1 did. As such, what > you describe here obviously isn't a bug. I have no idea what your glibc 2.1 looks like. Mine has static int s = -1; /* socket used for communications */ static int connected = 0; /* is the socket connected */ static int vc = 0; /* is the socket a virtual circuit? */ .... static void res_close_internal() { if (s >= 0) { (void) close(s); s = -1; connected = 0; vc = 0; } } void res_close () { __libc_lock_lock (lock); res_close_internal (); __libc_lock_unlock (lock); } It is 100% ok to call res_close () without calling res_init () first in my glibc 2.1. > > Now there is actually a problem with res_init() in multi-threaded > programs that might have caused the problems you were seeing. > Unfortunately your report didn't provide a test-case either. Could > you privide one? If so I'm willing to do some additional testing, > before sending my updated BIND code to Ulrich. > The program I was having trouble with is pump from Red Hat. H.J. From kettenis@wins.uva.nl Fri Jul 14 17:09:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Fri, 14 Jul 2000 17:09:00 -0000 Subject: Alleged bug in resolver code References: <200007142246.e6EMkjo00373@delius.kettenis.local> <20000714155602.A14421@lucon.org> Message-ID: <200007150009.e6F09J700612@delius.kettenis.local> Date: Fri, 14 Jul 2000 15:56:02 -0700 From: "H . J . Lu" On Sat, Jul 15, 2000 at 12:46:45AM +0200, Mark Kettenis wrote: > I'm willing to believe that you actualy saw if bug, but the suggested > fix (initializing _res._sock to -1, and doing the same for the > per-thread resolver state) that was checked in cannot be the right > solution. You see, calling res_close() without first sucessfully > having called res_init(), or calling res_nclose(statp) without > res_ninit(statp) is simply a programming mistake, and will obviously > invoke undefined behaviour (such as close(0)). This behaviour isn't > any different than what the resolver in glibc 2.1 did. As such, what > you describe here obviously isn't a bug. I have no idea what your glibc 2.1 looks like. Mine has static int s = -1; /* socket used for communications */ static int connected = 0; /* is the socket connected */ static int vc = 0; /* is the socket a virtual circuit? */ Oops. Looks like I looked in the wrong places. It is 100% ok to call res_close () without calling res_init () first in my glibc 2.1. The fact that it simply works in glibc 2.1 doesn't mean it's right. 1. res_close() is undocumented, it's not in the glibc manual, not on the Linux resolver(3) man page, not on the BIND-4.9.7-REL resolver(3) not on any of the BSD resolver(3) man pages. Heck it's not even exported by the Solaris /usr/lib/libresolv.so.2 library. 2. res_close() is clearly marked with: /* * This routine is for closing the socket if a virtual circuit is used and * the program wants to close it. This provides support for endhostent() * which expects to close the socket. * * This routine is not expected to be user visible. */ Unfortunately this has become a bit less clear in glibc 2.1 because of renaming the origional function to res_close_internal(). 3. Calling res_close() before res_init() makes absolutely no sense. > > Now there is actually a problem with res_init() in multi-threaded > programs that might have caused the problems you were seeing. > Unfortunately your report didn't provide a test-case either. Could > you privide one? If so I'm willing to do some additional testing, > before sending my updated BIND code to Ulrich. > The program I was having trouble with is pump from Red Hat. Thanks for the info! [After having a struggle with RPM] Looks like a piece of shoddy software to me. I don't think its existence is enough reason for us to put another 512+ bytes in the data segment. A better fix would be to check if RES_INIT is set in _res.options and bail out if it isn't in res_close(). But IMHO pump should be fixed. Unfortunately for Red Hat they make it too hard for me to file a bug report, so they loose. Mark From kettenis@wins.uva.nl Fri Jul 14 17:24:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Fri, 14 Jul 2000 17:24:00 -0000 Subject: bug in dynamic linker References: <963602772.24226.ezmlm@sources.redhat.com> <20000714134624.A13985@lucon.org> Message-ID: <200007150024.e6F0OS600636@delius.kettenis.local> From: Ulrich Drepper Date: 14 Jul 2000 14:01:20 -0700 "H . J . Lu" writes: > The dynamic linker is in glibc, not binutils. Please tell us exactly > how to reproduce it. But the problem is nevertheless most probably in binutils. Then we should fix the message that's printed by the dynamic linker. Right now it says "BUG IN DYNAMIC LINKER" whenever we fail an assertion. It looks as if most of these failed assertions actually indicate corrupt binaries. Unfortunately I find it very hard to tell which, so I cannot be of much help here :-( Mark From drepper@redhat.com Fri Jul 14 17:37:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Fri, 14 Jul 2000 17:37:00 -0000 Subject: bug in dynamic linker References: <963602772.24226.ezmlm@sources.redhat.com> <20000714134624.A13985@lucon.org> <200007150024.e6F0OS600636@delius.kettenis.local> Message-ID: Mark Kettenis writes: > Then we should fix the message that's printed by the dynamic linker. > Right now it says "BUG IN DYNAMIC LINKER" whenever we fail an > assertion. It looks as if most of these failed assertions actually > indicate corrupt binaries. It means this almost 100% of the times for established ports. For new ports there might very well be a problem in ld.so and this is where I expect the message to be used inthe first place. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@lucon.org Fri Jul 14 17:57:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Fri, 14 Jul 2000 17:57:00 -0000 Subject: Alleged bug in resolver code References: <200007142246.e6EMkjo00373@delius.kettenis.local> <20000714155602.A14421@lucon.org> <200007150009.e6F09J700612@delius.kettenis.local> Message-ID: <20000714175717.A14830@lucon.org> On Sat, Jul 15, 2000 at 02:09:19AM +0200, Mark Kettenis wrote: > > [After having a struggle with RPM] > > Looks like a piece of shoddy software to me. I don't think its > existence is enough reason for us to put another 512+ bytes in the > data segment. A better fix would be to check if RES_INIT is set in > _res.options and bail out if it isn't in res_close(). But IMHO pump > should be fixed. Unfortunately for Red Hat they make it too hard for > me to file a bug report, so they loose. > I don't like RedHat bug report either :-). I think people from Red Hat are on this mailing list. In any case, I don't have any problems to back out those 2 patches as long as you send me your patch on pump. Thanks. H.J. From kettenis@wins.uva.nl Fri Jul 14 18:03:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Fri, 14 Jul 2000 18:03:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <5003.963333245@upchuck> <20000711134337.A16026@valinux.com> <20000711150216.A16199@valinux.com> <200007141425.e6EEP5R02346@delius.kettenis.local> <200007141944.MAA01180@localhost.cygnus.com> Message-ID: <200007150103.e6F13Fw00690@delius.kettenis.local> Date: Fri, 14 Jul 2000 12:44:29 -0700 From: Geoff Keating > Tightly controlling the libgcc.so ABI is extremely important. The > SONAME of libgcc can *never* change (at least not without changing the > libc SONAME too) on Linux and the Hurd. On the bright side these > systems use the complete GNU toolchain which means that we have a lot > more tools to avoid this than other platforms. Yes, this is required. I think it's a good idea for other platforms too. Sure :-). It doesn't require any special tools---to be precise, special tools don't help. Well, we need the help from our tools on Linux to solve the the problem with the frame functions living in glibc (versioning and perhaps DT_AUXILIARY). For instance, symbol versioning is to solve the problem of how to have two functions named printf(), but this isn't needed for libgcc because if we (say) want to change the interface of _adddi3, then we can just call the new function _adddi3_2. Which is so simple that it probably works for all platforms (although you'd probably call it _adddi4 :-)). ... > And actually building a shared libgcc > *before* the GCC team is committed to mainting binary compatibility of > the stuff we're going to put into it is pointless. > Instead I'd like to start working with the GCC team on establishing an > ABI for that shared libgcc. I could sure use some assistence on that > from GCC developers interested in Linux. The GCC team is already committed to binary compatibility with older versions of gcc, like 2.95.2, so we could start with that. In fact, we have to start with that. I'm afraid gcc 2.8 and the various egcs releases will have to be taken into account, at least for various x86 targets, and at least for plain C. A lot of C++ devlopers still use egcs 1.1.2 since allegedly gcc 2.95.2 tends to produce too many ICE's. Linking with older object files and static libraries isn't essential, but interaction with shared libraries is. But I think that's doable, it just takes some time to do some field testing, the problem being that stuff on development machines tends to be recompiled too often, making it hard to find old libraries. Now, what else would we like? As a starting point, I think that if we're going to change the frame.o ABI, we should change it to something more future-proof. Or do we want to export the eh.o ABI? In that case we'd better wait for the new C++ ABI, too. The frame.o (now mostly frame-dwarf2.o I guess) and eh.o modules are coupled via __frame_state_for(). The problems that more or less started this thread suggest that __frame_state_for() was (accidently) regarded as an internal interface. In that case the frame.o and eh.o modules have to match, and the EH ABI would have to be fixed as well. Mark From kettenis@wins.uva.nl Fri Jul 14 18:12:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Fri, 14 Jul 2000 18:12:00 -0000 Subject: Alleged bug in resolver code References: <200007142246.e6EMkjo00373@delius.kettenis.local> <20000714155602.A14421@lucon.org> <200007150009.e6F09J700612@delius.kettenis.local> <20000714175717.A14830@lucon.org> Message-ID: <200007150112.e6F1CnQ00728@delius.kettenis.local> Date: Fri, 14 Jul 2000 17:57:17 -0700 From: "H . J . Lu" I don't like RedHat bug report either :-). I think people from Red Hat are on this mailing list. In any case, I don't have any problems to back out those 2 patches as long as you send me your patch on pump. Replacing res_close (); with if (_res.options & RES_INIT) res_close (); should do the trick. Mark From hjl@valinux.com Fri Jul 14 18:27:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Fri, 14 Jul 2000 18:27:00 -0000 Subject: The DT_AUXILIARY patch Message-ID: <20000714182733.A29800@valinux.com> Here is the DT_AUXILIARY patch for the shared libgcc. After some experiments, I believe we shouldn't even need libgcc.so under Linux. We just set the DT_AUXILIARY to libgcc.so$(libgcc.so-version). We will only have /lib/libgcc.so$(libgcc.so-version) which is symlinked to /lib/libgcc-3.0.so. /lib/libgcc.so$(libgcc.so-version) is hidden from user. Everything is still linked with libgcc.a. I will provide the libgcc framework soon. It should be trivial to update /lib/libgcc-3.0.so from a new gcc installation. -- H.J. Lu (hjl@gnu.org) -- 2000-07-14 H.J. Lu * Makeconfig (libc-so-aux): Set if libgcc is in $(add-ons). (rpath-dirs): Add libgcc if libgcc is in $(add-ons). * Makerules (+LDLIBS-c.so): Add $(libc-so-aux) Index: Makeconfig =================================================================== RCS file: /work/cvs/gnu/glibc/Makeconfig,v retrieving revision 1.1.1.5 diff -u -p -r1.1.1.5 Makeconfig --- Makeconfig 2000/07/12 20:45:21 1.1.1.5 +++ Makeconfig 2000/07/15 01:13:33 @@ -778,6 +782,11 @@ shared-thread-library = $(common-objpfx) static-thread-library = $(common-objpfx)linuxthreads/libpthread.a have-thread-library = yes rpath-dirs += linuxthreads +endif + +ifneq (,$(findstring libgcc,$(add-ons))) +rpath-dirs += libgcc +libc-so-aux = -Wl,--auxiliary,libgcc.so$(libgcc.so-version) endif ifeq ($(elf),yes) Index: Makerules =================================================================== RCS file: /work/cvs/gnu/glibc/Makerules,v retrieving revision 1.1.1.5 diff -u -p -r1.1.1.5 Makerules --- Makerules 2000/07/14 23:41:11 1.1.1.5 +++ Makerules 2000/07/15 00:55:17 @@ -442,7 +442,7 @@ endef # since we define our own `.init' section specially. LDFLAGS-c.so = -nostdlib -nostartfiles # But we still want to link libc.so against $(gnulib). -LDLIBS-c.so += $(gnulib) +LDLIBS-c.so += $(libc-so-aux) $(gnulib) # Give libc.so an entry point and make it directly runnable itself. LDFLAGS-c.so += -e __libc_main # Force the backward compatibility EH functions to be linked. From hjl@lucon.org Fri Jul 14 18:31:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Fri, 14 Jul 2000 18:31:00 -0000 Subject: The DT_AUXILIARY patch References: <20000714182733.A29800@valinux.com> Message-ID: <20000714183128.A15013@lucon.org> On Fri, Jul 14, 2000 at 06:27:34PM -0700, H . J . Lu wrote: > Here is the DT_AUXILIARY patch for the shared libgcc. After some > experiments, I believe we shouldn't even need libgcc.so under Linux. > We just set the DT_AUXILIARY to libgcc.so$(libgcc.so-version). We will > only have /lib/libgcc.so$(libgcc.so-version) which is symlinked to > /lib/libgcc-3.0.so. /lib/libgcc.so$(libgcc.so-version) is hidden from > user. Everything is still linked with libgcc.a. > BTW, we just need to make sure everything exported from the shared libgcc is also exported from libc.so. I think we will be safe then. H.J. From hjl@lucon.org Fri Jul 14 20:46:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Fri, 14 Jul 2000 20:46:00 -0000 Subject: Alleged bug in resolver code References: <200007142246.e6EMkjo00373@delius.kettenis.local> <20000714155602.A14421@lucon.org> <200007150009.e6F09J700612@delius.kettenis.local> <20000714175717.A14830@lucon.org> <200007150112.e6F1CnQ00728@delius.kettenis.local> Message-ID: <20000714204640.A15214@lucon.org> On Sat, Jul 15, 2000 at 03:12:49AM +0200, Mark Kettenis wrote: > Date: Fri, 14 Jul 2000 17:57:17 -0700 > From: "H . J . Lu" > > I don't like RedHat bug report either :-). I think people from Red Hat > are on this mailing list. In any case, I don't have any problems to > back out those 2 patches as long as you send me your patch on pump. > > Replacing > > res_close (); > > with > > if (_res.options & RES_INIT) > res_close (); > How about this patch instead? If res_nclose is not supposed to be called without initialization, this patch shouldn't break anything. H.J. -- 2000-07-14 H.J. Lu * resolv/res_send.c (res_nclose): Return if not initialized. Index: resolv/res_send.c =================================================================== RCS file: /work/cvs/gnu/glibc/resolv/res_send.c,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 res_send.c --- resolv/res_send.c 2000/05/21 21:11:24 1.1.1.1 +++ resolv/res_send.c 2000/07/15 03:41:40 @@ -924,7 +924,7 @@ res_nsend(res_state statp, */ void res_nclose(res_state statp) { - if (statp->_sock >= 0) { + if ((statp->options & RES_INIT) && statp->_sock >= 0) { (void) close(statp->_sock); statp->_sock = -1; statp->_flags &= ~(RES_F_VC | RES_F_CONN); From greg@mcgary.org Sat Jul 15 00:15:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sat, 15 Jul 2000 00:15:00 -0000 Subject: PATCH: sysdeps/unix/sysv/linux/getcwd.c yet again... Message-ID: <200007150714.AAA25218@kayak.mcgary.org> The (buf==NULL && size > 0) case is still broken. This fixes it: Index: sysdeps/unix/sysv/linux/getcwd.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/getcwd.c,v retrieving revision 1.16 diff -u -p -r1.16 getcwd.c --- getcwd.c 2000/07/13 17:42:32 1.16 +++ getcwd.c 2000/07/15 07:12:09 @@ -104,13 +104,14 @@ __getcwd (char *buf, size_t size) if (retval >= 0) { if (buf == NULL && size == 0) - { - /* Ensure that the buffer is only as large as necessary. */ - buf = realloc (path, (size_t) retval); - if (buf == NULL) - /* `realloc' failed but we still have the original string. */ - buf = path; - } + /* Ensure that the buffer is only as large as necessary. */ + buf = realloc (path, (size_t) retval); + + if (buf == NULL) + /* Either buf was NULL all along, or `realloc' failed but + we still have the original string. */ + buf = path; + return buf; } @@ -156,13 +157,13 @@ __getcwd (char *buf, size_t size) path[n] = '\0'; if (buf == NULL && size == 0) - { - /* Ensure that the buffer is only as large as necessary. */ - buf = realloc (path, (size_t) n + 1); - if (buf == NULL) - /* `relloc' failed but we still have the original string. */ - buf = path; - } + /* Ensure that the buffer is only as large as necessary. */ + buf = realloc (path, (size_t) n + 1); + if (buf == NULL) + /* Either buf was NULL all along, or `realloc' failed but + we still have the original string. */ + buf = path; + return buf; } #ifndef have_new_dcache From aj@suse.de Sat Jul 15 02:57:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Sat, 15 Jul 2000 02:57:00 -0000 Subject: Fix for PR libc/1686 References: <200007141628.e6EGS4D13965@delius.kettenis.local> Message-ID: Thanks Mark. Shouldn't we change the other places also? $ grep -r /bin/pwd . ./ChangeLog: * Makerules: Use $(PWD_P) instead of /bin/pwd. ./ChangeLog.7: pwd as /bin/pwd and /usr/bin/pwd. ./ChangeLog.7: * rellnsh-sh: Use explicitely /bin/pwd to find the external program. ./scripts/rellns-sh:if test -x /bin/pwd; then ./scripts/rellns-sh: pwd=/bin/pwd ./scripts/rellns-sh:elif test -x /usr/bin/pwd; then ./scripts/rellns-sh: pwd=/usr/bin/pwd ./io/ftwtest-sh:tmpreal=`cd $tmp; /bin/pwd 2>/dev/null || /usr/bin/pwd` Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From aj@suse.de Sat Jul 15 03:40:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Sat, 15 Jul 2000 03:40:00 -0000 Subject: translit.po missing? Message-ID: Running make check gives: /bin/sh -e tst-translit.sh /builds/glibc/20000628-main/ /builds/glibc/20000628-main/intl/ error while opening "translit.po" for reading: No such file or directory make[2]: *** [/builds/glibc/20000628-main/intl/tst-translit.out] Error 1 Uli, did you forget to commit translit.po? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From kettenis@wins.uva.nl Sat Jul 15 06:02:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sat, 15 Jul 2000 06:02:00 -0000 Subject: Alleged bug in resolver code References: <200007142246.e6EMkjo00373@delius.kettenis.local> <20000714155602.A14421@lucon.org> <200007150009.e6F09J700612@delius.kettenis.local> <20000714175717.A14830@lucon.org> <200007150112.e6F1CnQ00728@delius.kettenis.local> <20000714204640.A15214@lucon.org> Message-ID: <200007151302.e6FD2Xv01247@delius.kettenis.local> Date: Fri, 14 Jul 2000 20:46:40 -0700 From: "H . J . Lu" On Sat, Jul 15, 2000 at 03:12:49AM +0200, Mark Kettenis wrote: > Date: Fri, 14 Jul 2000 17:57:17 -0700 > From: "H . J . Lu" > > I don't like RedHat bug report either :-). I think people from Red Hat > are on this mailing list. In any case, I don't have any problems to > back out those 2 patches as long as you send me your patch on pump. > > Replacing > > res_close (); > > with > > if (_res.options & RES_INIT) > res_close (); > How about this patch instead? If res_nclose is not supposed to be called without initialization, this patch shouldn't break anything. H.J. -- 2000-07-14 H.J. Lu * resolv/res_send.c (res_nclose): Return if not initialized. I'd rather not do *that*. The res_nclose() function is part of the new thread-safe BIND-8 interfaces. Those interfaces never call res_ninit() themselves (e.g. you always have to pass them an initialize resolver state). Since these interfaces are new in glibc 2.2 there are no backwards compatibility issues, and I think we should I've got less problems with applying a patch similar to yours to res_close(), and I'll add that stuff if others on libc-hacker agree that that's a good idea. However, I still think it's the broken programs that should be fixed. Mark From kettenis@wins.uva.nl Sat Jul 15 06:20:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sat, 15 Jul 2000 06:20:00 -0000 Subject: The DT_AUXILIARY patch References: <20000714182733.A29800@valinux.com> <20000714183128.A15013@lucon.org> Message-ID: <200007151320.e6FDKNY01271@delius.kettenis.local> Date: Fri, 14 Jul 2000 18:31:28 -0700 From: "H . J . Lu" On Fri, Jul 14, 2000 at 06:27:34PM -0700, H . J . Lu wrote: > Here is the DT_AUXILIARY patch for the shared libgcc. After some > experiments, I believe we shouldn't even need libgcc.so under Linux. > We just set the DT_AUXILIARY to libgcc.so$(libgcc.so-version). We will > only have /lib/libgcc.so$(libgcc.so-version) which is symlinked to > /lib/libgcc-3.0.so. /lib/libgcc.so$(libgcc.so-version) is hidden from > user. Everything is still linked with libgcc.a. > BTW, we just need to make sure everything exported from the shared libgcc is also exported from libc.so. I think we will be safe then. That would be an incredibly stupid thing to do, since it means that you'd have to recompile glibc whenever things are added to libgcc.so. You'll probably have to install a libgcc.so linker script in the same directory as libgcc.a, and preferably create a libgcc_nonshared.a there too. Of course this can be postponed until you actually add new stuff to libgcc.so. Mark From kettenis@wins.uva.nl Sat Jul 15 07:00:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sat, 15 Jul 2000 07:00:00 -0000 Subject: Fix for PR libc/1686 References: <200007141628.e6EGS4D13965@delius.kettenis.local> Message-ID: <200007151400.e6FE0oC01353@delius.kettenis.local> From: Andreas Jaeger Date: 15 Jul 2000 11:52:22 +0200 Thanks Mark. Shouldn't we change the other places also? $ grep -r /bin/pwd . ./scripts/rellns-sh:if test -x /bin/pwd; then ./scripts/rellns-sh: pwd=/bin/pwd ./scripts/rellns-sh:elif test -x /usr/bin/pwd; then ./scripts/rellns-sh: pwd=/usr/bin/pwd ./io/ftwtest-sh:tmpreal=`cd $tmp; /bin/pwd 2>/dev/null || /usr/bin/pwd` I considered those, but changing those would mean some "real work", creating rellns-sh from rellns-sh.in or somesuch. Since the scripts already look for both /bin/pwd and /usr/bin/pwd, I didn't think it was important to fix. By the way, io/ftwtest-sh could use io/pwd that comes with glibc :-). Mark From drepper@redhat.com Sat Jul 15 09:03:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 15 Jul 2000 09:03:00 -0000 Subject: translit.po missing? References: Message-ID: Andreas Jaeger writes: > Uli, did you forget to commit translit.po? Yep. The .cvsignore file contains *.po so the file wasn't shown. It's now checked in. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Jul 15 09:07:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 15 Jul 2000 09:07:00 -0000 Subject: Alleged bug in resolver code References: <200007142246.e6EMkjo00373@delius.kettenis.local> <20000714155602.A14421@lucon.org> <200007150009.e6F09J700612@delius.kettenis.local> <20000714175717.A14830@lucon.org> <200007150112.e6F1CnQ00728@delius.kettenis.local> <20000714204640.A15214@lucon.org> <200007151302.e6FD2Xv01247@delius.kettenis.local> Message-ID: Mark Kettenis writes: > I've got less problems with applying a patch similar to yours to > res_close(), and I'll add that stuff if others on libc-hacker agree > that that's a good idea. However, I still think it's the broken > programs that should be fixed. I basically agree with you. But if it is a potential security leak (as in this case since I think it could happen that descriptor 0 is closed) I'm going for it. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@lucon.org Sat Jul 15 10:03:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Sat, 15 Jul 2000 10:03:00 -0000 Subject: The DT_AUXILIARY patch References: <20000714182733.A29800@valinux.com> <20000714183128.A15013@lucon.org> <200007151320.e6FDKNY01271@delius.kettenis.local> Message-ID: <20000715100341.A16991@lucon.org> On Sat, Jul 15, 2000 at 03:20:23PM +0200, Mark Kettenis wrote: > Date: Fri, 14 Jul 2000 18:31:28 -0700 > From: "H . J . Lu" > > On Fri, Jul 14, 2000 at 06:27:34PM -0700, H . J . Lu wrote: > > Here is the DT_AUXILIARY patch for the shared libgcc. After some > > experiments, I believe we shouldn't even need libgcc.so under Linux. > > We just set the DT_AUXILIARY to libgcc.so$(libgcc.so-version). We will > > only have /lib/libgcc.so$(libgcc.so-version) which is symlinked to > > /lib/libgcc-3.0.so. /lib/libgcc.so$(libgcc.so-version) is hidden from > > user. Everything is still linked with libgcc.a. > > > > BTW, we just need to make sure everything exported from the shared > libgcc is also exported from libc.so. I think we will be safe then. > > That would be an incredibly stupid thing to do, since it means that > you'd have to recompile glibc whenever things are added to libgcc.so. > That is true. The isse is we need to find a way to make the references to those exported symbols in libgcc.so dynamic. That is what libgcc.so is used for. How about we teach ld to check DT_AUXILIARY? It will be treated as DT_NEEDED for that purpose. ld won't wont propagate DT_AUXILIARY to anything else. > You'll probably have to install a libgcc.so linker script in the same > directory as libgcc.a, and preferably create a libgcc_nonshared.a That is no need for libgcc_nonshared.a, we can just use libgcc.a. > there too. Of course this can be postponed until you actually add > new stuff to libgcc.so. I don't like libgcc.so since it will introduce explicit dependency on libgcc.so and with DT_AUXILIARY, the only thing we need is to make the references to to those exported symbols in libgcc.so dynamic. Without libgcc.so, the resulting binaries will run ok with the slightly older libc.so which has no DT_AUXILIARY as long as the ABI of libgcc is not changed too much. H.J. From hjl@lucon.org Sat Jul 15 10:06:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Sat, 15 Jul 2000 10:06:00 -0000 Subject: Alleged bug in resolver code References: <200007142246.e6EMkjo00373@delius.kettenis.local> <20000714155602.A14421@lucon.org> <200007150009.e6F09J700612@delius.kettenis.local> <20000714175717.A14830@lucon.org> <200007150112.e6F1CnQ00728@delius.kettenis.local> <20000714204640.A15214@lucon.org> <200007151302.e6FD2Xv01247@delius.kettenis.local> Message-ID: <20000715100600.B16991@lucon.org> On Sat, Jul 15, 2000 at 03:02:33PM +0200, Mark Kettenis wrote: > > How about this patch instead? If res_nclose is not supposed to be > called without initialization, this patch shouldn't break anything. > > > H.J. > -- > 2000-07-14 H.J. Lu > > * resolv/res_send.c (res_nclose): Return if not initialized. > > I'd rather not do *that*. The res_nclose() function is part of the > new thread-safe BIND-8 interfaces. Those interfaces never call > res_ninit() themselves (e.g. you always have to pass them an initialize > resolver state). Since these interfaces are new in glibc 2.2 there > are no backwards compatibility issues, and I think we should > I see. > I've got less problems with applying a patch similar to yours to > res_close(), and I'll add that stuff if others on libc-hacker agree > that that's a good idea. However, I still think it's the broken > programs that should be fixed. I agree with Ulrich. Those programs are broken with glibc 2.2. But they are not with glibc 2.1. In fact, we just changed the API on res_close in 2.2. I don't think it is a good idea. H.J. From kettenis@wins.uva.nl Sat Jul 15 10:48:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sat, 15 Jul 2000 10:48:00 -0000 Subject: The DT_AUXILIARY patch References: <20000714182733.A29800@valinux.com> <20000714183128.A15013@lucon.org> <200007151320.e6FDKNY01271@delius.kettenis.local> <20000715100341.A16991@lucon.org> Message-ID: <200007151748.e6FHmHn10118@delius.kettenis.local> Date: Sat, 15 Jul 2000 10:03:41 -0700 From: "H . J . Lu" On Sat, Jul 15, 2000 at 03:20:23PM +0200, Mark Kettenis wrote: > Date: Fri, 14 Jul 2000 18:31:28 -0700 > From: "H . J . Lu" > > BTW, we just need to make sure everything exported from the shared > libgcc is also exported from libc.so. I think we will be safe then. > > That would be an incredibly stupid thing to do, since it means that > you'd have to recompile glibc whenever things are added to libgcc.so. > That is true. The isse is we need to find a way to make the references to those exported symbols in libgcc.so dynamic. That is what libgcc.so is used for. How about we teach ld to check DT_AUXILIARY? It will be treated as DT_NEEDED for that purpose. ld won't wont propagate DT_AUXILIARY to anything else. Argh! No! The current behaviour of ld to walk the DT_NEEDED list when resolving symbols from shared libraries has its problems and is incompatible with at least the Solaris linker. See < http://sources.redhat.com/ml/binutils/1999-11/msg00037.html > for a discussion. Adding this for DT_AUXILIARY makes even less sense. If the library in DT_AXUILIARY is absent everything should still work. Our proposed use of DT_AUXILIARY is more or less abusing the concept. It seems to work, but isn't really appropriate. Let's not bias our tools too much to this particular use. > there too. Of course this can be postponed until you actually add > new stuff to libgcc.so. I don't like libgcc.so since it will introduce explicit dependency on libgcc.so and with DT_AUXILIARY, the only thing we need is to make the references to to those exported symbols in libgcc.so dynamic. Without libgcc.so, the resulting binaries will run ok with the slightly older libc.so which has no DT_AUXILIARY as long as the ABI of libgcc is not changed too much. Nasty, isn't it? That's why I said you could postpone explicitly linking against libgcc.so until the ABI of libgcc actualy changes. However, as soon as it does, you'll have no other choice. In principle, there is no need for the shared libgcc.so at all as long as you don't use exception handling. So perhaps it is possible to tweak things (using linker tricks and the GCC specs file) to avoid the explicit dependency on libgcc.so for plain C programs. Mark From hjl@lucon.org Sat Jul 15 11:07:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Sat, 15 Jul 2000 11:07:00 -0000 Subject: The DT_AUXILIARY patch References: <20000714182733.A29800@valinux.com> <20000714183128.A15013@lucon.org> <200007151320.e6FDKNY01271@delius.kettenis.local> <20000715100341.A16991@lucon.org> <200007151748.e6FHmHn10118@delius.kettenis.local> Message-ID: <20000715110726.A17183@lucon.org> On Sat, Jul 15, 2000 at 07:48:17PM +0200, Mark Kettenis wrote: > Date: Sat, 15 Jul 2000 10:03:41 -0700 > From: "H . J . Lu" > > On Sat, Jul 15, 2000 at 03:20:23PM +0200, Mark Kettenis wrote: > > Date: Fri, 14 Jul 2000 18:31:28 -0700 > > From: "H . J . Lu" > > > > BTW, we just need to make sure everything exported from the shared > > libgcc is also exported from libc.so. I think we will be safe then. > > > > That would be an incredibly stupid thing to do, since it means that > > you'd have to recompile glibc whenever things are added to libgcc.so. > > > > That is true. The isse is we need to find a way to make the references > to those exported symbols in libgcc.so dynamic. That is what libgcc.so > is used for. How about we teach ld to check DT_AUXILIARY? It will > be treated as DT_NEEDED for that purpose. ld won't wont propagate > DT_AUXILIARY to anything else. > > Argh! No! The current behaviour of ld to walk the DT_NEEDED list > when resolving symbols from shared libraries has its problems and is > incompatible with at least the Solaris linker. See > < http://sources.redhat.com/ml/binutils/1999-11/msg00037.html > for a I didn't find the original message. Is the original problem solved? I ran into a similar problem with OpenGL. One OpenGL implmenentation is multi-threaded. But it has to work with single thread applications. That means the OpenGL implmenentation has to make sure libpthread.so is always available even if it is used with a single thread application. I had to fix a bug in glibc to make things to work for them. I can ask them to see how they solved the problem. > discussion. Adding this for DT_AUXILIARY makes even less sense. If > the library in DT_AXUILIARY is absent everything should still work. > Our proposed use of DT_AUXILIARY is more or less abusing the concept. > It seems to work, but isn't really appropriate. Let's not bias our > tools too much to this particular use. As I said, ld will check DT_AUXILIARY for setting a symbol dynamic. That means you don't need to use "gcc -rdynamic". I will make sure it won't have any other bad side effects. > > > there too. Of course this can be postponed until you actually add > > new stuff to libgcc.so. > > I don't like libgcc.so since it will introduce explicit dependency > on libgcc.so and with DT_AUXILIARY, the only thing we need is to > make the references to to those exported symbols in libgcc.so dynamic. > Without libgcc.so, the resulting binaries will run ok with the slightly > older libc.so which has no DT_AUXILIARY as long as the ABI of libgcc > is not changed too much. > > Nasty, isn't it? That's why I said you could postpone explicitly > linking against libgcc.so until the ABI of libgcc actualy changes. > However, as soon as it does, you'll have no other choice. That is what I want to avoid. > > In principle, there is no need for the shared libgcc.so at all as long > as you don't use exception handling. So perhaps it is possible to > tweak things (using linker tricks and the GCC specs file) to avoid the > explicit dependency on libgcc.so for plain C programs. That won't work since there is no way to tell if any C++ codes exist or not. I can even implement glibc in C++ as long as I support the glibc ABI. H.J. From kettenis@wins.uva.nl Sat Jul 15 16:50:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sat, 15 Jul 2000 16:50:00 -0000 Subject: res_ninit() -> res_ninit (&_res) Message-ID: <200007152350.e6FNoKs27659@delius.kettenis.local> Andreas, overlooked the use of res_init() in nss/getXXent_r.c. Here's a patch. Mark PS The Hesiod NSS module still uses res_init() (and the other thread-unsafe resolver interfaces). I'm almost finished testing the module, and I'll send the appropriate patches in the near future. 2000-07-15 Mark Kettenis * nss/getXXent_r.c [NEED__RES]: Include . (SETFUNC_NAME, ENDFUNC_NAME, REENTRANT_GETNAME): Use res_ninit instead of res_init. Index: nss/getXXent_r.c =================================================================== RCS file: /cvs/glibc/libc/nss/getXXent_r.c,v retrieving revision 1.27 diff -u -p -r1.27 getXXent_r.c --- nss/getXXent_r.c 2000/03/27 05:18:32 1.27 +++ nss/getXXent_r.c 2000/07/15 23:47:04 @@ -22,6 +22,10 @@ #include "nsswitch.h" +#ifdef NEED__RES +# include +#endif + /*******************************************************************\ |* Here we assume several symbols to be defined: *| |* *| @@ -149,7 +153,7 @@ SETFUNC_NAME (STAYOPEN) int no_more; #ifdef NEED__RES - if ((_res.options & RES_INIT) == 0 && res_init () == -1) + if ((_res.options & RES_INIT) == 0 && __res_ninit (&_res) == -1) { __set_h_errno (NETDB_INTERNAL); return; @@ -187,7 +191,7 @@ ENDFUNC_NAME (void) int no_more; #ifdef NEED__RES - if ((_res.options & RES_INIT) == 0 && res_init () == -1) + if ((_res.options & RES_INIT) == 0 && __res_ninit (&_res) == -1) { __set_h_errno (NETDB_INTERNAL); return; @@ -224,7 +228,7 @@ INTERNAL (REENTRANT_GETNAME) (LOOKUP_TYP enum nss_status status; #ifdef NEED__RES - if ((_res.options & RES_INIT) == 0 && res_init () == -1) + if ((_res.options & RES_INIT) == 0 && __res_ninit (&_res) == -1) { __set_h_errno (NETDB_INTERNAL); *result = NULL; From drepper@redhat.com Sat Jul 15 21:35:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 15 Jul 2000 21:35:00 -0000 Subject: PATCH: sysdeps/unix/sysv/linux/getcwd.c yet again... References: <200007150714.AAA25218@kayak.mcgary.org> Message-ID: Greg McGary writes: > The (buf==NULL && size > 0) case is still broken. Applied now, thanks. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Sat Jul 15 22:37:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sat, 15 Jul 2000 22:37:00 -0000 Subject: PATCH: BPs for elf PLT trampoline Message-ID: <200007160537.WAA02858@kayak.mcgary.org> No build regressions. No non-BP binary differences. 2000-07-15 Greg McGary * elf/dl-runtime.c (fixup): Trampoline passes unbounded pointer. (profile_fixup): Don't define for __BOUNDED_POINTERS__. * sysdeps/i386/dl-machine.h: Don't use regparm attribute for __BOUNDED_POINTERS__. (ELF_MACHINE_RUNTIME_TRAMPOLINE): Use non-regparm version for __BOUNDED_POINTERS__. Index: elf/dl-runtime.c =================================================================== RCS file: /cvs/glibc/libc/elf/dl-runtime.c,v retrieving revision 1.44 diff -u -p -r1.44 dl-runtime.c --- dl-runtime.c 2000/06/08 04:46:06 1.44 +++ dl-runtime.c 2000/07/16 05:35:27 @@ -47,7 +47,7 @@ fixup ( # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS ELF_MACHINE_RUNTIME_FIXUP_ARGS, # endif - struct link_map *l, ElfW(Word) reloc_offset) + struct link_map *__unbounded l, ElfW(Word) reloc_offset) { const ElfW(Sym) *const symtab = (const void *) D_PTR (l, l_info[DT_SYMTAB]); @@ -119,14 +119,14 @@ fixup ( } #endif -#if !defined PROF && !defined ELF_MACHINE_NO_PLT +#if !defined PROF && !defined ELF_MACHINE_NO_PLT && !__BOUNDED_POINTERS__ static ElfW(Addr) __attribute__ ((unused)) profile_fixup ( #ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS ELF_MACHINE_RUNTIME_FIXUP_ARGS, #endif - struct link_map *l, ElfW(Word) reloc_offset, ElfW(Addr) retaddr) + struct link_map *__unbounded l, ElfW(Word) reloc_offset, ElfW(Addr) retaddr) { void (*mcount_fct) (ElfW(Addr), ElfW(Addr)) = _dl_mcount; ElfW(Addr) *resultp; Index: sysdeps/i386/dl-machine.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/i386/dl-machine.h,v retrieving revision 1.77 diff -u -p -r1.77 dl-machine.h --- dl-machine.h 2000/06/08 04:18:45 1.77 +++ dl-machine.h 2000/07/16 05:35:27 @@ -60,16 +60,16 @@ elf_machine_load_address (void) return addr; } -#ifndef PROF +#if !defined PROF && !__BOUNDED_POINTERS__ /* We add a declaration of this function here so that in dl-runtime.c the ELF_MACHINE_RUNTIME_TRAMPOLINE macro really can pass the parameters in registers. We cannot use this scheme for profiling because the _mcount call destroys the passed register information. */ -static ElfW(Addr) fixup (struct link_map *l, ElfW(Word) reloc_offset) +static ElfW(Addr) fixup (struct link_map *__unbounded l, ElfW(Word) reloc_offset) __attribute__ ((regparm (2), unused)); -static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset, +static ElfW(Addr) profile_fixup (struct link_map *__unbounded l, ElfW(Word) reloc_offset, ElfW(Addr) retaddr) __attribute__ ((regparm (3), unused)); #endif @@ -119,7 +119,7 @@ elf_machine_runtime_setup (struct link_m /* This code is used in dl-runtime.c to call the `fixup' function and then redirect to the address it returns. */ -#ifndef PROF +#if !defined PROF && !__BOUNDED_POINTERS__ # define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\ .text .globl _dl_runtime_resolve From greg@mcgary.org Sat Jul 15 22:41:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sat, 15 Jul 2000 22:41:00 -0000 Subject: PATCH: lump three non-BP mem functions into libc_b Message-ID: <200007160541.WAA03680@kayak.mcgary.org> No build regressions. Gcc internally generates calls to non-BP memcpy and memset, so we must have them for BP programs. Non-BP memchr is used by CHECK_STRING to check that '\0' occurs before the high bound. OK? 2000-07-15 Greg McGary * Makerules (o-objects): Supplement with $(o-objects$o). * string/Makefile (o-objects.ob): Add variable to pull unbounded versions of memcpy, memset and memchr into libc_b. Index: Makerules =================================================================== RCS file: /cvs/glibc/libc/Makerules,v retrieving revision 1.339 diff -u -p -r1.339 Makerules --- Makerules 2000/06/21 18:15:14 1.339 +++ Makerules 2000/07/16 05:35:31 @@ -554,7 +554,9 @@ lib-noranlib: libobjs # Makefiles can define `elide-routines.so = foo' to leave foo.so out. o-objects = $(patsubst %.o,%$o,$(filter-out $(patsubst %,$(objpfx)%.o,\ $(elide-routines$o)),\ - $(objects))) + $(objects))) \ + $(addprefix $(objpfx),$(o-objects$o)) + others: $(addprefix $(objpfx),$(install-lib)) ifndef objects Index: string/Makefile =================================================================== RCS file: /cvs/glibc/libc/string/Makefile,v retrieving revision 1.48 diff -u -p -r1.48 Makefile --- Makefile 1999/10/04 06:40:34 1.48 +++ Makefile 2000/07/16 05:35:31 @@ -1,4 +1,4 @@ -# Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc. +# Copyright (C) 1991,92,93,94,95,96,97,98,99,2000 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 @@ -40,6 +40,10 @@ routines := strcat strchr strcmp strcoll addsep replace) \ envz basename \ strcoll_l strxfrm_l string-inlines memrchr + +# Gcc internally generates calls to unbounded memcpy and memset +# for -fbounded-pointer compiles. Glibc uses memchr for explicit checks. +o-objects.ob := memcpy.o memset.o memchr.o tests := tester inl-tester noinl-tester testcopy test-ffs \ tst-strlen stratcliff tst-svc tst-inlcall From greg@mcgary.org Sat Jul 15 22:42:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sat, 15 Jul 2000 22:42:00 -0000 Subject: PATCH: malloc decl for gconv_trans.c Message-ID: <200007160542.WAA05386@kayak.mcgary.org> OK? 2000-07-15 Greg McGary * iconv/gconv_trans.c: Add #include to get malloc decl. Index: iconv/gconv_trans.c =================================================================== RCS file: /cvs/glibc/libc/iconv/gconv_trans.c,v retrieving revision 1.8 diff -u -p -r1.8 gconv_trans.c --- gconv_trans.c 2000/07/01 00:00:13 1.8 +++ gconv_trans.c 2000/07/16 05:35:27 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include "gconv_int.h" From greg@mcgary.org Sat Jul 15 22:44:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sat, 15 Jul 2000 22:44:00 -0000 Subject: PATCH: revert RUN_HOOK changes for BPs Message-ID: <200007160544.WAA05422@kayak.mcgary.org> These changes didn't do what I wanted, so I took them out and instead added an __unbounded qualifier. No build regressions. No non-BP binary changes. OK? 2000-07-15 Greg McGary * include/libc-symbols.h (symbol_set_declare): Revert 2000-06-26 mods. * include/set-hooks.h (RUN_HOOK): Revert 2000-06-26 mods. Qualify ptr as __unbouned. Index: include/libc-symbols.h =================================================================== RCS file: /cvs/glibc/libc/include/libc-symbols.h,v retrieving revision 1.17 diff -u -p -r1.17 libc-symbols.h --- libc-symbols.h 2000/07/11 19:30:52 1.17 +++ libc-symbols.h 2000/07/16 05:35:27 @@ -242,8 +242,8 @@ /* Declare SET for use in this module, if defined in another module. */ # define symbol_set_declare(set) \ - extern void (*const __start_##set) (void) __attribute__ ((__weak__)); \ - extern void (*const __stop_##set) (void) __attribute__ ((__weak__)); \ + extern void *const __start_##set __attribute__ ((__weak__)); \ + extern void *const __stop_##set __attribute__ ((__weak__)); \ weak_extern (__start_##set) weak_extern (__stop_##set) /* Return a pointer (void *const *) to the first element of SET. */ @@ -261,7 +261,7 @@ asm(".stabs \"" __SYMBOL_PREFIX #set "\",25,0,0," __SYMBOL_PREFIX #symbol) # define bss_set_element(set, symbol) ?error Must use initialized data. # define symbol_set_define(set) void *const (set)[1]; -# define symbol_set_declare(set) extern void (*const (set)[1]) (void); +# define symbol_set_declare(set) extern void *const (set)[1]; # define symbol_set_first_element(set) &(set)[1] # define symbol_set_end_p(set, ptr) (*(ptr) == 0) Index: include/set-hooks.h =================================================================== RCS file: /cvs/glibc/libc/include/set-hooks.h,v retrieving revision 1.3 diff -u -p -r1.3 set-hooks.h --- set-hooks.h 2000/06/27 01:20:02 1.3 +++ set-hooks.h 2000/07/16 05:35:27 @@ -40,12 +40,12 @@ /* Run all the functions hooked on the set called NAME. Each function is called like this: `function ARGS'. */ -# define RUN_HOOK(NAME, ARGS) \ -do { \ - void (*const *ptr) (void); \ - for (ptr = symbol_set_first_element (NAME); \ - ! symbol_set_end_p (NAME, ptr); ++ptr) \ - (*(__##NAME##_hook_function_t *) *ptr) ARGS; \ +# define RUN_HOOK(NAME, ARGS) \ +do { \ + void *const *__unbounded ptr; \ + for (ptr = symbol_set_first_element (NAME); \ + ! symbol_set_end_p (NAME, ptr); ++ptr) \ + (*(__##NAME##_hook_function_t *) *ptr) ARGS; \ } while (0) /* Define a hook variable with NAME and PROTO, and a function called RUNNER From greg@mcgary.org Sat Jul 15 22:52:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sat, 15 Jul 2000 22:52:00 -0000 Subject: PATCH: _IO_new_fdopen wants _IO_FILE_plus for BPs Message-ID: <200007160552.WAA05440@kayak.mcgary.org> No build regressions. No non-BP binary changes. OK? 2000-07-15 Greg McGary * libio/iofdopen.c (_IO_new_fdopen): Pass _IO_FILE_plus pointer to _IO_file_attach. * libio/iovdprintf.c (_IO_vdprintf): Likewise. Index: libio/iofdopen.c =================================================================== RCS file: /cvs/glibc/libc/libio/iofdopen.c,v retrieving revision 1.15 diff -u -p -r1.15 iofdopen.c --- iofdopen.c 2000/06/29 07:16:41 1.15 +++ iofdopen.c 2000/07/16 05:35:31 @@ -128,7 +128,7 @@ _IO_new_fdopen (fd, mode) #if !_IO_UNIFIED_JUMPTABLES new_f->fp.vtable = NULL; #endif - if (_IO_file_attach (&new_f->fp.file, fd) == NULL) + if (_IO_file_attach ((_IO_FILE *) &new_f->fp, fd) == NULL) { _IO_un_link (&new_f->fp); free (new_f); Index: libio/iovdprintf.c =================================================================== RCS file: /cvs/glibc/libc/libio/iovdprintf.c,v retrieving revision 1.7 diff -u -p -r1.7 iovdprintf.c --- iovdprintf.c 2000/06/29 07:16:41 1.7 +++ iovdprintf.c 2000/07/16 05:35:31 @@ -48,7 +48,7 @@ _IO_vdprintf (d, format, arg) #if !_IO_UNIFIED_JUMPTABLES tmpfil.vtable = NULL; #endif - if (_IO_file_attach (&tmpfil.file, d) == NULL) + if (_IO_file_attach ((_IO_FILE *) &tmpfil, d) == NULL) { _IO_un_link (&tmpfil); return EOF; From greg@mcgary.org Sat Jul 15 22:54:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sat, 15 Jul 2000 22:54:00 -0000 Subject: PATCH: fix misc warnings and runtime bugs in BPs. Message-ID: <200007160554.WAA05449@kayak.mcgary.org> 2000-07-15 Greg McGary * sysdeps/generic/strcpy.c (strcpy): Stifle unused-value warnings. * sysdeps/unix/sysv/linux/execve.c (__execve): Add const qualifiers. Don't check NULL-terminator of argv & envp. * sysdeps/unix/sysv/linux/getsysstats.c (get_proc_path): Use unbounded pointer type in word-size assertion. * sysdeps/unix/sysv/linux/ptrace.c (ptrace): Add missing cases to stifle warnings. Index: sysdeps/generic/strcpy.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/generic/strcpy.c,v retrieving revision 1.5 diff -u -p -r1.5 strcpy.c --- strcpy.c 2000/07/07 02:19:04 1.5 +++ strcpy.c 2000/07/16 05:35:31 @@ -42,8 +42,8 @@ strcpy (dest, src) while (c != '\0'); n = s - src; - CHECK_BOUNDS_HIGH (src + n); - CHECK_BOUNDS_HIGH (dest + n); + (void) CHECK_BOUNDS_HIGH (src + n); + (void) CHECK_BOUNDS_HIGH (dest + n); return dest; } Index: sysdeps/unix/sysv/linux/execve.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/execve.c,v retrieving revision 1.6 diff -u -p -r1.6 execve.c --- execve.c 2000/07/07 02:19:05 1.6 +++ execve.c 2000/07/16 05:35:31 @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -41,7 +42,7 @@ __execve (file, argv, envp) __pthread_kill_other_threads_np (); #if __BOUNDED_POINTERS__ { - char **v; + char *const *v; int i; char *__unbounded *__unbounded ubp_argv; char *__unbounded *__unbounded ubp_envp; @@ -51,15 +52,17 @@ __execve (file, argv, envp) ; i = v - argv + 1; ubp_argv = (char *__unbounded *__unbounded) alloca (sizeof (*ubp_argv) * i); - for (v = argv, ubp_v = ubp_argv; i--; v++, ubp_v++) + for (v = argv, ubp_v = ubp_argv; --i; v++, ubp_v++) *ubp_v = CHECK_STRING (*v); + *ubp_v = 0; for (v = envp; *v; v++) ; i = v - envp + 1; ubp_envp = (char *__unbounded *__unbounded) alloca (sizeof (*ubp_envp) * i); - for (v = envp, ubp_v = ubp_envp; i--; v++, ubp_v++) + for (v = envp, ubp_v = ubp_envp; --i; v++, ubp_v++) *ubp_v = CHECK_STRING (*v); + *ubp_v = 0; return INLINE_SYSCALL (execve, 3, CHECK_STRING (file), ubp_argv, ubp_envp); } Index: sysdeps/unix/sysv/linux/getsysstats.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/getsysstats.c,v retrieving revision 1.13 diff -u -p -r1.13 getsysstats.c --- getsysstats.c 2000/07/13 09:50:03 1.13 +++ getsysstats.c 2000/07/16 05:35:32 @@ -79,7 +79,7 @@ get_proc_path (char *buffer, size_t bufs return result; /* Now store the copied value. But do it atomically. */ - assert (sizeof (long int) == sizeof (void *)); + assert (sizeof (long int) == sizeof (void *__unbounded)); if (compare_and_swap ((long int *) &mount_proc, (long int) 0, (long int) copy_result) == 0) /* Replacing the value failed. This means another thread was Index: sysdeps/unix/sysv/linux/ptrace.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ptrace.c,v retrieving revision 1.9 diff -u -p -r1.9 ptrace.c --- ptrace.c 2000/07/11 19:30:53 1.9 +++ ptrace.c 2000/07/16 05:35:32 @@ -91,6 +91,16 @@ ptrace (enum __ptrace_request request, . (void) CHECK_1 ((int *) data); #endif break; + + case PTRACE_TRACEME: + case PTRACE_CONT: + case PTRACE_KILL: + case PTRACE_SINGLESTEP: + case PTRACE_ATTACH: + case PTRACE_DETACH: + case PTRACE_SYSCALL: + /* Neither `data' nor `addr' needs any checks. */ + break; }; #endif From greg@mcgary.org Sat Jul 15 22:55:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sat, 15 Jul 2000 22:55:00 -0000 Subject: PATCH: fix misc warnings and runtime bugs in BPs. Message-ID: <200007160554.WAA05457@kayak.mcgary.org> [ repost: forgot to mention regression status ] No build regressions. No binary differences for non-BP. OK? 2000-07-15 Greg McGary * sysdeps/generic/strcpy.c (strcpy): Stifle unused-value warnings. * sysdeps/unix/sysv/linux/execve.c (__execve): Add const qualifiers. Don't check NULL-terminator of argv & envp. * sysdeps/unix/sysv/linux/getsysstats.c (get_proc_path): Use unbounded pointer type in word-size assertion. * sysdeps/unix/sysv/linux/ptrace.c (ptrace): Add missing cases to stifle warnings. Index: sysdeps/generic/strcpy.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/generic/strcpy.c,v retrieving revision 1.5 diff -u -p -r1.5 strcpy.c --- strcpy.c 2000/07/07 02:19:04 1.5 +++ strcpy.c 2000/07/16 05:35:31 @@ -42,8 +42,8 @@ strcpy (dest, src) while (c != '\0'); n = s - src; - CHECK_BOUNDS_HIGH (src + n); - CHECK_BOUNDS_HIGH (dest + n); + (void) CHECK_BOUNDS_HIGH (src + n); + (void) CHECK_BOUNDS_HIGH (dest + n); return dest; } Index: sysdeps/unix/sysv/linux/execve.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/execve.c,v retrieving revision 1.6 diff -u -p -r1.6 execve.c --- execve.c 2000/07/07 02:19:05 1.6 +++ execve.c 2000/07/16 05:35:31 @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -41,7 +42,7 @@ __execve (file, argv, envp) __pthread_kill_other_threads_np (); #if __BOUNDED_POINTERS__ { - char **v; + char *const *v; int i; char *__unbounded *__unbounded ubp_argv; char *__unbounded *__unbounded ubp_envp; @@ -51,15 +52,17 @@ __execve (file, argv, envp) ; i = v - argv + 1; ubp_argv = (char *__unbounded *__unbounded) alloca (sizeof (*ubp_argv) * i); - for (v = argv, ubp_v = ubp_argv; i--; v++, ubp_v++) + for (v = argv, ubp_v = ubp_argv; --i; v++, ubp_v++) *ubp_v = CHECK_STRING (*v); + *ubp_v = 0; for (v = envp; *v; v++) ; i = v - envp + 1; ubp_envp = (char *__unbounded *__unbounded) alloca (sizeof (*ubp_envp) * i); - for (v = envp, ubp_v = ubp_envp; i--; v++, ubp_v++) + for (v = envp, ubp_v = ubp_envp; --i; v++, ubp_v++) *ubp_v = CHECK_STRING (*v); + *ubp_v = 0; return INLINE_SYSCALL (execve, 3, CHECK_STRING (file), ubp_argv, ubp_envp); } Index: sysdeps/unix/sysv/linux/getsysstats.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/getsysstats.c,v retrieving revision 1.13 diff -u -p -r1.13 getsysstats.c --- getsysstats.c 2000/07/13 09:50:03 1.13 +++ getsysstats.c 2000/07/16 05:35:32 @@ -79,7 +79,7 @@ get_proc_path (char *buffer, size_t bufs return result; /* Now store the copied value. But do it atomically. */ - assert (sizeof (long int) == sizeof (void *)); + assert (sizeof (long int) == sizeof (void *__unbounded)); if (compare_and_swap ((long int *) &mount_proc, (long int) 0, (long int) copy_result) == 0) /* Replacing the value failed. This means another thread was Index: sysdeps/unix/sysv/linux/ptrace.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ptrace.c,v retrieving revision 1.9 diff -u -p -r1.9 ptrace.c --- ptrace.c 2000/07/11 19:30:53 1.9 +++ ptrace.c 2000/07/16 05:35:32 @@ -91,6 +91,16 @@ ptrace (enum __ptrace_request request, . (void) CHECK_1 ((int *) data); #endif break; + + case PTRACE_TRACEME: + case PTRACE_CONT: + case PTRACE_KILL: + case PTRACE_SINGLESTEP: + case PTRACE_ATTACH: + case PTRACE_DETACH: + case PTRACE_SYSCALL: + /* Neither `data' nor `addr' needs any checks. */ + break; }; #endif From drepper@redhat.com Sat Jul 15 23:39:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 15 Jul 2000 23:39:00 -0000 Subject: PATCH: BPs for elf PLT trampoline References: <200007160537.WAA02858@kayak.mcgary.org> Message-ID: Greg McGary writes: > - struct link_map *l, ElfW(Word) reloc_offset) > + struct link_map *__unbounded l, ElfW(Word) reloc_offset) I think we should rather fix the trampoline code. Maybe in a second phase but __unbounded should not be the last word. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Jul 15 23:40:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 15 Jul 2000 23:40:00 -0000 Subject: PATCH: lump three non-BP mem functions into libc_b References: <200007160541.WAA03680@kayak.mcgary.org> Message-ID: Greg McGary writes: > OK? Yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Jul 15 23:41:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 15 Jul 2000 23:41:00 -0000 Subject: PATCH: malloc decl for gconv_trans.c References: <200007160542.WAA05386@kayak.mcgary.org> Message-ID: Greg McGary writes: > OK? Yes -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Jul 15 23:42:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 15 Jul 2000 23:42:00 -0000 Subject: PATCH: revert RUN_HOOK changes for BPs References: <200007160544.WAA05422@kayak.mcgary.org> Message-ID: Greg McGary writes: > OK? Yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Jul 15 23:47:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 15 Jul 2000 23:47:00 -0000 Subject: PATCH: _IO_new_fdopen wants _IO_FILE_plus for BPs References: <200007160552.WAA05440@kayak.mcgary.org> Message-ID: Greg McGary writes: > No build regressions. No non-BP binary changes. > > OK? Yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Sat Jul 15 23:48:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sat, 15 Jul 2000 23:48:00 -0000 Subject: PATCH: fix misc warnings and runtime bugs in BPs. References: <200007160554.WAA05457@kayak.mcgary.org> Message-ID: Greg McGary writes: > [ repost: forgot to mention regression status ] > > No build regressions. No binary differences for non-BP. > > OK? Yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Sat Jul 15 23:49:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sat, 15 Jul 2000 23:49:00 -0000 Subject: PATCH: syscalls fixes for BPs Message-ID: <200007160649.XAA06223@kayak.mcgary.org> No build regressions. No binary changes for non-BP. OK? 2000-07-15 Greg McGary * sysdeps/unix/make-syscalls.sh: Handle new arg signature keyletters F, I, S, W. Remove unused keyletter V. Surround signature argnames with angle-brackets for use as word delimiters, and to induce syntax errors for any args not handled. Split multi-echo echoes and comment each stage. * sysdeps/unix/common/syscalls.list: Refine & correct signatures. * sysdeps/unix/inet/syscalls.list: Likewise. * sysdeps/unix/mman/syscalls.list: Likewise. * sysdeps/unix/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/syscalls.list: Likewise. * sysdeps/unix/sysv/syscalls.list: Likewise. Index: sysdeps/unix/make-syscalls.sh =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/make-syscalls.sh,v retrieving revision 1.19 diff -u -p -r1.19 make-syscalls.sh --- make-syscalls.sh 2000/07/11 19:30:53 1.19 +++ make-syscalls.sh 2000/07/16 05:35:32 @@ -8,23 +8,24 @@ # Syscall Signature Key Letters for BP Thunks: # # a: unchecked address (e.g., 1st arg to mmap) -# b: non-NULL buffer (e.g., 2nd arg to read) +# b: non-NULL buffer (e.g., 2nd arg to read; return value from mmap) # B: optionally-NULL buffer (e.g., 4th arg to getsockopt) # f: buffer of 2 ints (e.g., 4th arg to socketpair) +# F: 3rd arg to fcntl # i: scalar (any signedness & size: int, long, long long, enum, whatever) +# I: 3rd arg to ioctl # n: scalar buffer length (e.g., 3rd arg to read) # N: pointer to value/return scalar buffer length (e.g., 6th arg to recvfrom) -# p: pointer to typed object (e.g., any non-void* arg) -# P: pointer return value (e.g., return value from mmap) -# s: string (e.g., 1st arg to open) +# p: non-NULL pointer to typed object (e.g., any non-void* arg) +# P: optionally-NULL pointer to typed object (e.g., 2nd argument to gettimeofday) +# s: non-NULL string (e.g., 1st arg to open) +# S: optionally-NULL string (e.g., 1st arg to acct) # v: vararg scalar (e.g., optional 3rd arg to open) -# V: vararg pointer (e.g., 3rd arg to fcntl & ioctl) +# W: wait status, optionally-NULL pointer to int (e.g., 2nd arg of wait4) -ptrlet='[abBfNpPs]' -argdig='[1-9]' -fixarg='[^vV]'$argdig # fixed args (declare extern) -ptrarg=$ptrlet$argdig # pointer arg (toss bounds) -intarg='[inv]'$argdig # scalar arg +ptr='[abBfFINpPsSW]' # all pointer keyletters +int='[inv]' # all scalar keyletters +typ='[ifnNpP]' # typed-arg keyletters: we capture type for use in thunk ############################################################################## @@ -185,7 +186,7 @@ shared-only-routines += $file case x"$callnum",$srcfile,$args in x-,-,* | x*,*.[sS],*V*) ;; - x*,-,*$ptrlet* | x*,*.[sS],*$ptrlet*) + x*,-,*$ptr* | x*,*.[sS],*$ptr*) nv_weak=`for name in $weak; do case $name in @@ -200,16 +201,16 @@ shared-only-routines += $file # convert signature string to individual numbered arg names # e.g., i:ipbN -> i0 i1 p2 b3 N4 set `echo $args | - sed -e 's/^\(.\):\(.*\)/\2 \10/' \ - -e 's/^\([^ ]\)\(.*\)/\2 \11/' \ - -e 's/^\([^ ]\)\(.*\)/\2 \12/' \ - -e 's/^\([^ ]\)\(.*\)/\2 \13/' \ - -e 's/^\([^ ]\)\(.*\)/\2 \14/' \ - -e 's/^\([^ ]\)\(.*\)/\2 \15/' \ - -e 's/^\([^ ]\)\(.*\)/\2 \16/' \ - -e 's/^\([^ ]\)\(.*\)/\2 \17/' \ - -e 's/^\([^ ]\)\(.*\)/\2 \18/' \ - -e 's/^\([^ ]\)\(.*\)/\2 \19/'` + sed -e 's/^\(.\):\(.*\)/\2 <\10>/' \ + -e 's/^\([^ ]\)\(.*\)/\2 <\11>/' \ + -e 's/^\([^ ]\)\(.*\)/\2 <\12>/' \ + -e 's/^\([^ ]\)\(.*\)/\2 <\13>/' \ + -e 's/^\([^ ]\)\(.*\)/\2 <\14>/' \ + -e 's/^\([^ ]\)\(.*\)/\2 <\15>/' \ + -e 's/^\([^ ]\)\(.*\)/\2 <\16>/' \ + -e 's/^\([^ ]\)\(.*\)/\2 <\17>/' \ + -e 's/^\([^ ]\)\(.*\)/\2 <\18>/' \ + -e 's/^\([^ ]\)\(.*\)/\2 <\19>/'` rtn=$1; shift args=$* arglist=`echo $* |sed 's/ /, /g'` @@ -222,43 +223,53 @@ shared-only-routines += $file echo "bp-thunks += $file" echo "\$(objpfx)\$(bppfx)$file.ob: \$(common-objpfx)s-proto.d" - # generate macro head & thunk prologue - echo "\ - (echo '#define $callname($arglist) r0, $rtn; \\'; \\ - echo '`echo $args | \ - sed -e 's/\('$fixarg'\)/extern \1, \1v;/g' \ - -e 's/\(v'$argdig'\)/extern int \1v;/g'` \\'; \\ - echo '__typeof (r0) BP_SYM ($strong) (`echo $args | \ - sed -e 's/ /, /g' \ - -e 's/\('$ptrarg'\)/__typeof (\1v) *__bounded \1a/g' \ - -e 's/\('$intarg'\)/__typeof (\1v) \1a/g'`) { \\'; \\ - echo ' extern __typeof (r0) ($callname) (`echo $args | \ - sed -e 's/ /, /g' \ - -e 's/\('$ptrarg'\)/__typeof (\1v) *__unbounded/g' \ - -e 's/\('$intarg'\)/__typeof (\1v)/g'`); \\'; \\" - - # stash length arg for use with mman calls that return pointers - len=`echo $args |sed -e 's/.*\('n$argdig'\).*/\1/'` - - # generate thunk epilogue - funcall="($callname) (`echo $args | \ - sed -e 's/ /, /g' \ - -e 's/\('a$argdig'\)/__ptrvalue (\1a)/g' \ - -e 's/\('s$argdig'\)/CHECK_STRING (\1a)/g' \ - -e 's/\('p$argdig'\)/CHECK_1 (\1a)/g' \ - -e 's/\('f$argdig'\)/CHECK_N (\1a, 2)/g' \ - -e 's/\('b$argdig'\), \('n$argdig'\)/CHECK_N (\1a, \2), \2/g' \ - -e 's/\('b$argdig'\), \('N$argdig'\)/CHECK_N (\1a, *CHECK_1 (\2a)), __ptrvalue (\2a)/g' \ - -e 's/\('B$argdig'\), \('n$argdig'\)/CHECK_Nopt (\1a, \2), \2/g' \ - -e 's/\('B$argdig'\), \('N$argdig'\)/CHECK_Nopt (\1a, *CHECK_1 (\2a)), __ptrvalue (\2a)/g' \ - -e 's/\('[ivn]$argdig'\)/\1a/g'`)" - - case $rtn in - P*) echo " echo '{ __typeof ($rtn) *__bounded rtn; \\'; \\ - echo ' __ptrlow (rtn) = __ptrvalue (rtn) = $funcall; \\'; \\ - echo ' __ptrhigh (rtn) = __ptrlow (rtn) + ${len}a; return rtn; } \\'; \\" ;; - *) echo " echo ' return $funcall; \\'; \\" ;; - esac + # generate macro head + echo " (echo '#define $callname(`echo $arglist | \ + sed -e 's/[<>]//g'`) `echo $rtn | \ + sed -e 's/<\('$typ'0\)>/\1v;/g' \ + -e 's/<\(b0\)>/x0; extern char \1v;/g'` \\'; \\" + + # generate extern decls of dummy variables for each arg + echo " echo '`echo $args | \ + sed -e 's/<\('$typ'[1-9]\)>/extern \1, \1v;/g' \ + -e 's/<\([abBFIsS][1-9]\)>/extern char \1v;/g' \ + -e 's/<\([Wv][1-9]\)>/extern int \1v;/g'` \\'; \\" + + # generate bounded-pointer thunk declarator + echo " echo '`echo $rtn | \ + sed -e 's/<\('$ptr'0\)>/__typeof (\1v) *__bounded/g' \ + -e 's/<\('$int'0\)>/__typeof (\1v)/g'` BP_SYM ($strong) (`echo $arglist | \ + sed -e 's/<\('$ptr'[1-9]\)>/__typeof (\1v) *__bounded \1a/g' \ + -e 's/<\('$int'[1-9]\)>/__typeof (\1v) \1a/g'`) { \\'; \\" + + # generate extern primitive syscall declaration + echo " echo ' extern `echo $rtn | \ + sed -e 's/<\('$ptr'0\)>/__typeof (\1v) *__unbounded/g' \ + -e 's/<\('$int'0\)>/__typeof (\1v)/g'` ($callname) (`echo $arglist | \ + sed -e 's/<\('$ptr'[1-9]\)>/__typeof (\1v) *__unbounded/g' \ + -e 's/<\('$int'[1-9]\)>/__typeof (\1v)/g'`); \\'; \\" + + # generate call the primtive system call, optionally wrapping bounds + # around the result if the signature's return keyletter is `b'. + echo " echo ' return `echo $rtn | + sed -e 's//BOUNDED_N (/' \ + -e 's/<.0>//'`($callname) (`echo $arglist | \ + sed -e 's/<\(a[1-9]\)>/__ptrvalue (\1a)/g' \ + -e 's/<\(b[1-9]\)>, <\(n[1-9]\)>/CHECK_N (\1a, \2a), \2a/g' \ + -e 's/<\(b[1-9]\)>, <\(N[1-9]\)>/CHECK_N (\1a, *CHECK_1 (\2a)), __ptrvalue (\2a)/g' \ + -e 's/<\(B[1-9]\)>, <\(n[1-9]\)>/CHECK_Nopt (\1a, \2a), \2a/g' \ + -e 's/<\(B[1-9]\)>, <\(N[1-9]\)>/CHECK_Nopt (\1a, *CHECK_1 (\2a)), __ptrvalue (\2a)/g' \ + -e 's/<\(f[1-9]\)>/CHECK_N (\1a, 2)/g' \ + -e 's/<\(i[1-9]\)>, <\(F[1-9]\)>/\1a, CHECK_FCNTL (\2a, \1a)/g' \ + -e 's/<\(i[1-9]\)>, <\(I[1-9]\)>/\1a, CHECK_IOCTL (\2a, \1a)/g' \ + -e 's/<\(p[1-9]\)>/CHECK_1 (\1a)/g' \ + -e 's/<\([PW][1-9]\)>/CHECK_1opt (\1a)/g' \ + -e 's/<\(s[1-9]\)>/CHECK_STRING (\1a)/g' \ + -e 's/<\(S[1-9]\)>/CHECK_STRINGopt (\1a)/g' \ + -e 's/<\([ivn][1-9]\)>/\1a/g'`)`echo $rtn $args | + sed -e 's/.*<\(n[1-9]\)>.*/, \1a)/' \ + -e 's/<.0>.*//'`; \\'; \\" + echo " echo '} \\'; \\" # generate thunk aliases @@ -272,9 +283,9 @@ shared-only-routines += $file echo '#include '; \\ ) | \$(COMPILE.c) -x c -o \$@ -" ### Use this for debugging intermediate output: -### echo ' ) >$(@:.ob=.c) -### $(subst -c,-E,$(COMPILE.c)) -o $(@:.ob=.ib) $(@:.ob=.c) -### $(COMPILE.c) -x cpp-output -o $@ $(@:.ob=.ib)' +### ) >\$(@:.ob=.c) +### \$(subst -c,-E,\$(COMPILE.c)) -o \$(@:.ob=.ib) \$(@:.ob=.c) +### \$(COMPILE.c) -x cpp-output -o \$@ \$(@:.ob=.ib)" echo endif ;; esac Index: sysdeps/unix/sysv/linux/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/syscalls.list,v retrieving revision 1.79 diff -u -p -r1.79 syscalls.list --- syscalls.list 2000/07/06 00:48:39 1.79 +++ syscalls.list 2000/07/16 05:35:32 @@ -25,9 +25,9 @@ madvise - madvise i:pii posix_madvise mincore - mincore i:iip mincore mlock EXTRA mlock i:bn __mlock mlock mlockall EXTRA mlockall i:i __mlockall mlockall -mmap - mmap P:aniiii __mmap mmap +mmap - mmap b:aniiii __mmap mmap mount EXTRA mount i:sssip __mount mount -mremap EXTRA mremap P:aini __mremap mremap +mremap EXTRA mremap b:aini __mremap mremap munlock EXTRA munlock i:ai __munlock munlock munlockall EXTRA munlockall i: __munlockall munlockall nanosleep - nanosleep i:pp __libc_nanosleep __nanosleep nanosleep @@ -46,16 +46,16 @@ sched_rr_gi - sched_rr_get_interval i:ip sched_setp - sched_setparam i:ip __sched_setparam sched_setparam sched_sets - sched_setscheduler i:iip __sched_setscheduler sched_setscheduler sched_yield - sched_yield i: __sched_yield sched_yield -select - _newselect i:ipppp __select select +select - _newselect i:iPPPP __select select sendfile EXTRA sendfile i:iipi sendfile setfsgid EXTRA setfsgid i:i setfsgid setfsuid EXTRA setfsuid i:i setfsuid setpgid - setpgid i:ii __setpgid setpgid setresuid EXTRA setresuid i:iii __setresuid setresuid setresgid EXTRA setresgid i:iii __setresgid setresgid -sigaltstack - sigaltstack i:pp __sigaltstack sigaltstack +sigaltstack - sigaltstack i:PP __sigaltstack sigaltstack sysinfo EXTRA sysinfo i:p sysinfo swapon - swapon i:si __swapon swapon swapoff - swapoff i:s __swapoff swapoff uselib EXTRA uselib i:s uselib -wait4 - wait4 i:ipip __wait4 wait4 +wait4 - wait4 i:iWiP __wait4 wait4 Index: sysdeps/unix/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/syscalls.list,v retrieving revision 1.14 diff -u -p -r1.14 syscalls.list --- syscalls.list 2000/07/06 00:48:38 1.14 +++ syscalls.list 2000/07/16 05:35:32 @@ -1,7 +1,7 @@ # File name Caller Syscall name Args Strong name Weak names access - access i:si __access access -acct - acct i:s acct +acct - acct i:S acct chdir - chdir i:s __chdir chdir chmod - chmod i:si __chmod chmod chown - chown i:sii __chown chown @@ -10,7 +10,7 @@ close - close i:i __libc_close __close dup - dup i:i __dup dup dup2 - dup2 i:ii __dup2 dup2 fchdir - fchdir i:i __fchdir fchdir -fcntl - fcntl i:iiV __libc_fcntl __fcntl fcntl +fcntl - fcntl i:iiF __libc_fcntl __fcntl fcntl fstatfs - fstatfs i:ip __fstatfs fstatfs fsync - fsync i:i __libc_fsync fsync getdomain - getdomainname i:si getdomainname @@ -21,7 +21,7 @@ getpid - getpid i: __getpid getpid getpriority - getpriority i:ii getpriority getrlimit - getrlimit i:ip __getrlimit getrlimit getuid - getuid i: __getuid getuid -ioctl - ioctl i:iiV __ioctl ioctl +ioctl - ioctl i:iiI __ioctl ioctl kill - kill i:ii __kill kill link - link i:ss __link link lseek - lseek i:iii __libc_lseek __lseek lseek @@ -35,7 +35,7 @@ readv - readv i:ipi __readv readv reboot - reboot i:i reboot rename - rename i:ss rename rmdir - rmdir i:s __rmdir rmdir -select - select i:ipppp __select select +select - select i:iPPPP __select select setdomain - setdomainname i:si setdomainname setegid - setegid i:i __setegid setegid seteuid - seteuid i:i __seteuid seteuid @@ -45,10 +45,10 @@ setitimer - setitimer i:ipp __setitimer setpriority - setpriority i:iii setpriority setrlimit - setrlimit i:ip setrlimit setsid - setsid i: __setsid setsid -settimeofday - settimeofday i:pp __settimeofday settimeofday +settimeofday - settimeofday i:PP __settimeofday settimeofday setuid - setuid i:i __setuid setuid sigsuspend - sigsuspend i:p sigsuspend -sstk - sstk p:i sstk +sstk - sstk b:i sstk statfs - statfs i:sp __statfs statfs swapoff - swapoff i:s swapoff swapon - swapon i:s swapon Index: sysdeps/unix/common/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/common/syscalls.list,v retrieving revision 1.6 diff -u -p -r1.6 syscalls.list --- syscalls.list 2000/06/13 07:26:37 1.6 +++ syscalls.list 2000/07/16 05:35:32 @@ -6,8 +6,8 @@ fchown - fchown i:iii __fchown fchown ftruncate - ftruncate i:ii __ftruncate ftruncate getpgid - getpgrp i:i __getpgid getpgid getrusage - getrusage i:ip __getrusage getrusage -gettimeofday - gettimeofday i:pp __gettimeofday gettimeofday -settimeofday - settimeofday i:pp __settimeofday settimeofday +gettimeofday - gettimeofday i:PP __gettimeofday gettimeofday +settimeofday - settimeofday i:PP __settimeofday settimeofday setpgid - setpgrp i:ii __setpgid setpgid setregid - setregid i:ii __setregid setregid setreuid - setreuid i:ii __setreuid setreuid Index: sysdeps/unix/inet/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/inet/syscalls.list,v retrieving revision 1.7 diff -u -p -r1.7 syscalls.list --- syscalls.list 2000/07/06 00:48:38 1.7 +++ syscalls.list 2000/07/16 05:35:32 @@ -1,6 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names -accept - accept i:ibN __libc_accept accept +accept - accept i:iBN __libc_accept accept bind - bind i:ipi bind connect - connect i:ipi __libc_connect __connect connect gethostid - gethostid i: gethostid @@ -10,7 +10,7 @@ getsockname - getsockname i:ibN getsockn getsockopt - getsockopt i:iiiBN getsockopt listen - listen i:ii listen recv - recv i:ibni __libc_recv recv -recvfrom - recvfrom i:ibnibN __libc_recvfrom recvfrom +recvfrom - recvfrom i:ibniBN __libc_recvfrom recvfrom recvmsg - recvmsg i:ipi __libc_recvmsg recvmsg send - send i:ibni __libc_send __send send sendmsg - sendmsg i:ipi __libc_sendmsg sendmsg @@ -21,3 +21,7 @@ setsockopt - setsockopt i:iiibn setsocko shutdown - shutdown i:ii shutdown socket - socket i:iii socket socketpair - socketpair i:iiif socketpair + + + + Index: sysdeps/unix/mman/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/mman/syscalls.list,v retrieving revision 1.8 diff -u -p -r1.8 syscalls.list --- syscalls.list 2000/07/06 00:48:38 1.8 +++ syscalls.list 2000/07/16 05:35:32 @@ -5,7 +5,7 @@ # File name Caller Syscall name # args Strong name Weak names madvise - madvise i:pii madvise -mmap - mmap P:aniiii __mmap mmap +mmap - mmap b:aniiii __mmap mmap mprotect - mprotect i:aii __mprotect mprotect msync - msync i:aii __libc_msync msync munmap - munmap i:ai __munmap munmap Index: sysdeps/unix/sysv/linux/ia64/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/syscalls.list,v retrieving revision 1.4 diff -u -p -r1.4 syscalls.list --- syscalls.list 2000/07/06 00:48:39 1.4 +++ syscalls.list 2000/07/16 05:35:32 @@ -8,7 +8,7 @@ pread - pread 4 __syscall_pread __sysc pwrite - pwrite 4 __syscall_pwrite __syscall_pwrite64 __pwrite pwrite __pwrite64 pwrite64 fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64 statfs - statfs i:sp __statfs statfs statfs64 -mmap - mmap P:aniiii __mmap mmap __mmap64 mmap64 +mmap - mmap b:aniiii __mmap mmap __mmap64 mmap64 getpeername - getpeername i:ipp __getpeername getpeername getpriority - getpriority i:ii __getpriority getpriority @@ -26,7 +26,7 @@ semget - semget i:iii __semget semget semctl - semctl i:iiii __semctl semctl # proper socket implementations: -accept - accept i:ipp __libc_accept __accept accept +accept - accept i:iBN __libc_accept __accept accept bind - bind i:ipi __bind bind connect - connect i:ipi __libc_connect __connect connect getpeername - getpeername i:ipp __getpeername getpeername @@ -34,7 +34,7 @@ getsockname - getsockname i:ipp __getsoc getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen recv - recv i:ibni __libc_recv __recv recv -recvfrom - recvfrom i:ibnibN __libc_recvfrom __recvfrom recvfrom +recvfrom - recvfrom i:ibniBN __libc_recvfrom __recvfrom recvfrom recvmsg - recvmsg i:ipi __libc_recvmsg recvmsg send - send i:ibni __libc_send __send send sendmsg - sendmsg i:ipi __libc_sendmsg sendmsg Index: sysdeps/unix/sysv/linux/mips/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/syscalls.list,v retrieving revision 1.21 diff -u -p -r1.21 syscalls.list --- syscalls.list 2000/07/06 00:48:39 1.21 +++ syscalls.list 2000/07/16 05:35:32 @@ -9,14 +9,14 @@ cacheflush - cacheflush i:pii _flush_cac sysmips - sysmips i:iiii __sysmips sysmips # override select.S in parent directory: -select - select i:ipppp __select select +select - select i:iPPPP __select select sigsuspend - sigsuspend i:p __sigsuspend sigsuspend # # Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper; # it's provided for compatibility, though. # -accept - accept i:ipp __libc_accept __accept accept +accept - accept i:iBN __libc_accept __accept accept bind - bind i:ipi __bind bind connect - connect i:ipi __libc_connect __connect connect getpeername - getpeername i:ipp __getpeername getpeername @@ -24,7 +24,7 @@ getsockname - getsockname i:ipp __getsoc getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen recv - recv i:ibni __libc_recv __recv recv -recvfrom - recvfrom i:ibnibN __libc_recvfrom __recvfrom recvfrom +recvfrom - recvfrom i:ibniBN __libc_recvfrom __recvfrom recvfrom recvmsg - recvmsg i:ipi __libc_recvmsg __recvmsg recvmsg send - send i:ibni __libc_send __send send sendmsg - sendmsg i:ipi __libc_sendmsg __sendmsg sendmsg Index: sysdeps/unix/sysv/syscalls.list =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/syscalls.list,v retrieving revision 1.4 diff -u -p -r1.4 syscalls.list --- syscalls.list 2000/06/13 07:26:49 1.4 +++ syscalls.list 2000/07/16 05:35:32 @@ -7,7 +7,7 @@ pause - pause i: pause poll - poll i:pii poll s_getdents getdents getdents i:ipi __getdents setrlimit - setrlimit i:ip setrlimit -settimeofday - settimeofday i:pp __settimeofday settimeofday +settimeofday - settimeofday i:PP __settimeofday settimeofday signal - signal i:ii signal stime - stime i:p stime time - time i:p time From drepper@redhat.com Sun Jul 16 00:24:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 16 Jul 2000 00:24:00 -0000 Subject: PATCH: syscalls fixes for BPs References: <200007160649.XAA06223@kayak.mcgary.org> Message-ID: Greg McGary writes: > No build regressions. No binary changes for non-BP. > > OK? Yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kettenis@wins.uva.nl Sun Jul 16 03:43:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Sun, 16 Jul 2000 03:43:00 -0000 Subject: PR libc/1635 Message-ID: <200007161043.e6GAhjE00384@delius.kettenis.local> Hi Ulrich, In your handling of PR libc/1635, which proposes to renumber some of the AI_* constants in order to make them all unique, you wrote: What? Why can't the existing AI_* values stay there? Before the IPv6 people already do more damage by their dilettancy they should consult with people who understand something about compatibility. The AI_* in fact *must* remain the same since they are already part of the API. And there is absolutely no difference with the constants having values 1, 2, and 4 or 0x100, 0x200, and 0x400 resp. while I understand your sentiment here, this isn't quite true. The AI_V4MAPPED, AI_ALL and AI_ADDRCONFIG constants are only supposed to be used with getipnodebyname(). This call is completely absent in glibc 2.1, and even in glibc 2.2 getipnodebyname() isn't exported (it's not in inet/Versions). Therefore, I think renumbering these constants to avoid a clash, is a perfectly sensible thing to do, even if the proposed extensions in draft-ietf-ipngwg-rfc2553bis-00.txt aren't adopted. The following patch takes care of it. Mark PS Is there any reason why getipnodebyname() isn't exported yet? It looks as if it isn't very useful right now since the DNS NSS module doesn't provide _nss_dns_getipnodebyname_r(). I'll work on that. 2000-07-16 Mark Kettenis * resolv/netdb.h (AI_V4MAPPED, AI_ALL, AI_ADDRCONFIG): Adjust values to remove possible clash with other AI_* constants. (AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST): Define as hexadecimal constants to stress the fact they're in fact bit flags. Index: resolv/netdb.h =================================================================== RCS file: /cvs/glibc/libc/resolv/netdb.h,v retrieving revision 1.31 diff -u -p -r1.31 netdb.h --- resolv/netdb.h 2000/04/30 04:17:05 1.31 +++ resolv/netdb.h 2000/07/16 10:39:30 @@ -149,9 +149,9 @@ extern struct hostent *getipnodebyaddr ( extern struct hostent *getipnodebyname (__const char *__name, int __type, int __flags, int *__error_num) __THROW; -# define AI_V4MAPPED 1 /* IPv4-mapped addresses are acceptable. */ -# define AI_ALL 2 /* Return both IPv4 and IPv6 addresses. */ -# define AI_ADDRCONFIG 4 /* Use configuration of this host to choose +# define AI_V4MAPPED 0x0008 /* IPv4-mapped addresses are acceptable. */ +# define AI_ALL 0x0010 /* Return both IPv4 and IPv6 addresses. */ +# define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose returned address type. */ # define AI_DEFAULT (AI_V4MAPPED | AI_ADDRCONFIG) @@ -437,9 +437,9 @@ struct addrinfo }; /* Possible values for `ai_flags' field in `addrinfo' structure. */ -# define AI_PASSIVE 1 /* Socket address is intended for `bind'. */ -# define AI_CANONNAME 2 /* Request for canonical name. */ -# define AI_NUMERICHOST 4 /* Don't use name resolution. */ +# define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */ +# define AI_CANONNAME 0x0002 /* Request for canonical name. */ +# define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */ /* Error values for `getaddrinfo' function. */ # define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */ From aj@suse.de Sun Jul 16 05:02:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Sun, 16 Jul 2000 05:02:00 -0000 Subject: Malloc Problem in glibc 2.2 Message-ID: Hi Wolfram, looking at a problem with getrlimit/setrlimit, I noticed that malloc in glibc 2.2 doesn't work as expected. The appended program gives with a glibc 2.1 system: gromit:/tmp/pr:[0]$ ./rlimit rlim_cur 1240, rlim_max: 2147483647 malloc returned: (nil) But the current glibc 2.2 version does: $ LD_LIBRARY_PATH=. elf/ld-linux.so.2 /tmp/pr/rlimit rlim_cur 1240, rlim_max: 2147483647 malloc returned: 0x40117008 Looking at the syscalls I notice the following IMO significant difference: glibc 2.1 uses: write(1, "rlim_cur 1240, rlim_max: 2147483"..., 36rlim_cur 1240, rlim_max: 2147483647 ) = 36 brk(0) = 0x8049820 brk(0x804bf48) = 0x8049820 brk(0x804bf48) = 0x8049820 write(1, "malloc returned: (nil)\n", 23malloc returned: (nil) ) = 23 munmap(0x40014000, 4096) = 0 _exit(23) = ? and glibc 2.2 has: write(1, "rlim_cur 1240, rlim_max: 2147483"..., 36rlim_cur 1240, rlim_max: 2147483647 ) = 36 mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4012e000 write(1, "malloc returned: 0x4012e000\n", 28malloc returned: 0x4012e000 ) = 28 munmap(0x40018000, 4096) = 0 _exit(28) = ? Why is glibc 2.2 using mmap and glibc 2.1 not? Trying to disable mmap with glibc 2.2 didn't work: With glibc 2.1 I can do: $ MALLOC_MMAP_THRESHOLD_=1000 ./rlimit rlim_cur 1240, rlim_max: 2147483647 malloc returned: 0x40015008 But 2.2 ignores the value completly: gromit:/usr/src/test/glibc-2.2:[127]$ MALLOC_MMAP_THRESHOLD_=1000 ./rlimit rlim_cur 1240, rlim_max: 2147483647 malloc returned: 0x4012e000 gromit:/usr/src/test/glibc-2.2:[28]$ MALLOC_MMAP_THRESHOLD_=10000 ./rlimit rlim_cur 1240, rlim_max: 2147483647 malloc returned: 0x4012e000 gromit:/usr/src/test/glibc-2.2:[28]$ MALLOC_MMAP_THRESHOLD_=100000 ./rlimit rlim_cur 1240, rlim_max: 2147483647 malloc returned: 0x4012e000 MALLOC_MMAP_MAX_=0 didn't work either: with 2.1: $ MALLOC_MMAP_THRESHOLD_=1000 MALLOC_MMAP_MAX_=0 ./rlimit rlim_cur 1240, rlim_max: 2147483647 malloc returned: (nil) and with 2.2: $ MALLOC_MMAP_THRESHOLD_=1000 MALLOC_MMAP_MAX_=0 ./rlimit rlim_cur 1240, rlim_max: 2147483647 malloc returned: 0x4012e000 Do you have any idea what's broken here? This is with Linux 2.4.0-test4, a current gcc (one or two weeks old) and the current glibc sources. Andreas ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include #include #include #include int main (void) { struct rlimit rlim; void *p; assert(-1 != getrlimit(RLIMIT_DATA, &rlim)); rlim.rlim_cur = 1240; assert(-1 != setrlimit(RLIMIT_DATA, &rlim)); /* Get it again: */ assert(-1 != getrlimit(RLIMIT_DATA, &rlim)); printf ("rlim_cur %ld, rlim_max: %ld\n", rlim.rlim_cur, rlim.rlim_max); p = malloc (1000); printf ("malloc returned: %p\n", p); } -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de From wmglo@dent.med.uni-muenchen.de Sun Jul 16 10:21:00 2000 From: wmglo@dent.med.uni-muenchen.de (Wolfram Gloger) Date: Sun, 16 Jul 2000 10:21:00 -0000 Subject: Malloc Problem in glibc 2.2 References: Message-ID: <20000716172110.12399.qmail@md.dent.med.uni-muenchen.de> Hello, > looking at a problem with getrlimit/setrlimit, I noticed that malloc > in glibc 2.2 doesn't work as expected. The appended program gives > with a glibc 2.1 system: > > gromit:/tmp/pr:[0]$ ./rlimit > rlim_cur 1240, rlim_max: 2147483647 > malloc returned: (nil) > > But the current glibc 2.2 version does: > $ LD_LIBRARY_PATH=. elf/ld-linux.so.2 /tmp/pr/rlimit > rlim_cur 1240, rlim_max: 2147483647 > malloc returned: 0x40117008 I consider this a feature, not a bug :-). The increasing bunch of lucky people with >2GB 32bit systems will probably agree with me, too. All you have done with rlimit is to limit the `classical' heap even further than the `normal' 1GB, so the non-linear heap is now used. > Why is glibc 2.2 using mmap and glibc 2.1 not? If sbrk() would fail on 2.1, there could only be n_mmaps_max further allocations. No matter how large we would increase n_mmaps_max, I'm sure someone would complain that her machine still can't allocate all the available memory. So, I changed the meaning of n_mmaps_max to mean the following limit: In 2.1: n_mmaps_max was a hard limit on the number of chunks alocated with mmap(). Beyond the limit, if sbrk() failed, malloc would return 0. In 2.2: Until n_mmaps_max is reached, mmap() is used in preference of sbrk(). When n_mmaps_max is reached or passed, sbrk() is _always_ tried first. However, mmap() is now always tried as a last resort before giving up and returning 0. So, the parameter is still useful for avoiding mmap() on a system where it's very costly (Linux surely isn't such a system), but it doesn't limit the total number of chunks that can be allocated. > Do you have any idea what's broken here? This is with Linux > 2.4.0-test4, a current gcc (one or two weeks old) and the current > glibc sources. ... > rlim.rlim_cur = 1240; > assert(-1 != setrlimit(RLIMIT_DATA, &rlim)); IMHO RLIMIT_DATA is totally useless to limit the amount of memory allocated by a process, as it can be easily circumvented with mmap(). Why should malloc() obey that limit? Also, it didn't do so in 2.1, either. The only effective rlimit to control memory usage is RLIMIT_AS. Regards, Wolfram. From greg@mcgary.org Sun Jul 16 17:17:00 2000 From: greg@mcgary.org (Greg McGary) Date: Sun, 16 Jul 2000 17:17:00 -0000 Subject: PATCH: __memchr & bp-checks.h cleanups Message-ID: <200007170017.RAA12779@kayak.mcgary.org> No build regressions. No binary changes for non-BP (only the expected symbol-table changes). OK? 2000-07-16 Greg McGary * sysdeps/generic/bp-checks.h: Use unbounded __memchr rather than non-existent __ubp_memchr. (CHECK_STRINGopt, CHECK_FCNTL, BOUNDED_N, BOUNDED_1): New macros. (_CHECK_STRING, _CHECK_N): New macros. (CHECK_STRING, CHECK_N, CHECK_Nopt): Rewrite in terms of _CHECK_*. (CHECK_IOCTL): Move inside `#if !__ASSEMBLER__'. * sysdeps/alpha/memchr.S: Change strong name to "__memchr". Add weak alias "memchr". * sysdeps/generic/memchr.c: Likewise. * sysdeps/i386/memchr.S: Likewise. * sysdeps/ia64/memchr.S: Likewise. * sysdeps/m68k/memchr.S: Likewise. * sysdeps/sparc/sparc32/memchr.S: Likewise. * sysdeps/sparc/sparc64/memchr.S: Likewise. * sysdeps/vax/memchr.s: Likewise. Index: sysdeps/generic/bp-checks.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/generic/bp-checks.h,v retrieving revision 1.2 diff -u -p -B -w -r1.2 bp-checks.h --- bp-checks.h 2000/07/07 02:19:04 1.2 +++ bp-checks.h 2000/07/17 00:14:04 @@ -27,9 +27,8 @@ # if __BOUNDED_POINTERS__ -/* GKM FIXME: when gcc is ready, add real bounds checks */ # define BOUNDS_VIOLATED (__builtin_trap (), 0) -extern int __ubp_memchr (const char *__unbounded, int, unsigned); +extern int __memchr (const char *__unbounded, int, unsigned); /* Verify that pointer's value >= low. Return pointer value. */ # define CHECK_BOUNDS_LOW(ARG) \ @@ -41,36 +40,64 @@ extern int __ubp_memchr (const char *__u (((__ptrvalue (ARG) > __ptrhigh (ARG)) && BOUNDS_VIOLATED), \ __ptrvalue (ARG)) -/* Check bounds of a pointer seated to a single object. */ -# define CHECK_1(ARG) CHECK_N ((ARG), 1) - -/* Same as CHECK_1, but tolerate ARG == NULL. */ -# define CHECK_1opt(ARG) CHECK_Nopt ((ARG), 1) - -/* Check bounds of a pointer seated to an array of N objects. */ -# define CHECK_N(ARG, N) \ - (((__ptrvalue (ARG) < __ptrlow (ARG) \ +# define _CHECK_N(ARG, N, COND) \ + (((COND) \ + && (__ptrvalue (ARG) < __ptrlow (ARG) \ || __ptrvalue (ARG) + (N) > __ptrhigh (ARG)) \ - && BOUNDS_VIOLATED), __ptrvalue (ARG)) + && BOUNDS_VIOLATED), \ + __ptrvalue (ARG)) -/* Same as CHECK_N, but tolerate ARG == NULL. */ -# define CHECK_Nopt(ARG, N) \ - (((__ptrvalue (ARG) \ +# define _CHECK_STRING(ARG, COND) \ + (((COND) \ && (__ptrvalue (ARG) < __ptrlow (ARG) \ - || __ptrvalue (ARG) + (N) > __ptrhigh (ARG))) \ - && BOUNDS_VIOLATED), __ptrvalue (ARG)) - -/* Check for NUL-terminator within string's bounds. */ -# define CHECK_STRING(ARG) \ - (((__ptrvalue (ARG) < __ptrlow (ARG) \ - || !__ubp_memchr (__ptrvalue (ARG), '\0', \ + || !__memchr (__ptrvalue (ARG), '\0', \ (__ptrhigh (ARG) - __ptrvalue (ARG)))) \ && BOUNDS_VIOLATED), \ __ptrvalue (ARG)) +/* Check bounds of a pointer seated to an array of N objects. */ +# define CHECK_N(ARG, N) _CHECK_N ((ARG), (N), 1) +/* Same as CHECK_N, but tolerate ARG == NULL. */ +# define CHECK_Nopt(ARG, N) _CHECK_N ((ARG), (N), __ptrvalue (ARG)) + +/* Check bounds of a pointer seated to a single object. */ +# define CHECK_1(ARG) CHECK_N ((ARG), 1) +/* Same as CHECK_1, but tolerate ARG == NULL. */ +# define CHECK_1opt(ARG) CHECK_Nopt ((ARG), 1) + +/* Check for NUL-terminator within string's bounds. */ +# define CHECK_STRING(ARG) _CHECK_STRING ((ARG), 1) +/* Same as CHECK_STRING, but tolerate ARG == NULL. */ +# define CHECK_STRINGopt(ARG) _CHECK_STRING ((ARG), __ptrvalue (ARG)) + +/* Check bounds of signal syscall args with type sigset_t. */ # define CHECK_SIGSET(SET) CHECK_N ((SET), _NSIG / (8 * sizeof *(SET))) +/* Same as CHECK_SIGSET, but tolerate SET == NULL. */ # define CHECK_SIGSETopt(SET) CHECK_Nopt ((SET), _NSIG / (8 * sizeof *(SET))) +# if defined (_IOC_SIZESHIFT) && defined (_IOC_SIZEBITS) +/* Extract the size of the ioctl data and check its bounds. */ +# define CHECK_IOCTL(ARG, CMD) \ + CHECK_N ((const char *) (ARG), \ + (((CMD) >> _IOC_SIZESHIFT) & ((1 << _IOC_SIZEBITS) - 1))) +# else +/* We don't know the size of the ioctl data, so the best we can do + is check that the first byte is within bounds. */ +# define CHECK_IOCTL(ARG, CMD) CHECK_1 ((const char *) ARG) +# endif + +/* Check bounds of `struct flock *' for the locking fcntl commands. */ +# define CHECK_FCNTL(ARG, CMD) \ + (((CMD) == F_GETLK || (CMD) == F_SETLK || (CMD) == F_SETLKW) \ + ? CHECK_1 ((struct flock *) ARG) : (unsigned long) (ARG)) + +/* Return a bounded pointer with value PTR that satisfies CHECK_N (PTR, N). */ +# define BOUNDED_N(PTR, N) \ + ({ __typeof (*(PTR)) *__bounded _p_; \ + __ptrvalue _p_ = __ptrlow _p_ = __ptrvalue (PTR); \ + __ptrhigh _p_ = __ptrvalue _p_ + (N); \ + _p_; }) + # else /* !__BOUNDED_POINTERS__ */ /* Do nothing if not compiling with -fbounded-pointers. */ @@ -85,18 +112,13 @@ extern int __ubp_memchr (const char *__u # define CHECK_STRING(ARG) (ARG) # define CHECK_SIGSET(SET) (SET) # define CHECK_SIGSETopt(SET) (SET) +# define CHECK_IOCTL(ARG, CMD) (ARG) +# define CHECK_FCNTL(ARG, CMD) (ARG) +# define BOUNDED_N(PTR, N) (PTR) # endif /* !__BOUNDED_POINTERS__ */ - -# if defined (_IOC_SIZESHIFT) && defined (_IOC_SIZEBITS) -/* Extract the size of the ioctl parameter argument and check its bounds. */ -# define CHECK_IOCTL(ARG, CMD) \ - CHECK_N ((ARG), (((CMD) >> _IOC_SIZESHIFT) & ((1 << _IOC_SIZEBITS) - 1))) - -# else -# define CHECK_IOCTL(ARG, CMD) __ptrvalue (ARG) -# endif +# define BOUNDED_1(PTR) BOUNDED_N (PTR, 1) # endif /* !__ASSEMBLER__ */ Index: sysdeps/alpha/memchr.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/alpha/memchr.S,v retrieving revision 1.7 diff -u -p -r1.7 memchr.S --- memchr.S 1999/05/18 08:55:49 1.7 +++ memchr.S 2000/07/17 00:04:35 @@ -1,4 +1,4 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger (davidm@cs.arizona.edu). @@ -37,7 +37,7 @@ For correctness consider that: .set noreorder .set noat -ENTRY(memchr) +ENTRY(__memchr) #ifdef PROF ldgp gp, 0(pv) lda AT, _mcount @@ -167,4 +167,6 @@ $not_found: mov zero, v0 #-e0 : ret # .. e1 : - END(memchr) + END(__memchr) + +weak_alias (__stpcpy, stpcpy) Index: sysdeps/generic/memchr.c =================================================================== RCS file: /cvs/glibc/libc/sysdeps/generic/memchr.c,v retrieving revision 1.15 diff -u -p -r1.15 memchr.c --- memchr.c 2000/07/05 14:27:48 1.15 +++ memchr.c 2000/07/17 00:04:35 @@ -56,7 +56,7 @@ /* Search no more than N bytes of S for C. */ __ptr_t -memchr (s, c_in, n) +__memchr (s, c_in, n) const __ptr_t s; int c_in; size_t n; @@ -200,3 +200,4 @@ memchr (s, c_in, n) return 0; } +weak_alias (__memrchr, memrchr) Index: sysdeps/i386/memchr.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/i386/memchr.S,v retrieving revision 1.8 diff -u -p -r1.8 memchr.S --- memchr.S 2000/06/26 22:14:59 1.8 +++ memchr.S 2000/07/17 00:04:35 @@ -42,7 +42,7 @@ #define LEN CHR+4 .text -ENTRY (BP_SYM (memchr)) +ENTRY (BP_SYM (__memchr)) ENTER /* Save callee-safe registers used in this function. */ @@ -325,4 +325,6 @@ L(pop): popl %edi /* pop saved register LEAVE RET_PTR -END (BP_SYM (memchr)) +END (BP_SYM (__memchr)) + +weak_alias (BP_SYM (__memchr), BP_SYM (memchr)) Index: sysdeps/ia64/memchr.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/ia64/memchr.S,v retrieving revision 1.2 diff -u -p -r1.2 memchr.S --- memchr.S 2000/05/21 21:56:19 1.2 +++ memchr.S 2000/07/17 00:04:35 @@ -56,7 +56,7 @@ #define str in0 -ENTRY(memchr) +ENTRY(__memchr) alloc saved_pfs = ar.pfs, 3, 0, 29, 32 #include "softpipe.h" .rotr value[MEMLAT+1], addr[MEMLAT+3], aux[2], poschr[2] @@ -121,4 +121,6 @@ ENTRY(memchr) mov ar.lc = saved_lc br.ret.sptk.many b0 -END(memchr) +END(__memchr) + +weak_alias (__memchr, memchr) Index: sysdeps/m68k/memchr.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/m68k/memchr.S,v retrieving revision 1.1 diff -u -p -r1.1 memchr.S --- memchr.S 1999/06/14 00:59:40 1.1 +++ memchr.S 2000/07/17 00:04:35 @@ -1,7 +1,7 @@ /* memchr (str, ch, n) -- Return pointer to first occurrence of CH in the first N bytes of STR. For Motorola 68000. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab . @@ -24,7 +24,7 @@ #include "asm-syntax.h" TEXT -ENTRY(memchr) +ENTRY(__memchr) /* Save the callee-saved registers we use. */ moveml R(d2)-R(d4),MEM_PREDEC(sp) @@ -223,6 +223,6 @@ L(L9:) movel R(a0),R(d0) moveml MEM_POSTINC(sp),R(d2)-R(d4) rts -END(strchr) +END(__memchr) -weak_alias (strchr, index) +weak_alias (__memchr, memchr) Index: sysdeps/sparc/sparc32/memchr.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/sparc/sparc32/memchr.S,v retrieving revision 1.1 diff -u -p -r1.1 memchr.S --- memchr.S 1999/03/29 13:25:10 1.1 +++ memchr.S 2000/07/17 00:04:35 @@ -1,7 +1,7 @@ /* memchr (str, ch, n) -- Return pointer to first occurrence of CH in STR less than N. For SPARC v7. - Copyright (C) 1996,1999 Free Software Foundation, Inc. + Copyright (C) 1996,1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek and David S. Miller . @@ -67,7 +67,7 @@ 1: retl sub %o0, 1, %o0 -ENTRY(memchr) +ENTRY(__memchr) andcc %o1, 0xff, %o1 sll %o1, 8, %g7 andcc %o0, 3, %g0 @@ -140,4 +140,6 @@ ENTRY(memchr) sub %o0, 3, %o0 4: retl sub %o0, 4, %o0 -END(memchr) +END(__memchr) + +weak_alias (__memchr, memchr) Index: sysdeps/sparc/sparc64/memchr.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/sparc/sparc64/memchr.S,v retrieving revision 1.3 diff -u -p -r1.3 memchr.S --- memchr.S 1999/07/27 04:41:12 1.3 +++ memchr.S 2000/07/17 00:04:35 @@ -1,7 +1,7 @@ /* memchr (str, ch, n) -- Return pointer to first occurrence of CH in STR less than N. For SPARC v9. - Copyright (C) 1998,1999 Free Software Foundation, Inc. + Copyright (C) 1998,1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jan Vondrak and Jakub Jelinek . @@ -57,7 +57,7 @@ .text .align 32 -ENTRY(memchr) +ENTRY(__memchr) and %o1, 0xff, %o1 /* IEU0 Group */ #ifdef USE_BPR brz,pn %o2, 12f /* CTI+IEU1 */ @@ -256,4 +256,6 @@ ENTRY(memchr) 23: retl /* CTI+IEU1 Group */ add %o0, -1, %o0 /* IEU0 */ -END(memchr) +END(__memchr) + +weak_alias (__memchr, memchr) Index: sysdeps/vax/memchr.s =================================================================== RCS file: /cvs/glibc/libc/sysdeps/vax/memchr.s,v retrieving revision 1.3 diff -u -p -r1.3 memchr.s --- memchr.s 1999/06/09 12:58:10 1.3 +++ memchr.s 2000/07/17 00:04:35 @@ -45,7 +45,7 @@ #include "DEFS.h" -ENTRY(memchr, 0) +ENTRY(__memchr, 0) movq 4(ap),r1 # r1 = cp; r2 = c movl 12(ap),r0 # r0 = n movzwl $65535,r4 # handy constant @@ -67,3 +67,6 @@ ENTRY(memchr, 0) decw r0 # from 0 to 65535 subl2 r0,r4 # adjust n brb 0b # and loop + +weak_alias (__memchr, memchr) + \ No newline at end of file From drepper@redhat.com Sun Jul 16 17:28:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Sun, 16 Jul 2000 17:28:00 -0000 Subject: PATCH: __memchr & bp-checks.h cleanups References: <200007170017.RAA12779@kayak.mcgary.org> Message-ID: Greg McGary writes: > No build regressions. No binary changes for non-BP (only the expected > symbol-table changes). Yes. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@lucon.org Sun Jul 16 18:09:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Sun, 16 Jul 2000 18:09:00 -0000 Subject: More on shared libgcc Message-ID: <20000716180946.A25063@lucon.org> I have modified linker so that it will load symbols from files appear in DT_AUXILIARY. It seems to work ok. However, it may not solve all the problems alone. To generate an executable, gcc does # gcc -o aout crt1.o crti.o crtbegin.o *.o ... -lgcc -lc -lgcc crtend.o crtn.o If there are any references to symbols in libgcc from files between crtbegin.o and -lgcc, libgcc will be used regardless if they are defined in libc.so or not. That means if there is no libgcc.so, those references will result in defintions of those symbols in aout. But I don't think any C codes are affected. We can add new functions to libgcc without breaking any binaries. So far, I guess only C++ codes are affected. It may be solved by shared libstdc++ built with -Wl,--auxiliary,libgcc.so.x. That means libgcc.a will only be used for symbols not in libgcc.so.x. But there are no explicit dependencies on libgcc.so.x. But the binary will fail to run if the new functions used to build are not in the install libgcc.so.x. It is the same as glibc when we add new functions and a binary uses them. If you try to run it on an older glibc, you will get undefined symbols. I put my patch at http://www.lucon.org/binutils/tmp/binutild-auxiliary.patch But I don't know if it is really needed at all. I am also still not convinced that we need libgcc.so. We need to come up with some test cases first. H.J. From hjl@valinux.com Sun Jul 16 20:25:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Sun, 16 Jul 2000 20:25:00 -0000 Subject: and Message-ID: <20000716202546.A5629@valinux.com> Hi, includes and uses BP_SYM. But is not found anywhere. -- H.J. Lu (hjl@gnu.org) From greg@mcgary.org Mon Jul 17 01:33:00 2000 From: greg@mcgary.org (Greg McGary) Date: Mon, 17 Jul 2000 01:33:00 -0000 Subject: and References: <20000716202546.A5629@valinux.com> Message-ID: "H . J . Lu" writes: > includes and uses BP_SYM. But > is not found anywhere. For what compilation does it fail? There are three bits/libc-lock.h files: sysdeps/generic/bits/libc-lock.h sysdeps/mach/bits/libc-lock.h linuxthreads/sysdeps/pthread/bits/libc-lock.h You must be referring to the linuxthreads one, since that's the only one with BP_SYM & . The #include is well guarded, and should only happen in the context where bp-sym.h can be found in sysdeps/generic/bp-sym.h: ------------------------------------------------------------------------------ ... #ifndef __NO_WEAK_PTHREAD_ALIASES # ifdef weak_extern # if _LIBC # include # else # define BP_SYM (sym) sym # endif ... ------------------------------------------------------------------------------ How did you get it to fail? What host & target? Greg From jakub@redhat.com Mon Jul 17 01:45:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 17 Jul 2000 01:45:00 -0000 Subject: and References: <20000716202546.A5629@valinux.com> Message-ID: <20000717105017.J16148@sunsite.ms.mff.cuni.cz> On Mon, Jul 17, 2000 at 01:33:25AM -0700, Greg McGary wrote: > "H . J . Lu" writes: > > > includes and uses BP_SYM. But > > is not found anywhere. > > For what compilation does it fail? I think H.J. is using some older glibc from Red Hat rawhide which was made at the time when bp-sym.h was included unconditionally in libc-lock.h, right? This has been fixed since. Jakub From aj@suse.de Mon Jul 17 02:46:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Mon, 17 Jul 2000 02:46:00 -0000 Subject: Malloc Problem in glibc 2.2 References: <20000716172110.12399.qmail@md.dent.med.uni-muenchen.de> Message-ID: >>>>> Wolfram Gloger writes: Wolfram> Hello, >> looking at a problem with getrlimit/setrlimit, I noticed that malloc >> in glibc 2.2 doesn't work as expected. The appended program gives >> with a glibc 2.1 system: >> >> gromit:/tmp/pr:[0]$ ./rlimit >> rlim_cur 1240, rlim_max: 2147483647 >> malloc returned: (nil) >> >> But the current glibc 2.2 version does: >> $ LD_LIBRARY_PATH=. elf/ld-linux.so.2 /tmp/pr/rlimit >> rlim_cur 1240, rlim_max: 2147483647 >> malloc returned: 0x40117008 Wolfram> I consider this a feature, not a bug :-). The increasing bunch of Wolfram> lucky people with >2GB 32bit systems will probably agree with me, too. Wolfram> All you have done with rlimit is to limit the `classical' heap even Wolfram> further than the `normal' 1GB, so the non-linear heap is now used. Forget the rlimit issues, I've just used them to illustrate a problem I had with malloc. >> Why is glibc 2.2 using mmap and glibc 2.1 not? Wolfram> If sbrk() would fail on 2.1, there could only be n_mmaps_max further Wolfram> allocations. No matter how large we would increase n_mmaps_max, I'm Wolfram> sure someone would complain that her machine still can't allocate all Wolfram> the available memory. Wolfram> So, I changed the meaning of n_mmaps_max to mean the following limit: Wolfram> In 2.1: Wolfram> n_mmaps_max was a hard limit on the number of chunks alocated with Wolfram> mmap(). Beyond the limit, if sbrk() failed, malloc would return 0. Wolfram> In 2.2: Wolfram> Until n_mmaps_max is reached, mmap() is used in preference of sbrk(). Wolfram> When n_mmaps_max is reached or passed, sbrk() is _always_ tried first. Wolfram> However, mmap() is now always tried as a last resort before giving up Wolfram> and returning 0. Wolfram> So, the parameter is still useful for avoiding mmap() on a system Wolfram> where it's very costly (Linux surely isn't such a system), but it Wolfram> doesn't limit the total number of chunks that can be allocated. Do I understand you correctly that you changed the meanings of the environment variables MALLOC_MMAP_THRESHOLD_ and MALLOC_MMAP_MAX_ (and the corresponding mallopt options) in a non compatible way - which violates the documentation? Playing around with MALLOC_MMAP_MAX I noticed that it's impossible to switch off mmap completly. Do you really define this as a "feature" of glibc 2.2? IMO it's a bug. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.rhein-neckar.de From wmglo@dent.med.uni-muenchen.de Mon Jul 17 03:04:00 2000 From: wmglo@dent.med.uni-muenchen.de (Wolfram Gloger) Date: Mon, 17 Jul 2000 03:04:00 -0000 Subject: Malloc Problem in glibc 2.2 References: <20000716172110.12399.qmail@md.dent.med.uni-muenchen.de> Message-ID: <20000717100419.12580.qmail@md.dent.med.uni-muenchen.de> Hello, > Forget the rlimit issues, I've just used them to illustrate a problem > I had with malloc. OK. > Do I understand you correctly that you changed the meanings of the > environment variables MALLOC_MMAP_THRESHOLD_ and MALLOC_MMAP_MAX_ (and > the corresponding mallopt options) in a non compatible way - which > violates the documentation? The effect of MALLOC_MMAP_THRESHOLD_ isn't changed. I just want the default behaviour to be `address space completely allocatable', that's why I changed the meaning of MALLOC_MMAP_MAX_. > Playing around with MALLOC_MMAP_MAX I noticed that it's impossible to > switch off mmap completly. Do you really define this as a "feature" > of glibc 2.2? IMO it's a bug. OK, I see your point now, thanks. If setting MALLOC_MMAP_MAX_<=0 (whether via environment or via mallopt) would mean _no mmap whatsoever_, would that be enough (IIRC that's the way used in Emacs, for example)? I would submit a patch quickly then. I'll update the documentation as well. Regards, Wolfram. From aj@suse.de Mon Jul 17 03:08:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Mon, 17 Jul 2000 03:08:00 -0000 Subject: Malloc Problem in glibc 2.2 References: <20000716172110.12399.qmail@md.dent.med.uni-muenchen.de> <200007171000.MAA65156@max.zk-i.med.uni-muenchen.de> Message-ID: >>>>> Wolfram Gloger writes: Wolfram> Hello, >> Forget the rlimit issues, I've just used them to illustrate a problem >> I had with malloc. Wolfram> OK. >> Do I understand you correctly that you changed the meanings of the >> environment variables MALLOC_MMAP_THRESHOLD_ and MALLOC_MMAP_MAX_ (and >> the corresponding mallopt options) in a non compatible way - which >> violates the documentation? Wolfram> The effect of MALLOC_MMAP_THRESHOLD_ isn't changed. It has been changed in the way that mmap is now also used for smaller regions if sbrk fails. Wolfram> I just want the default behaviour to be `address space completely Wolfram> allocatable', that's why I changed the meaning of MALLOC_MMAP_MAX_. >> Playing around with MALLOC_MMAP_MAX I noticed that it's impossible to >> switch off mmap completly. Do you really define this as a "feature" >> of glibc 2.2? IMO it's a bug. Wolfram> OK, I see your point now, thanks. If setting MALLOC_MMAP_MAX_<=0 Wolfram> (whether via environment or via mallopt) would mean _no mmap Wolfram> whatsoever_, would that be enough (IIRC that's the way used in Emacs, Wolfram> for example)? I would submit a patch quickly then. I'll update the Wolfram> documentation as well. It would be according to the docu: @item M_MMAP_MAX The maximum number of chunks to allocate with @code{mmap}. Setting this to zero disables all use of @code{mmap}. @end table Please send a patch, Thanks, Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.rhein-neckar.de From kettenis@wins.uva.nl Mon Jul 17 03:15:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Mon, 17 Jul 2000 03:15:00 -0000 Subject: Patch for nss/getent.c Message-ID: <200007171015.e6HAFdV27136@delius.kettenis.local> This patch makes sure the getent program always prints a space between the numeric address and the hostname. Makes the program somwhat more usable in combination with IPv6 hosts. Mark 2000-07-17 Mark Kettenis * nss/getent.c (print_hosts): Make sure we always print a space between numeric addresses and hostnames. Index: nss/getent.c =================================================================== RCS file: /cvs/glibc/libc/nss/getent.c,v retrieving revision 1.4 diff -u -p -r1.4 getent.c --- getent.c 2000/07/12 19:52:39 1.4 +++ getent.c 2000/07/17 10:11:54 @@ -257,8 +257,9 @@ print_hosts (struct hostent *host) buf, sizeof (buf)); fputs (ip, stdout); - for (i = strlen (ip); i < 16; ++i) + for (i = strlen (ip); i < 15; ++i) fputs (" ", stdout); + fputs (" ", stdout); fputs (host->h_name, stdout); i = 0; From wmglo@dent.med.uni-muenchen.de Mon Jul 17 03:23:00 2000 From: wmglo@dent.med.uni-muenchen.de (Wolfram Gloger) Date: Mon, 17 Jul 2000 03:23:00 -0000 Subject: Malloc Problem in glibc 2.2 References: <20000716172110.12399.qmail@md.dent.med.uni-muenchen.de> <200007171000.MAA65156@max.zk-i.med.uni-muenchen.de> Message-ID: <20000717102304.12731.qmail@md.dent.med.uni-muenchen.de> Hello, > It would be according to the docu: > @item M_MMAP_MAX > The maximum number of chunks to allocate with @code{mmap}. Setting this > to zero disables all use of @code{mmap}. > @end table > > Please send a patch, OK here it is. Thanks. Regards, Wolfram. 2000-07-17 Wolfram Gloger * malloc/malloc.c (chunk_alloc): Use mmap_chunk() only if allowed, i.e. if n_mmaps_max>0. Index: libc/malloc/malloc.c =================================================================== RCS file: /cvs/glibc/libc/malloc/malloc.c,v retrieving revision 1.63 diff -u -r1.63 malloc.c --- malloc.c 2000/06/28 23:27:03 1.63 +++ malloc.c 2000/07/17 10:18:15 @@ -2942,8 +2942,8 @@ { #if HAVE_MMAP /* A last attempt: when we are out of address space in the arena, - try mmap anyway, disregarding n_mmaps_max. */ - if((victim = mmap_chunk(nb)) != 0) + try mmap anyway, as long as it is allowed at all. */ + if (n_mmaps_max > 0 && (victim = mmap_chunk(nb)) != 0) return victim; #endif return 0; /* propagate failure */ From jakub@redhat.com Mon Jul 17 04:43:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 17 Jul 2000 04:43:00 -0000 Subject: [PATCH] dladdr fix Message-ID: <20000717134819.B20511@sunsite.ms.mff.cuni.cz> Hi! This has been seen in JDK (still does not work, am looking into linuxthreads right now). Basically, the main object and ld.so have l_map_end set to ~0L, so if _dl_addr is called with an address from some non-dlopened shared library (e.g. void foo(void) { Dl_info i; dladdr(foo, &i); } in a dso), then the test chooses the main program as a match (because foo address is certainly below ~0L and above l_map_start of the main object), fails in the PHDR check and returns 0. 2000-07-17 Jakub Jelinek * elf/dl-addr.c (_dl_addr): Keep searching in the _dl_loaded chain if the PHDR check fails. --- libc/elf/dl-addr.c.jj Thu Jun 8 04:34:29 2000 +++ libc/elf/dl-addr.c Mon Jul 17 12:19:16 2000 @@ -36,27 +36,25 @@ _dl_addr (const void *address, Dl_info * for (l = _dl_loaded; l; l = l->l_next) if (addr >= l->l_map_start && addr < l->l_map_end) { + /* We know ADDRESS lies within L if in any shared object. + Make sure it isn't past the end of L's segments. */ + size_t n = l->l_phnum; + if (n > 0) + { + do + --n; + while (l->l_phdr[n].p_type != PT_LOAD); + if (addr >= (l->l_addr + + l->l_phdr[n].p_vaddr + l->l_phdr[n].p_memsz)) + /* Off the end of the highest-addressed shared object. */ + continue; + } + match = l; break; } - if (__builtin_expect (match != NULL, 1)) - { - /* We know ADDRESS lies within MATCH if in any shared object. - Make sure it isn't past the end of MATCH's segments. */ - size_t n = match->l_phnum; - if (n > 0) - { - do - --n; - while (match->l_phdr[n].p_type != PT_LOAD); - if (addr >= (match->l_addr + - match->l_phdr[n].p_vaddr + match->l_phdr[n].p_memsz)) - /* Off the end of the highest-addressed shared object. */ - return 0; - } - } - else + if (match == NULL) return 0; /* Now we know what object the address lies in. */ Jakub From jakub@redhat.com Mon Jul 17 05:21:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 17 Jul 2000 05:21:00 -0000 Subject: [PATCH] __pthread_initializer_manager locking issue Message-ID: <20000717142626.C20511@sunsite.ms.mff.cuni.cz> Hi! Without this, I get a SEGFAULT when trying to debug some threaded programs. Basically, what happens is that __pthread_unlock is called on an unlocked lock (__status = 0, __lock = 0). Is __pthread_unlock allowed to segfault on such a spinlock btw? But this lead me to read the code and I think we must lock __pthread_manager_thread.p_lock before calling clone, otherwise it does not make any sense why the special __pthread_manager_event etc., because that routine on an unlocked p_lock will just call __pthread_manager immediately. 2000-07-17 Jakub Jelinek * pthread.c (__pthread_initialize_manager): Lock __pthread_manager_thread.p_lock before calling clone. --- libc/linuxthreads/pthread.c.jj Wed Jul 12 16:05:35 2000 +++ libc/linuxthreads/pthread.c Mon Jul 17 14:06:45 2000 @@ -444,6 +444,7 @@ int __pthread_initialize_manager(void) | __pthread_initial_thread.p_eventbuf.eventmask.event_bits[idx])) != 0) { + __pthread_lock(__pthread_manager_thread.p_lock, NULL); pid = __clone(__pthread_manager_event, (void **) __pthread_manager_thread_tos, CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND, @@ -465,9 +466,10 @@ int __pthread_initialize_manager(void) /* Now call the function which signals the event. */ __linuxthreads_create_event (); - /* Now restart the thread. */ - __pthread_unlock(__pthread_manager_thread.p_lock); } + + /* Now restart the thread. */ + __pthread_unlock(__pthread_manager_thread.p_lock); } } Jakub From jakub@redhat.com Mon Jul 17 06:11:00 2000 From: jakub@redhat.com (Jakub Jelinek) Date: Mon, 17 Jul 2000 06:11:00 -0000 Subject: [PATCH] Fix nl_langinfo binary compatibility Message-ID: <20000717151559.D20511@sunsite.ms.mff.cuni.cz> Hi! nl_langinfo is not binary compatible with glibc 2.1. The reason is that CODESET used to be 14 and now is 11. I've checked the rest of the documented nl_langinfo arguments and they should be ok. With this patch (and the two I've already sent) JDK finally runs. 2000-07-17 Jakub Jelinek * locale/nl_langinfo (__nl_langinfo): Renamed from nl_langinfo. (__nl_old_langinfo): New. * locale/Versions: Add nl_langinfo@@GLIBC_2.2. --- libc/locale/nl_langinfo.c.jj Wed Mar 22 16:36:05 2000 +++ libc/locale/nl_langinfo.c Mon Jul 17 14:59:36 2000 @@ -20,14 +20,15 @@ #include #include #include +#include #include "localeinfo.h" +char *__nl_langinfo (nl_item); /* Return a string with the data for locale-dependent parameter ITEM. */ char * -nl_langinfo (item) - nl_item item; +__nl_langinfo (nl_item item) { int category = _NL_ITEM_CATEGORY (item); unsigned int index = _NL_ITEM_INDEX (item); @@ -46,3 +47,19 @@ nl_langinfo (item) /* Return the string for the specified item. */ return (char *) data->values[index].string; } + +versioned_symbol (libc, __nl_langinfo, nl_langinfo, GLIBC_2_2); +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2) + +char *__nl_old_langinfo (nl_item); + +char * +__nl_old_langinfo (nl_item item) +{ + if (item == _NL_ITEM (LC_CTYPE, 14)) + item = CODESET; + return __nl_langinfo (item); +} + +compat_symbol (libc, __nl_old_langinfo, nl_langinfo, GLIBC_2_0); +#endif --- libc/locale/Versions.jj Thu Jun 1 06:28:29 2000 +++ libc/locale/Versions Mon Jul 17 14:57:33 2000 @@ -30,5 +30,8 @@ libc { GLIBC_2.2 { # The data structure changed. localeconv; + + # CODESET has changed. + nl_langinfo; } } Jakub From hjl@valinux.com Mon Jul 17 09:13:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Mon, 17 Jul 2000 09:13:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <20000711134337.A16026@valinux.com> <20000711150216.A16199@valinux.com> <200007141425.e6EEP5R02346@delius.kettenis.local> <200007141944.MAA01180@localhost.cygnus.com> Message-ID: <20000717091320.B15499@valinux.com> On Mon, Jul 17, 2000 at 05:59:22AM -0300, Alexandre Oliva wrote: > On Jul 14, 2000, Geoff Keating wrote: > > > [aoliva said:] > > >> Despite the minor problem of how to bootstrap this situation. > > > You can have circular dependencies involving libc. > > Yup. I was talking about how to *create* the libraries in such a way > that each one uses the appropriate SONAME to refer to the other. As I > said, no big deal, it just has to be done carefully. > I am doing some experiments on the shared libgcc. I have added -Wl,--auxiliary,libgcc.so.3 when building my libc.so. I created a shell script, updatelibgcc. updatelibgcc takes CC and slibdir from environment to build/install libgcc.so.3. It seems to work so far. One interesting thing I noticed that libgcc.so might not be needed at all under Linux. I don't like the explicit dependency on libgcc.so. Can someone tell me if there is a case --auxiliary libgcc.so.3 is not enough for Linux? I may have missed something. Thanks. -- H.J. Lu (hjl@gnu.org) From hjl@valinux.com Mon Jul 17 09:20:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Mon, 17 Jul 2000 09:20:00 -0000 Subject: and References: <20000716202546.A5629@valinux.com> <20000717105017.J16148@sunsite.ms.mff.cuni.cz> Message-ID: <20000717092001.C15499@valinux.com> On Mon, Jul 17, 2000 at 10:50:17AM +0200, Jakub Jelinek wrote: > On Mon, Jul 17, 2000 at 01:33:25AM -0700, Greg McGary wrote: > > "H . J . Lu" writes: > > > > > includes and uses BP_SYM. But > > > is not found anywhere. > > > > For what compilation does it fail? > > I think H.J. is using some older glibc from Red Hat rawhide which was made > at the time when bp-sym.h was included unconditionally in libc-lock.h, > right? > This has been fixed since. > I updated my glibc. I can compile gcc from CVS now. But with libstdc++ v3 enabled, I got so many failures with "make check". Some of them may be solved by libgcc.so.3 since I am using an older gcc to compile libc.so. But I also got output is: In file included from /work/gnu/src/gcc-3.0/egcs/libstdc++-v3/bits/std_typeinfo.h:34,^M from /work/gnu/src/gcc-3.0/egcs/libstdc++-v3/std/typeinfo:2,^M from /work/gnu/src/gcc-3.0/egcs/gcc/testsuite/g++.old-deja/g++.abi/ptrflags.C:5:^M /work/gnu/src/gcc-3.0/egcs/libstdc++-v3/bits/std_exception.h:34:2: ISO C does not allow #include_next^M In file included from /work/gnu/src/gcc-3.0/egcs/libstdc++-v3/std/typeinfo:2,^M from /work/gnu/src/gcc-3.0/egcs/gcc/testsuite/g++.old-deja/g++.abi/ptrflags.C:5:^M /work/gnu/src/gcc-3.0/egcs/libstdc++-v3/bits/std_typeinfo.h:38:3: ISO C does not allow #include_next^M It is caused by -ansi -pedantic-errors and -I. I have reported it to gcc a few weeks ago. I even provided a patch. I guess noone is interested. -- H.J. Lu (hjl@gnu.org) From drepper@redhat.com Mon Jul 17 14:38:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 17 Jul 2000 14:38:00 -0000 Subject: res_ninit() -> res_ninit (&_res) References: <200007152350.e6FNoKs27659@delius.kettenis.local> Message-ID: I've applied the patch. Thanks, -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Jul 17 14:38:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 17 Jul 2000 14:38:00 -0000 Subject: PR libc/1635 References: <200007161043.e6GAhjE00384@delius.kettenis.local> Message-ID: OK, I've applied the patch. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Jul 17 14:42:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 17 Jul 2000 14:42:00 -0000 Subject: Patch for nss/getent.c References: <200007171015.e6HAFdV27136@delius.kettenis.local> Message-ID: Thanks, I've applied the patch. The use of fputs() to print a single space looks strange. Maybe somebody can take a look an rewrite the code replacing fputs with putc_unlocked. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From drepper@redhat.com Mon Jul 17 14:42:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 17 Jul 2000 14:42:00 -0000 Subject: Malloc Problem in glibc 2.2 References: <20000716172110.12399.qmail@md.dent.med.uni-muenchen.de> <200007171000.MAA65156@max.zk-i.med.uni-muenchen.de> <20000717102304.12731.qmail@md.dent.med.uni-muenchen.de> Message-ID: Wolfram Gloger writes: > 2000-07-17 Wolfram Gloger > > * malloc/malloc.c (chunk_alloc): Use mmap_chunk() only if allowed, > i.e. if n_mmaps_max>0. Looks fine. Can we get this documented? -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From kettenis@wins.uva.nl Mon Jul 17 14:49:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Mon, 17 Jul 2000 14:49:00 -0000 Subject: PR libc/1635 References: <200007161043.e6GAhjE00384@delius.kettenis.local> Message-ID: <200007172149.e6HLnUc11140@delius.kettenis.local> From: Ulrich Drepper Date: 17 Jul 2000 14:38:29 -0700 OK, I've applied the patch. Thanks, I'll close the bug report. We'll need to add `getipnodebyname' to `inet/Versions' someday. However, the current implementation contains some bugs. I'm already working on those, and I'll provide a patch (including a test) in the near future. If you haven't added it by then, I'll included the `inet/Versions' patch too. Mark From drepper@redhat.com Mon Jul 17 15:10:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 17 Jul 2000 15:10:00 -0000 Subject: PR libc/1635 References: <200007161043.e6GAhjE00384@delius.kettenis.local> <200007172149.e6HLnUc11140@delius.kettenis.local> Message-ID: Mark Kettenis writes: > We'll need to add `getipnodebyname' to `inet/Versions' someday. > However, the current implementation contains some bugs. I'm already > working on those, and I'll provide a patch (including a test) in the > near future. If you haven't added it by then, I'll included the > `inet/Versions' patch too. Well, these functions will go away. They don't solve the problems they are designed to solve. I'm not convinced it's a good idea to add the functions at all. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Mon Jul 17 16:28:00 2000 From: greg@mcgary.org (Greg McGary) Date: Mon, 17 Jul 2000 16:28:00 -0000 Subject: PATCH: BPs for elf PLT trampoline References: <200007160537.WAA02858@kayak.mcgary.org> Message-ID: Ulrich Drepper writes: > Greg McGary writes: > > > - struct link_map *l, ElfW(Word) reloc_offset) > > + struct link_map *__unbounded l, ElfW(Word) reloc_offset) > > I think we should rather fix the trampoline code. Maybe in a second > phase but __unbounded should not be the last word. Fine. I'll check it in with a FIXME comment for the above change. From kettenis@wins.uva.nl Mon Jul 17 17:14:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Mon, 17 Jul 2000 17:14:00 -0000 Subject: PR libc/1635 References: <200007161043.e6GAhjE00384@delius.kettenis.local> <200007172149.e6HLnUc11140@delius.kettenis.local> Message-ID: <200007180014.e6I0Eaq11313@delius.kettenis.local> Sender: drepper@cygnus.com Cc: libc-hacker@sourceware.cygnus.com Reply-To: drepper@cygnus.com (Ulrich Drepper) X-fingerprint: BE 3B 21 04 BC 77 AC F0 61 92 E4 CB AC DD B9 5A From: Ulrich Drepper Date: 17 Jul 2000 15:11:04 -0700 Content-Type: text/plain; charset=US-ASCII Mark Kettenis writes: > We'll need to add `getipnodebyname' to `inet/Versions' someday. > However, the current implementation contains some bugs. I'm already > working on those, and I'll provide a patch (including a test) in the > near future. If you haven't added it by then, I'll included the > `inet/Versions' patch too. Well, these functions will go away. They don't solve the problems they are designed to solve. I'm not convinced it's a good idea to add the functions at all. I'm surprised to hear that. Did I miss something? They're still present in the Austin draft 3, and I haven't seen any traffick on the Austin mailing list about them. And AFAIK RFC 2553bis (draft-ietf-ipngwg-rfc2553bis) isn't amended/withdrawn either. Anyway, if they're really going to be replaced, we definitely shouldn't add them (remove getipnodybyaddr() again). Mark From greg@mcgary.org Mon Jul 17 17:38:00 2000 From: greg@mcgary.org (Greg McGary) Date: Mon, 17 Jul 2000 17:38:00 -0000 Subject: PATCH: remaining powerpc BP mods References: <200007121910.MAA25188@kayak.mcgary.org> Message-ID: Greg McGary writes: > No build-shared or build-static regressions. > No binary differences anticipated for non-BP (comparison build in progress). I finally got my PPC box going again, and no there were no binary differences. These mods are already approved by Uli. > 2000-07-12 Greg McGary > > * sysdeps/powerpc/bp-asm.h (DISCARD_BOUNDS): Rename from UNCHECK_BOUNDS. > * sysdeps/powerpc/bits/setjmp.h (JB_SIZE): New constant. > * sysdeps/powerpc/elf/libc-start.c (__libc_start_main): > Wrap bounds around argv & envp and each of their string members. > * sysdeps/powerpc/elf/start.S: Designate BP symbols. > * sysdeps/unix/sysv/linux/powerpc/brk.S: Wrap entry-point > symbol in BP_SYM (). Discard bounds of address arg. > * sysdeps/unix/sysv/linux/powerpc/clone.S: Likewise. > * sysdeps/unix/sysv/linux/powerpc/mmap64.c (__mmap64): > Discard bounds on address arg, add bounds to return value. From drepper@redhat.com Mon Jul 17 17:54:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 17 Jul 2000 17:54:00 -0000 Subject: PR libc/1635 References: <200007161043.e6GAhjE00384@delius.kettenis.local> <200007172149.e6HLnUc11140@delius.kettenis.local> <200007180014.e6I0Eaq11313@delius.kettenis.local> Message-ID: Mark Kettenis writes: > I'm surprised to hear that. Did I miss something? They're still > present in the Austin draft 3, and I haven't seen any traffick on the > Austin mailing list about them. And AFAIK RFC 2553bis > (draft-ietf-ipngwg-rfc2553bis) isn't amended/withdrawn either. I know. I met the people responsible for all this. The problem with getipnode*() is that they are not able to fill all the information for IPv6 (e.g, the sin6_scope_id and sin6_flowinfo info). > Anyway, if they're really going to be replaced, we definitely > shouldn't add them (remove getipnodybyaddr() again). This is my information. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From hjl@valinux.com Mon Jul 17 20:49:00 2000 From: hjl@valinux.com (H . J . Lu) Date: Mon, 17 Jul 2000 20:49:00 -0000 Subject: New failure Message-ID: <20000717204856.A25977@valinux.com> With "make check" in localedata Generating locale de_DE.ISO-8859-1: this might take a while... Generating locale de_DE.UTF-8: this might take a while... Generating locale en_US.ISO-8859-1: this might take a while... Generating locale en_US.ANSI_X3.4-1968: this might take a while... localedef: programs/ld-ctype.c:1126: ctype_output: Assertion `! "unknown CTYPE element"' failed. gen-locale.sh: line 4: 25942 Aborted I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata ${localedef} --quiet -c -f $charmap -i $input ${common_objpfx}localedata/$out make[2]: *** [/work/build/gnu/bin/glibc/localedata/de_DE.ISO-8859-1/LC_CTYPE] Error 134 -- H.J. Lu (hjl@gnu.org) From hjl@lucon.org Mon Jul 17 20:53:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Mon, 17 Jul 2000 20:53:00 -0000 Subject: New failure References: <20000717204856.A25977@valinux.com> Message-ID: <20000717205314.A28999@lucon.org> On Mon, Jul 17, 2000 at 08:48:56PM -0700, H . J . Lu wrote: > With "make check" in localedata > > > Generating locale de_DE.ISO-8859-1: this might take a while... > Generating locale de_DE.UTF-8: this might take a while... > Generating locale en_US.ISO-8859-1: this might take a while... > Generating locale en_US.ANSI_X3.4-1968: this might take a while... > localedef: programs/ld-ctype.c:1126: ctype_output: Assertion `! "unknown CTYPE element"' failed. > gen-locale.sh: line 4: 25942 Aborted I18NPATH=. GCONV_PATH=${common_objpfx}iconvdata ${localedef} --quiet -c -f $charmap -i $input ${common_objpfx}localedata/$out > make[2]: *** [/work/build/gnu/bin/glibc/localedata/de_DE.ISO-8859-1/LC_CTYPE] Error 134 > Ulrich, Do we need to modify ctype_output () in programs/ld-ctype.c for your change: 2000-07-17 Ulrich Drepper * locale/langinfo.h: Add placeholder values in enum for removed LC_CTYPE entries. H.J. From drepper@redhat.com Mon Jul 17 21:04:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Mon, 17 Jul 2000 21:04:00 -0000 Subject: New failure References: <20000717204856.A25977@valinux.com> <20000717205314.A28999@lucon.org> Message-ID: "H . J . Lu" writes: > Do we need to modify ctype_output () in programs/ld-ctype.c for your > change: I just did that. Compiling is under way. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Tue Jul 18 00:17:00 2000 From: greg@mcgary.org (Greg McGary) Date: Tue, 18 Jul 2000 00:17:00 -0000 Subject: PATCH: malloc.c cleanups Message-ID: <200007180717.AAA28227@kayak.mcgary.org> These are preparatory cleanups for BP support. No build regressions. No binary changes. OK? 2000-07-18 Greg McGary * malloc/malloc.c (next_chunk, prev_chunk, inuse_bit_at_offset, set_inuse_bit_at_offset, clear_inuse_bit_at_offset, set_foot): Define in terms of chunk_at_offset. (inuse, set_inuse, clear_inuse): Define in terms of next_chunk. (next_bin, prev_bin): offset by size of real array elements. (chunk_align): Make `m' a scalar, since that's how it's used. Index: malloc/malloc.c =================================================================== RCS file: /cvs/glibc/libc/malloc/malloc.c,v retrieving revision 1.64 diff -u -p -r1.64 malloc.c --- malloc.c 2000/07/17 21:37:47 1.64 +++ malloc.c 2000/07/18 07:17:01 @@ -1330,11 +1330,11 @@ static void free_atfork(); /* Ptr to next physical malloc_chunk. */ -#define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->size & ~PREV_INUSE) )) +#define next_chunk(p) chunk_at_offset((p), (p)->size & ~PREV_INUSE) /* Ptr to previous physical malloc_chunk */ -#define prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_size) )) +#define prev_chunk(p) chunk_at_offset((p), -(p)->prev_size) /* Treat space at ptr + offset as a chunk */ @@ -1350,8 +1350,7 @@ static void free_atfork(); /* extract p's inuse bit */ -#define inuse(p) \ - ((((mchunkptr)(((char*)(p))+((p)->size & ~PREV_INUSE)))->size) & PREV_INUSE) +#define inuse(p) (next_chunk(p)->size & PREV_INUSE) /* extract inuse bit of previous chunk */ @@ -1363,22 +1362,20 @@ static void free_atfork(); /* set/clear chunk as in use without otherwise disturbing */ -#define set_inuse(p) \ - ((mchunkptr)(((char*)(p)) + ((p)->size & ~PREV_INUSE)))->size |= PREV_INUSE +#define set_inuse(p) (next_chunk(p)->size |= PREV_INUSE) -#define clear_inuse(p) \ - ((mchunkptr)(((char*)(p)) + ((p)->size & ~PREV_INUSE)))->size &= ~(PREV_INUSE) +#define clear_inuse(p) (next_chunk(p)->size &= ~PREV_INUSE) /* check/set/clear inuse bits in known places */ -#define inuse_bit_at_offset(p, s)\ - (((mchunkptr)(((char*)(p)) + (s)))->size & PREV_INUSE) +#define inuse_bit_at_offset(p, s) \ + (chunk_at_offset((p), (s))->size & PREV_INUSE) -#define set_inuse_bit_at_offset(p, s)\ - (((mchunkptr)(((char*)(p)) + (s)))->size |= PREV_INUSE) +#define set_inuse_bit_at_offset(p, s) \ + (chunk_at_offset((p), (s))->size |= PREV_INUSE) -#define clear_inuse_bit_at_offset(p, s)\ - (((mchunkptr)(((char*)(p)) + (s)))->size &= ~(PREV_INUSE)) +#define clear_inuse_bit_at_offset(p, s) \ + (chunk_at_offset((p), (s))->size &= ~(PREV_INUSE)) @@ -1401,7 +1398,7 @@ static void free_atfork(); /* Set size at footer (only when chunk is not in use) */ -#define set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_size = (s)) +#define set_foot(p, s) (chunk_at_offset(p, s)->prev_size = (s)) @@ -1411,8 +1408,8 @@ static void free_atfork(); #define bin_at(a, i) ((mbinptr)((char*)&(((a)->av)[2*(i) + 2]) - 2*SIZE_SZ)) #define init_bin(a, i) ((a)->av[2*i+2] = (a)->av[2*i+3] = bin_at((a), i)) -#define next_bin(b) ((mbinptr)((char*)(b) + 2 * sizeof(mbinptr))) -#define prev_bin(b) ((mbinptr)((char*)(b) - 2 * sizeof(mbinptr))) +#define next_bin(b) ((mbinptr)((char*)(b) + 2 * sizeof(((arena*)0)->av[0]))) +#define prev_bin(b) ((mbinptr)((char*)(b) - 2 * sizeof(((arena*)0)->av[0]))) /* The first 2 bins are never indexed. The corresponding av cells are instead @@ -3532,7 +3529,7 @@ chunk_align(ar_ptr, nb, alignment) arena* ar_ptr; INTERNAL_SIZE_T nb; size_t alignment; #endif { - char* m; /* memory returned by malloc call */ + unsigned long m; /* memory returned by malloc call */ mchunkptr p; /* corresponding chunk */ char* brk; /* alignment point within p */ mchunkptr newp; /* chunk to return */ @@ -3546,9 +3543,9 @@ arena* ar_ptr; INTERNAL_SIZE_T nb; size_ if (p == 0) return 0; /* propagate failure */ - m = (char*)chunk2mem(p); + m = (unsigned long)chunk2mem(p); - if ((((unsigned long)(m)) % alignment) == 0) /* aligned */ + if ((m % alignment) == 0) /* aligned */ { #if HAVE_MMAP if(chunk_is_mmapped(p)) { @@ -3567,8 +3564,7 @@ arena* ar_ptr; INTERNAL_SIZE_T nb; size_ this is always possible. */ - brk = (char*)mem2chunk(((unsigned long)(m + alignment - 1)) & - -(long)alignment); + brk = (char*)mem2chunk(((m + alignment - 1)) & -(long)alignment); if ((long)(brk - (char*)(p)) < (long)MINSIZE) brk += alignment; newp = (mchunkptr)brk; From wmglo@dent.med.uni-muenchen.de Tue Jul 18 00:49:00 2000 From: wmglo@dent.med.uni-muenchen.de (Wolfram Gloger) Date: Tue, 18 Jul 2000 00:49:00 -0000 Subject: Malloc Problem in glibc 2.2 References: <20000716172110.12399.qmail@md.dent.med.uni-muenchen.de> <200007171000.MAA65156@max.zk-i.med.uni-muenchen.de> <20000717102304.12731.qmail@md.dent.med.uni-muenchen.de> Message-ID: <20000718074930.13142.qmail@md.dent.med.uni-muenchen.de> > > 2000-07-17 Wolfram Gloger > > > > * malloc/malloc.c (chunk_alloc): Use mmap_chunk() only if allowed, > > i.e. if n_mmaps_max>0. > > Looks fine. Can we get this documented? Yes, I'll take a look at it. If you don't hear from me until next week, please remind me. Regards, Wolfram. From wmglo@dent.med.uni-muenchen.de Tue Jul 18 01:23:00 2000 From: wmglo@dent.med.uni-muenchen.de (Wolfram Gloger) Date: Tue, 18 Jul 2000 01:23:00 -0000 Subject: PATCH: malloc.c cleanups References: <200007180717.AAA28227@kayak.mcgary.org> Message-ID: <20000718082325.13174.qmail@md.dent.med.uni-muenchen.de> Hello, > These are preparatory cleanups for BP support. > No build regressions. No binary changes. > > OK? They all look just fine to me, except for this: > -#define next_bin(b) ((mbinptr)((char*)(b) + 2 * sizeof(mbinptr))) > -#define prev_bin(b) ((mbinptr)((char*)(b) - 2 * sizeof(mbinptr))) > +#define next_bin(b) ((mbinptr)((char*)(b) + 2 * sizeof(((arena*)0)->av[0]))) > +#define prev_bin(b) ((mbinptr)((char*)(b) - 2 * sizeof(((arena*)0)->av[0]))) which I don't really consider an improvement. Do changes like these really make a difference for BP, i.e. can more errors be detected? If yes, that's pretty cool. Regards, Wolfram. From aj@suse.de Tue Jul 18 01:36:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Tue, 18 Jul 2000 01:36:00 -0000 Subject: undefined reference to `memchr' Message-ID: On PPC I got a number of undefined references to memchr: /usr/src/packages/BUILD/glibc-2.2/cc/libc.so.6: undefined reference to `memchr' collect2: ld returned 1 exit status make[2]: *** [/usr/src/packages/BUILD/glibc-2.2/cc/iconv/iconv_prog] Error 1 make[2]: Target `others' not remade because of errors. Copy & Paste should be forbidden ;-). I've committed the appended patch, Andreas 2000-07-18 Andreas Jaeger * sysdeps/generic/memchr.c: Fix copy & paste error: Use memchr instead of memrchr. ============================================================ Index: sysdeps/generic/memchr.c --- sysdeps/generic/memchr.c 2000/07/17 22:36:15 1.16 +++ sysdeps/generic/memchr.c 2000/07/18 08:35:35 @@ -201,4 +201,4 @@ return 0; } -weak_alias (__memrchr, BP_SYM (memrchr)) +weak_alias (__memchr, BP_SYM (memchr)) -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.rhein-neckar.de From aj@suse.de Tue Jul 18 01:43:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Tue, 18 Jul 2000 01:43:00 -0000 Subject: undefined reference to `memchr' References: Message-ID: And one more - I've committed the patch already, Andreas 2000-07-18 Andreas Jaeger * sysdeps/alpha/memchr.S: Fix copy & error in weak_alias. Index: sysdeps/alpha/memchr.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/alpha/memchr.S,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- memchr.S 2000/07/17 22:36:15 1.8 +++ memchr.S 2000/07/18 08:40:57 1.9 @@ -169,4 +169,4 @@ END(__memchr) -weak_alias (__stpcpy, stpcpy) +weak_alias (__memchr, memchr) -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.rhein-neckar.de From aj@suse.de Tue Jul 18 06:02:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Tue, 18 Jul 2000 06:02:00 -0000 Subject: testandset on powerpc Message-ID: On PPC I get now when building nscd: /usr/src/packages/BUILD/glibc-2.2/cc/linuxthreads/libpthread.so: undefined reference to `testandset' collect2: ld returned 1 exit status $ nm linuxthreads/libpthread.so |grep testandset U testandset Is this a problem of too old tools/gcc? Or should the appended patch (at least partially) be reverted? 1998-08-22 Geoff Keating * sysdeps/powerpc/pt-machine.h: Remove testandset, it's not used and wastes space; correct types. -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.rhein-neckar.de From aj@suse.de Tue Jul 18 07:00:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Tue, 18 Jul 2000 07:00:00 -0000 Subject: One warning less - memchr Message-ID: Hi Greg, could you please check your builds that you don't introduce new warnings into the code? I've fixed the follwoing one now: ../sysdeps/generic/memchr.c:61: warning: function declaration isn't a prototype The patch has been committed to CVS. Andreas 2000-07-18 Andreas Jaeger * include/string.h: Add prototype for __memchr. ============================================================ Index: include/string.h --- include/string.h 2000/06/23 02:04:57 1.11 +++ include/string.h 2000/07/18 13:59:24 @@ -31,6 +31,9 @@ extern void *__memrchr (__const void *__s, int __c, size_t __n) __attribute_pure__; +extern void *__memchr (__const void *__s, int __c, size_t __n) + __attribute_pure__; + /* Now the real definitions. We do this here since some of the functions above are defined as macros in the headers. */ #include -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.rhein-neckar.de From aj@suse.de Tue Jul 18 07:15:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Tue, 18 Jul 2000 07:15:00 -0000 Subject: Another warning fix (for alpha) Message-ID: FYI: I've committed the appended patch. Andreas 2000-07-18 Andreas Jaeger * sysdeps/alpha/dl-machine.h (elf_machine_rela): Pass 0 instead of NULL to elf_machine_fixup_plt t argument to silence GCC. ============================================================ Index: sysdeps/alpha/dl-machine.h --- sysdeps/alpha/dl-machine.h 2000/07/01 05:08:03 1.43 +++ sysdeps/alpha/dl-machine.h 2000/07/18 14:14:21 @@ -497,7 +497,7 @@ if (r_type == R_ALPHA_GLOB_DAT) *reloc_addr = sym_value; else if (r_type == R_ALPHA_JMP_SLOT) - elf_machine_fixup_plt (map, NULL, reloc, reloc_addr, sym_value); + elf_machine_fixup_plt (map, 0, reloc, reloc_addr, sym_value); else if (r_type == R_ALPHA_REFQUAD) { void *reloc_addr_1 = reloc_addr; -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.rhein-neckar.de From kettenis@wins.uva.nl Tue Jul 18 08:41:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 18 Jul 2000 08:41:00 -0000 Subject: The DT_AUXILIARY patch References: <20000714182733.A29800@valinux.com> <20000714183128.A15013@lucon.org> <200007151320.e6FDKNY01271@delius.kettenis.local> <20000715100341.A16991@lucon.org> <200007151748.e6FHmHn10118@delius.kettenis.local> <20000715110726.A17183@lucon.org> Message-ID: <200007181541.e6IFf5N15258@delius.kettenis.local> Date: Sat, 15 Jul 2000 11:07:26 -0700 From: "H . J . Lu" On Sat, Jul 15, 2000 at 07:48:17PM +0200, Mark Kettenis wrote: > Date: Sat, 15 Jul 2000 10:03:41 -0700 > From: "H . J . Lu" > > On Sat, Jul 15, 2000 at 03:20:23PM +0200, Mark Kettenis wrote: > > Date: Fri, 14 Jul 2000 18:31:28 -0700 > > From: "H . J . Lu" > > > > BTW, we just need to make sure everything exported from the shared > > libgcc is also exported from libc.so. I think we will be safe then. > > > > That would be an incredibly stupid thing to do, since it means that > > you'd have to recompile glibc whenever things are added to libgcc.so. > > > > That is true. The isse is we need to find a way to make the references > to those exported symbols in libgcc.so dynamic. That is what libgcc.so > is used for. How about we teach ld to check DT_AUXILIARY? It will > be treated as DT_NEEDED for that purpose. ld won't wont propagate > DT_AUXILIARY to anything else. > > Argh! No! The current behaviour of ld to walk the DT_NEEDED list > when resolving symbols from shared libraries has its problems and is > incompatible with at least the Solaris linker. See > < http://sources.redhat.com/ml/binutils/1999-11/msg00037.html > for a I didn't find the original message. Is the original problem solved? I ran into a similar problem with OpenGL. One OpenGL implmenentation is multi-threaded. But it has to work with single thread applications. That means the OpenGL implmenentation has to make sure libpthread.so is always available even if it is used with a single thread application. I had to fix a bug in glibc to make things to work for them. I can ask them to see how they solved the problem. Here is link to the message with details about the origional problem: http://x40.deja.com/getdoc.xp?AN=545891503&CONTEXT=958448712.1788280849&hitnum=29 The "bug" isn't fixed. It's one of those "BUG IN DYNAMIC LINKER" cases where there's a corrupt/inconsistent binary. The dynamic linker is complaining about the fact that there is a version dependency for a library that's not in the applications DT_NEEDED list, and it has every right to do so. The right fix is to stop the static linker from walking the DT_NEEDED list (at least when recording versioning information, but in principle altogether). The old behaviour should probably still be available, when activated by a special switch. > discussion. Adding this for DT_AUXILIARY makes even less sense. If > the library in DT_AXUILIARY is absent everything should still work. > Our proposed use of DT_AUXILIARY is more or less abusing the concept. > It seems to work, but isn't really appropriate. Let's not bias our > tools too much to this particular use. As I said, ld will check DT_AUXILIARY for setting a symbol dynamic. That means you don't need to use "gcc -rdynamic". I will make sure it won't have any other bad side effects. Can't you see that this is even worse than the DT_NEEDED case illustrated above. An object for which we have a DT_AUXILIARY entry is allowed to be completely absent. That's why making libgcc.so a DT_AUXILIARY of libc.so is such a nasty hack. If some functionality is added to libgcc.so (for example support for a new DWARF symbol), it's not guaranteed that programs compiled with a new version of GCC will still run if the appropriate libgcc.so isn't present. > > > there too. Of course this can be postponed until you actually add > > new stuff to libgcc.so. > > I don't like libgcc.so since it will introduce explicit dependency > on libgcc.so and with DT_AUXILIARY, the only thing we need is to > make the references to to those exported symbols in libgcc.so dynamic. > Without libgcc.so, the resulting binaries will run ok with the slightly > older libc.so which has no DT_AUXILIARY as long as the ABI of libgcc > is not changed too much. > > Nasty, isn't it? That's why I said you could postpone explicitly > linking against libgcc.so until the ABI of libgcc actualy changes. > However, as soon as it does, you'll have no other choice. That is what I want to avoid. That can only been done in a limited number of cases. > In principle, there is no need for the shared libgcc.so at all as long > as you don't use exception handling. So perhaps it is possible to > tweak things (using linker tricks and the GCC specs file) to avoid the > explicit dependency on libgcc.so for plain C programs. That won't work since there is no way to tell if any C++ codes exist or not. I can even implement glibc in C++ as long as I support the glibc ABI. It will work fine. Code compiled without -fexceptions doesn't have any frame info to register, and won't call any exception handling functions. So it doesn't need any of the functionality provided by libgcc.so. If you have a certain shared library, say libfoo.so, that's currently compiled without -fexceptions and reimplement libfoo.so in C++, you'll have to link the library against libgcc.so[1]. But any existing programs that were linked with libfoo.so, will continue to work as before. [1] Of course the compiler driver should do this automagically. Mark From aj@suse.de Tue Jul 18 08:42:00 2000 From: aj@suse.de (Andreas Jaeger) Date: Tue, 18 Jul 2000 08:42:00 -0000 Subject: testandset on powerpc References: <200007181528.IAA12286@localhost.cygnus.com> Message-ID: >>>>> Geoff Keating writes: >> Cc: geoffk@cygnus.com >> From: Andreas Jaeger >> Date: 18 Jul 2000 15:02:32 +0200 >> User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Bryce Canyon) >> >> >> On PPC I get now when building nscd: >> /usr/src/packages/BUILD/glibc-2.2/cc/linuxthreads/libpthread.so: undefined reference to `testandset' >> collect2: ld returned 1 exit status >> >> $ nm linuxthreads/libpthread.so |grep testandset >> U testandset >> >> Is this a problem of too old tools/gcc? Or should the appended patch >> (at least partially) be reverted? >> >> 1998-08-22 Geoff Keating >> >> * sysdeps/powerpc/pt-machine.h: Remove testandset, it's not used >> and wastes space; correct types. Geoff> It'd be better if the generic code could be written to simply use Geoff> compare_and_swap if it is available. That would make porting easier. Why? All platforms - except ppc - have testandset. IMHO porting would be easier if ppc had testandset ;-). testandset is only used in spinlock.c. Should we document somewhere that and why testandset is deprecated? Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.rhein-neckar.de From kettenis@wins.uva.nl Tue Jul 18 09:20:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 18 Jul 2000 09:20:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <20000711134337.A16026@valinux.com> <20000711150216.A16199@valinux.com> <200007141425.e6EEP5R02346@delius.kettenis.local> <200007141944.MAA01180@localhost.cygnus.com> <20000717091320.B15499@valinux.com> Message-ID: <200007181620.e6IGKcr15299@delius.kettenis.local> Date: Mon, 17 Jul 2000 09:13:20 -0700 From: "H . J . Lu" Cc: Geoff Keating , kettenis@wins.uva.nl, drepper@cygnus.com, law@cygnus.com, rth@twiddle.net, libc-hacker@sourceware.cygnus.com, gcc@gcc.gnu.org Content-Disposition: inline User-Agent: Mutt/1.2.2i Content-Type: text/plain; charset=us-ascii On Mon, Jul 17, 2000 at 05:59:22AM -0300, Alexandre Oliva wrote: > On Jul 14, 2000, Geoff Keating wrote: > > > [aoliva said:] > > >> Despite the minor problem of how to bootstrap this situation. > > > You can have circular dependencies involving libc. > > Yup. I was talking about how to *create* the libraries in such a way > that each one uses the appropriate SONAME to refer to the other. As I > said, no big deal, it just has to be done carefully. > I am doing some experiments on the shared libgcc. I have added -Wl,--auxiliary,libgcc.so.3 when building my libc.so. I created a shell script, updatelibgcc. updatelibgcc takes CC and slibdir from environment to build/install libgcc.so.3. It seems to work so far. One interesting thing I noticed that libgcc.so might not be needed at all under Linux. I don't like the explicit dependency on libgcc.so. Can someone tell me if there is a case --auxiliary libgcc.so.3 is not enough for Linux? I may have missed something. Let me refresh your mind: 1. We have __deregister_frame_info, __register_frame_info, __frame_state_for, etc. in libc.so. 2. A single copy of these functions must be used in every program. 3. It might be necessary to change the implementation (while maintaining backwards compatibility) of these functions to support new versions of GCC. This implies that the single copy mentioned above must be the most recent copy. 4. We don't want to force everybody to recompile or even upgrade libc whenever they install a new version of GCC. The only reliable solution that has been found thus far is putting these functions in a shared library that can be upgraded (in principle when installing a new version of GCC) whenever needed. Now if point 3 above includes adding any new interfaces, having that shared library as a DT_AUXILIARY of libc.so isn't enough. Any objects that make use of that new functionality (presumably because they have been compiled with the new GCC) will have to be explicitly linked with that shared library. The EH frame info issue isn't the only problem with the current libgcc.a that might be solved by introducing a shared libgcc. Right now symbols from libgcc.a that are used in code in a shared library (say libfoo.so) are usually reexported from that shared library. This means that binaries linked against libfoo.so that also need those symbols, contain undefined references to those symbols. Now if you change the implementation of libfoo.so such that it doesn't need those symbols from libgcc.a anymore and install this new version (that's otherwise supposed to be still binary compatible) your program won't run anymore. The solution proposed by the GCC folks is simply to put everything in libgcc.a into libgcc.so and link every program or shared library with libgcc.so. This indeed guarentees that you never see this problem, and is likely to work on most platforms that support shared libraries. Unfortunately this introduces an explicit dependency for every program on yet another shared library. There have been several people who said they didn't like that, myself included. Having to distribute a shared library with all binaries is a PITA and might lead to people statically linking their programs to avoid this. There also may be of performance penalty with using the libgcc functions from a shared library I think that with on Linux and the Hurd, with the current GNU tools we can do a little better. The reexportation problem can be controlled using STV_HIDDEN/STV_PROTECTED. Mark From greg@mcgary.org Tue Jul 18 09:34:00 2000 From: greg@mcgary.org (Greg McGary) Date: Tue, 18 Jul 2000 09:34:00 -0000 Subject: PATCH: malloc.c cleanups References: <200007180717.AAA28227@kayak.mcgary.org> <20000718082325.13174.qmail@md.dent.med.uni-muenchen.de> Message-ID: Wolfram Gloger writes: > They all look just fine to me, except for this: > > > -#define next_bin(b) ((mbinptr)((char*)(b) + 2 * sizeof(mbinptr))) > > -#define prev_bin(b) ((mbinptr)((char*)(b) - 2 * sizeof(mbinptr))) > > +#define next_bin(b) ((mbinptr)((char*)(b) + 2 * sizeof(((arena*)0)->av[0]))) > > +#define prev_bin(b) ((mbinptr)((char*)(b) - 2 * sizeof(((arena*)0)->av[0]))) > > which I don't really consider an improvement. > > Do changes like these really make a difference for BP, i.e. can more > errors be detected? If yes, that's pretty cool. It's a maintenance aid more than anything else, since it guarantees that next_bin & prev_bin will always be correct with respect to the size of the array elements of av[]. I might want the av[] to be an array of unbounded mbinptr, or I might want them to be bounded (I prefer bounded, but right now I have some difficulties doing that, so I've fallen back to unbounded). Without this change, if I qaulify the pointer elements of av[], I must also qualify the type arg of sizeof. Greg From greg@mcgary.org Tue Jul 18 10:23:00 2000 From: greg@mcgary.org (Greg McGary) Date: Tue, 18 Jul 2000 10:23:00 -0000 Subject: undefined reference to `memchr' References: Message-ID: Andreas Jaeger writes: > END(__memchr) > > -weak_alias (__stpcpy, stpcpy) > +weak_alias (__memchr, memchr) *blush* That hurts. From greg@mcgary.org Tue Jul 18 10:26:00 2000 From: greg@mcgary.org (Greg McGary) Date: Tue, 18 Jul 2000 10:26:00 -0000 Subject: undefined reference to `memchr' References: Message-ID: Andreas Jaeger writes: > And one more - I've committed the patch already, > Andreas > > 2000-07-18 Andreas Jaeger > > * sysdeps/alpha/memchr.S: Fix copy & error in weak_alias. > > Index: sysdeps/alpha/memchr.S > =================================================================== > RCS file: /cvs/glibc/libc/sysdeps/alpha/memchr.S,v > retrieving revision 1.8 > retrieving revision 1.9 > diff -u -r1.8 -r1.9 > --- memchr.S 2000/07/17 22:36:15 1.8 > +++ memchr.S 2000/07/18 08:40:57 1.9 > @@ -169,4 +169,4 @@ > > END(__memchr) > > -weak_alias (__stpcpy, stpcpy) > +weak_alias (__memchr, memchr) And I was feeling so righteous after finding & fixing this in sysdeps/m68k/memchr.S... -END(strchr) +END(__memchr) -weak_alias (strchr, index) +weak_alias (__memchr, memchr) From greg@mcgary.org Tue Jul 18 11:24:00 2000 From: greg@mcgary.org (Greg McGary) Date: Tue, 18 Jul 2000 11:24:00 -0000 Subject: PATCH: more buffer-fiddling for regex.c Message-ID: <200007181823.LAA30438@kayak.mcgary.org> For i686: No build regressions. No binary differences for non-BP. OK? 2000-07-18 Greg McGary * posix/regex.c (EXTEND_BUFFER_HIGH_BOUND): New macro. (EXTEND_BUFFER): Use it. Index: posix/regex.c =================================================================== RCS file: /cvs/glibc/libc/posix/regex.c,v retrieving revision 1.75 diff -u -p -r1.75 regex.c --- regex.c 2000/07/07 07:53:40 1.75 +++ regex.c 2000/07/18 18:20:02 @@ -1750,8 +1750,21 @@ static reg_errcode_t compile_range _RE_A #if __BOUNDED_POINTERS__ # define MOVE_BUFFER_POINTER(P) \ (__ptrlow (P) += incr, __ptrhigh (P) += incr, __ptrvalue (P) += incr) +# define EXTEND_BUFFER_HIGH_BOUND \ + do { \ + int incr = bufp->allocated >> 1; \ + __ptrhigh b += incr; \ + __ptrhigh begalt += incr; \ + if (fixup_alt_jump) \ + __ptrhigh fixup_alt_jump += incr; \ + if (laststart) \ + __ptrhigh laststart += incr; \ + if (pending_exact) \ + __ptrhigh pending_exact += incr; \ + } while (0) #else # define MOVE_BUFFER_POINTER(P) (P) += incr +# define EXTEND_BUFFER_HIGH_BOUND #endif #define EXTEND_BUFFER() \ do { \ @@ -1777,6 +1790,7 @@ static reg_errcode_t compile_range _RE_A if (pending_exact) \ MOVE_BUFFER_POINTER (pending_exact); \ } \ + EXTEND_BUFFER_HIGH_BOUND; \ } while (0) From drepper@redhat.com Tue Jul 18 11:50:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 18 Jul 2000 11:50:00 -0000 Subject: PATCH: more buffer-fiddling for regex.c References: <200007181823.LAA30438@kayak.mcgary.org> Message-ID: OK. -- ---------------. ,-. 1325 Chesapeake Terrace Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA Red Hat `--' drepper at redhat.com `------------------------ From greg@mcgary.org Tue Jul 18 12:35:00 2000 From: greg@mcgary.org (Greg McGary) Date: Tue, 18 Jul 2000 12:35:00 -0000 Subject: One warning less - memchr References: Message-ID: Andreas Jaeger writes: > could you please check your builds that you don't introduce new > warnings into the code? generic/memchr.c isn't compiled for ix86, so I didn't see it. I could do one of two things: (1) do cross-builds of more targets, say PowerPC, MIPS and SPARC in order to catch non-ix86 warnings, or (2) rely on others to catch the non-ix86 warnings. Do you consider cases like this to be enough of a burden on you that I should do #1? > I've fixed the follwoing one now: > ../sysdeps/generic/memchr.c:61: warning: function declaration isn't a prototype > > The patch has been committed to CVS. > > Andreas > > 2000-07-18 Andreas Jaeger > > * include/string.h: Add prototype for __memchr. I would have fixed it by making memchr's declarator be a prototype in memchr.c. I had purposely left this undeclared. Declaring it defeats my purpose in making the alias to begin with. I want to be able to use the unbounded __memchr in bounded code, which might also use the bounded memchr. By declaring a prototype in include/string.h, gcc will think that __memchr has bounded pointers as well, so my uses in CHECK_STRING won't behave as desired. OTOH, it seems overly sneaky to require that __memchr remain undeclared in order for CHECK_STRING to function properly. I have a couple other ideas on how to work around this: 1) In bp-checks.h, use #define to shunt the decl of __memchr aside, so that it remains unbounded. This also seems too sneaky, and will break any code that explicitly uses __memchr in a normally. 2) Create another BP-specific alias. The one I had originally was __ubp_memchr. I think this is the least troublesome way to go. Greg From hjl@lucon.org Tue Jul 18 14:32:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Tue, 18 Jul 2000 14:32:00 -0000 Subject: A patch for DT_NEEDED [Re: The DT_AUXILIARY patch] References: <20000714182733.A29800@valinux.com> <20000714183128.A15013@lucon.org> <200007151320.e6FDKNY01271@delius.kettenis.local> <20000715100341.A16991@lucon.org> <200007151748.e6FHmHn10118@delius.kettenis.local> <20000715110726.A17183@lucon.org> <200007181541.e6IFf5N15258@delius.kettenis.local> Message-ID: <20000718143224.A31733@lucon.org> On Tue, Jul 18, 2000 at 05:41:05PM +0200, Mark Kettenis wrote: > > That is true. The isse is we need to find a way to make the references > > to those exported symbols in libgcc.so dynamic. That is what libgcc.so > > is used for. How about we teach ld to check DT_AUXILIARY? It will > > be treated as DT_NEEDED for that purpose. ld won't wont propagate > > DT_AUXILIARY to anything else. > > > > Argh! No! The current behaviour of ld to walk the DT_NEEDED list > > when resolving symbols from shared libraries has its problems and is > > incompatible with at least the Solaris linker. See > > < http://sources.redhat.com/ml/binutils/1999-11/msg00037.html > for a > > I didn't find the original message. Is the original problem solved? > I ran into a similar problem with OpenGL. One OpenGL implmenentation > is multi-threaded. But it has to work with single thread applications. > That means the OpenGL implmenentation has to make sure libpthread.so > is always available even if it is used with a single thread application. > I had to fix a bug in glibc to make things to work for them. I can ask > them to see how they solved the problem. > > Here is link to the message with details about the origional problem: > > http://x40.deja.com/getdoc.xp?AN=545891503&CONTEXT=958448712.1788280849&hitnum=29 > > The "bug" isn't fixed. It's one of those "BUG IN DYNAMIC LINKER" > cases where there's a corrupt/inconsistent binary. The dynamic linker > is complaining about the fact that there is a version dependency for a > library that's not in the applications DT_NEEDED list, and it has > every right to do so. > > The right fix is to stop the static linker from walking the DT_NEEDED > list (at least when recording versioning information, but in principle > altogether). The old behaviour should probably still be available, > when activated by a special switch. > I like the new bebavior. It can even catch some symbol version mismatch errors which otherwise can only be caught at the run-time. It is also convenient to do # gcc .... -lGL and I don't have to worry about how my OpenGL is implemented since my OpenGL code do not make any calls to X libraries directly. Anyway, here is a patch for the DT_NEEDED handling. At present, we don't add files from DT_NEEDED to the DT_NEEDED list in the resulting binary. That causes the problem if the resulting binary references the symbols in files from DT_NEEDED and they are not passed to the linker at the comand line. This patch tries to add those files to the DT_NEEDED list if they are used by the regular files during the link. Ian, what do you think? H.J. ---- 2000-07-18 H.J. Lu * bfd-in.h (bfd_elf_set_dt_needed_soname): New. * bfd-in2.h: Rebuild. * elf-bfd.h (elf_obj_tdata): Add dt_soname. (elf_dt_soname): New. * elf.c (bfd_elf_set_dt_needed_soname): New. * elflink.h (elf_link_add_object_symbols): Add the DT_NEEDED entry if the shared object loaded by DT_NEEDED is used to resolve the reference in a regular object. Index: bfd/bfd-in.h =================================================================== RCS file: /work/cvs/gnu/binutils/bfd/bfd-in.h,v retrieving revision 1.11 diff -u -p -r1.11 bfd-in.h --- bfd/bfd-in.h 2000/07/13 16:00:33 1.11 +++ bfd/bfd-in.h 2000/07/18 19:32:33 @@ -627,6 +627,7 @@ extern boolean bfd_elf64_size_dynamic_se const char * const *, struct bfd_link_info *, struct sec **, struct bfd_elf_version_tree *)); extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *)); +extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *)); extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *)); /* Return an upper bound on the number of bytes required to store a Index: bfd/bfd-in2.h =================================================================== RCS file: /work/cvs/gnu/binutils/bfd/bfd-in2.h,v retrieving revision 1.35 diff -u -p -r1.35 bfd-in2.h --- bfd/bfd-in2.h 2000/07/13 16:00:33 1.35 +++ bfd/bfd-in2.h 2000/07/18 19:34:06 @@ -627,6 +627,7 @@ extern boolean bfd_elf64_size_dynamic_se const char * const *, struct bfd_link_info *, struct sec **, struct bfd_elf_version_tree *)); extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *)); +extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *)); extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *)); /* Return an upper bound on the number of bytes required to store a Index: bfd/elf-bfd.h =================================================================== RCS file: /work/cvs/gnu/binutils/bfd/elf-bfd.h,v retrieving revision 1.1.1.15 diff -u -p -r1.1.1.15 elf-bfd.h --- bfd/elf-bfd.h 2000/07/09 23:37:28 1.1.1.15 +++ bfd/elf-bfd.h 2000/07/18 21:13:49 @@ -838,6 +838,14 @@ struct elf_obj_tdata one. */ const char *dt_name; + /* When a reference in a regular object is resolved by a shared + object is loaded into via the DT_NEEDED entries by the linker + ELF emulation code, we need to add the shared object to the + DT_NEEDED list of the resulting binary to indicate the dependency + as if the -l option is passed to the linker. This field holds the + name of the loaded shared object. */ + const char *dt_soname; + /* Irix 5 often screws up the symbol table, sorting local symbols after global symbols. This flag is set if the symbol table in this BFD appears to be screwed up. If it is, we ignore the @@ -915,6 +923,7 @@ struct elf_obj_tdata #define elf_local_got_offsets(bfd) (elf_tdata(bfd) -> local_got.offsets) #define elf_local_ptr_offsets(bfd) (elf_tdata(bfd) -> linker_section_pointers) #define elf_dt_name(bfd) (elf_tdata(bfd) -> dt_name) +#define elf_dt_soname(bfd) (elf_tdata(bfd) -> dt_soname) #define elf_bad_symtab(bfd) (elf_tdata(bfd) -> bad_symtab) #define elf_flags_init(bfd) (elf_tdata(bfd) -> flags_init) #define elf_linker_section(bfd,n) (elf_tdata(bfd) -> linker_section[(int)n]) Index: bfd/elf.c =================================================================== RCS file: /work/cvs/gnu/binutils/bfd/elf.c,v retrieving revision 1.23 diff -u -p -r1.23 elf.c --- bfd/elf.c 2000/07/13 16:00:33 1.23 +++ bfd/elf.c 2000/07/18 20:26:45 @@ -1023,6 +1023,16 @@ bfd_elf_set_dt_needed_name (abfd, name) elf_dt_name (abfd) = name; } +void +bfd_elf_set_dt_needed_soname (abfd, name) + bfd *abfd; + const char *name; +{ + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour + && bfd_get_format (abfd) == bfd_object) + elf_dt_soname (abfd) = name; +} + /* Get the list of DT_NEEDED entries for a link. This is a hook for the linker ELF emulation code. */ Index: bfd/elflink.h =================================================================== RCS file: /work/cvs/gnu/binutils/bfd/elflink.h,v retrieving revision 1.33 diff -u -p -r1.33 elflink.h --- bfd/elflink.h 2000/06/20 17:47:42 1.33 +++ bfd/elflink.h 2000/07/18 20:56:34 @@ -890,6 +890,7 @@ elf_link_add_object_symbols (abfd, info) Elf_External_Sym *esym; Elf_External_Sym *esymend; struct elf_backend_data *bed; + boolean dt_needed; bed = get_elf_backend_data (abfd); add_symbol_hook = bed->elf_add_symbol_hook; @@ -1049,6 +1050,8 @@ elf_link_add_object_symbols (abfd, info) goto error_return; elf_sym_hashes (abfd) = sym_hash; + dt_needed = false; + if (! dynamic) { /* If we are creating a shared library, create all the dynamic @@ -1085,7 +1088,12 @@ elf_link_add_object_symbols (abfd, info) { name = elf_dt_name (abfd); if (*name == '\0') - add_needed = false; + { + if (elf_dt_soname (abfd) != NULL) + dt_needed = true; + + add_needed = false; + } } s = bfd_get_section_by_name (abfd, ".dynamic"); if (s != NULL) @@ -1863,6 +1871,52 @@ elf_link_add_object_symbols (abfd, info) (*bed->elf_backend_hide_symbol) (info, h); break; } + + if (dynamic && dt_needed && definition + && (h->elf_link_hash_flags + & ELF_LINK_HASH_REF_REGULAR) != 0) + { + bfd_size_type oldsize; + bfd_size_type strindex; + + /* The symbol from a DT_NEEDED object is referenced from + the regular object to create a dynamic executable. We + have to make sure there is a DT_NEEDED entry for it. */ + + oldsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr); + strindex = _bfd_stringtab_add (elf_hash_table (info)->dynstr, + elf_dt_soname (abfd), + true, false); + if (strindex == (bfd_size_type) -1) + goto error_return; + + if (oldsize + == _bfd_stringtab_size (elf_hash_table (info)->dynstr)) + { + asection *sdyn; + Elf_External_Dyn *dyncon, *dynconend; + + sdyn = bfd_get_section_by_name (elf_hash_table (info)->dynobj, + ".dynamic"); + BFD_ASSERT (sdyn != NULL); + + dyncon = (Elf_External_Dyn *) sdyn->contents; + dynconend = (Elf_External_Dyn *) (sdyn->contents + + sdyn->_raw_size); + for (; dyncon < dynconend; dyncon++) + { + Elf_Internal_Dyn dyn; + + elf_swap_dyn_in (elf_hash_table (info)->dynobj, + dyncon, &dyn); + BFD_ASSERT (dyn.d_tag != DT_NEEDED || + dyn.d_un.d_val != strindex); + } + } + + if (! elf_add_dynamic_entry (info, DT_NEEDED, strindex)) + goto error_return; + } } } 2000-07-18 H.J. Lu * emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Call bfd_elf_set_dt_needed_soname (). Index: ld/emultempl/elf32.em =================================================================== RCS file: /work/cvs/gnu/binutils/ld/emultempl/elf32.em,v retrieving revision 1.17 diff -u -p -r1.17 elf32.em --- ld/emultempl/elf32.em 2000/07/13 16:00:36 1.17 +++ ld/emultempl/elf32.em 2000/07/18 21:13:41 @@ -532,6 +532,18 @@ cat >>e${EMULATION_NAME}.c <filename, '/'); + if (name) + name++; + else + name = abfd->filename; + + /* Tell the ELF backend that the output file needs a DT_NEEDED + entry for this file if it is used to resolve the reference in + a regular object. */ + bfd_elf_set_dt_needed_soname (abfd, name); + /* Add this file into the symbol table. */ if (! bfd_link_add_symbols (abfd, &link_info)) einfo ("%F%B: could not read symbols: %E\n", abfd); From drepper@redhat.com Tue Jul 18 15:10:00 2000 From: drepper@redhat.com (Ulrich Drepper) Date: Tue, 18 Jul 2000 15:10:00 -0000 Subject: [Jan Rekorajski ] makedb and libnss_db in glibc 2.1.91 are broken Message-ID: Somebody might want to look at nss_db. It seems broken when used in statically linked applications. From hjl@lucon.org Tue Jul 18 15:15:00 2000 From: hjl@lucon.org (H . J . Lu) Date: Tue, 18 Jul 2000 15:15:00 -0000 Subject: My proposal for the libgcc runtime ABI (ia64 gcc/glibc is broken.) References: <20000711134337.A16026@valinux.com> <20000711150216.A16199@valinux.com> <200007141425.e6EEP5R02346@delius.kettenis.local> <200007141944.MAA01180@localhost.cygnus.com> <20000717091320.B15499@valinux.com> <200007181620.e6IGKcr15299@delius.kettenis.local> Message-ID: <20000718151549.A31850@lucon.org> On Tue, Jul 18, 2000 at 06:20:38PM +0200, Mark Kettenis wrote: > > I am doing some experiments on the shared libgcc. I have added > -Wl,--auxiliary,libgcc.so.3 when building my libc.so. I created a > shell script, updatelibgcc. updatelibgcc takes CC and slibdir from > environment to build/install libgcc.so.3. It seems to work so far. > > One interesting thing I noticed that libgcc.so might not be needed > at all under Linux. I don't like the explicit dependency on libgcc.so. > Can someone tell me if there is a case --auxiliary libgcc.so.3 is not > enough for Linux? I may have missed something. > > Let me refresh your mind: > > 1. We have __deregister_frame_info, __register_frame_info, > __frame_state_for, etc. in libc.so. > > 2. A single copy of these functions must be used in every program. > > 3. It might be necessary to change the implementation (while > maintaining backwards compatibility) of these functions to support > new versions of GCC. This implies that the single copy mentioned > above must be the most recent copy. > > 4. We don't want to force everybody to recompile or even upgrade libc > whenever they install a new version of GCC. > > The only reliable solution that has been found thus far is putting > these functions in a shared library that can be upgraded (in principle > when installing a new version of GCC) whenever needed. Guess what, that shared library has been there for a long time. It is called libstdc++.so. Why do we need libgcc.so when libstdc++.so is there? I noticed the problem with the shared libstdc++ v3. But I found out it was caused by libtool: http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00707.html You may ask what if I don't use the shared libstdc++. It is fine since you are using static EH functions in libgcc as far as libgcc is concerned since those EH functions are pulled in from libgcc.a by the linker. Currently, glibc doesn't use exceptions. As long as the ABI of those frame functions are unchanged, glibc should be ok. Right now, only ia64 is broken due to the new fields in "struct object". My suggestions for glibc are: 1. Fix "struct object" in elf/soinit.c. A glibc ABI will be nice. 2. Fix libtool and shared libstdc++ v3 so that we can use it as the shared library for thos EH functions. We can take another look at the shared libgcc issue when the EH is used in glibc. We will make a decision then. I don't think we need it now. H.J. From kettenis@wins.uva.nl Tue Jul 18 16:25:00 2000 From: kettenis@wins.uva.nl (Mark Kettenis) Date: Tue, 18 Jul 2000 16:25:00 -0000 Subject: Update resolver code to BIND 8.2.3-T5B. Message-ID: <200007182325.e6INP0l14715@delius.kettenis.local> Here's the promised patch that updates the resolver to BIND 8.23-T5B. I've had this in my tree for a while now and didn't notice any problems. Most of the fixes are fairly trivial (some may even appear gratitious, but I tried to minimize the diffs with the official BIND sources. However there are some important changes lurking in here: * Make res_init() use the same static (global) resolver context (again) that the other "old" interfaces use. * Make res_close() check if RES_INIT has been set in _res.options before calling res_nclose(&_res). This removes the need to use an initializer for _res. * Reorganize res_send() code (fixes from BIND), fully reinstate the code that uses poll() instead of pselect() to avoid FD_SETSIZE limit (by me). * Make inet_pton() reject invalid IPv6 addresses (fix from BIND). * Make all dn_* and res_* symbols start with a double underscore (that's what BIND does), instead of having a few without the double underscore. Provide backwards compatibility with weak aliases. In a seperate message I'll send a README.bind file that explains the difference between the glibc resolver code and the official BIND resolver. Mark linuxthreads/ChangeLog: 2000-07-18 Mark Kettenis * manager.c (pthread_handle_create): Remove initialization of new_thread->p_res._sock. ChangeLog: 2000-07-18 Mark Kettenis Update resolver code to BIND 8.2.3-T5B. * resolv/Versions [GLIBC_2.2] (libc): Add __res_init and __res_nclose. [GLIBC_2.2] (libresolv): Add __dn_expand, __ns_samename, __res_mkquery, __res_nsend, __res_query, __res_querydomain and __res_search. * resolv/Banner: BIND-8.2.3-T5B. * resolv/base64.c: Update from BIND 8.2.3-T5B. * resolv/herror.c: Likewise. * resolv/inet_addr.c: Likewise. * resolv/inet_net_ntop.c: Likewise. * resolv/inet_net_pton.c: Likewise. * resolv/inet_neta.c: Likewise. * resolv/inet_ntop.c: Likewise. * resolv/nsap_addr.c: Likewise. * resolv/inet_pton.c: Likewise. Reject a few more more invalid IPv6 addresses (ISC bug #520). * resolv/ns_name.c: Avoid emitting RCS ID in object file. * resolv/ns_parse.c: Likewise. * resolv/ns_netint.c: Likewise. * resolv/ns_samedomain.c: Likewise. * resolv/ns_ttl.c: Likewise. * resolv/ns_print.c: Update from BIND 8.2.3-T5B. Avoid emitting RCS ID in object file. * resolv/res_debug.c: Update from BIND 8.2.3-T5B. * resolv/res_mkquery.c: Likewise. * resolv/res_mkquery.c: Likewise. * resolv/res_init.c: Likewise. (res_setoptions): Mark internal. * resolv/res_send.c: Likewise. [_LIBC]: Fully reinstate the code that avoids the FD_SETSIZE limit by using poll instead. * resolv/res_comp.c: Likewise. [SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_2)]: Make dn_expand a weak alias for __dn_expand. * resolv/res_data.c: Likewise. (res_close) [_LIBC]: Don't call res_nclose if RES_INIT isn't set in _res.options. Avoids a potential security risk by avoiding a close (0). [SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_2)]: Make res_mkquery, res_query, res_querydomain adn res_search weak aliases for __res_mkquery, __res_query, __res_querydomain and __res_search. * resolv/res_libc.c: (_res): Don't initialize. Fix res_close instead to avoid close(0). (res_init): Always use the static resolver context. [SHLIB_COMPAT (libc, GLIBC_2.0, GLIBC_2_2)]: Make res_init a weak alias for __res_init. * resolv/resolv.h: Update from BIND 8.2.3-T5B. Move definition of RES_SET_H_ERRNO and accompanying comment to... * include/resolv.h: ... here. * resolv/arpa/namser.h: Update from BIND 8.2.3-T5B. * resolv/arpa/nameser_compat.h: Likewise. Index: include/resolv.h =================================================================== RCS file: /cvs/glibc/libc/include/resolv.h,v retrieving revision 1.3 diff -u -p -r1.3 resolv.h --- include/resolv.h 2000/01/03 16:57:01 1.3 +++ include/resolv.h 2000/07/18 22:19:35 @@ -1 +1,12 @@ +#ifndef _RESOLV_H_ + +#define RES_SET_H_ERRNO(r,x) \ + do \ + { \ + (r)->res_h_errno = x; \ + __set_h_errno(x); \ + } \ + while (0) + #include +#endif Index: linuxthreads/manager.c =================================================================== RCS file: /cvs/glibc/libc/linuxthreads/manager.c,v retrieving revision 1.53 diff -u -p -r1.53 manager.c --- linuxthreads/manager.c 2000/07/15 19:01:25 1.53 +++ linuxthreads/manager.c 2000/07/18 22:19:36 @@ -462,7 +462,6 @@ static int pthread_handle_create(pthread new_thread->p_canceltype = PTHREAD_CANCEL_DEFERRED; new_thread->p_errnop = &new_thread->p_errno; new_thread->p_h_errnop = &new_thread->p_h_errno; - new_thread->p_res._sock = -1; new_thread->p_resp = &new_thread->p_res; new_thread->p_guardaddr = guardaddr; new_thread->p_guardsize = guardsize; Index: resolv/Banner =================================================================== RCS file: /cvs/glibc/libc/resolv/Banner,v retrieving revision 1.7 diff -u -p -r1.7 Banner --- resolv/Banner 1999/12/04 18:00:35 1.7 +++ resolv/Banner 2000/07/18 22:19:36 @@ -1 +1 @@ -BIND-8.2.2-5 +BIND-8.2.3-T5B Index: resolv/Versions =================================================================== RCS file: /cvs/glibc/libc/resolv/Versions,v retrieving revision 1.4 diff -u -p -r1.4 Versions --- resolv/Versions 2000/07/12 20:38:54 1.4 +++ resolv/Versions 2000/07/18 22:19:36 @@ -20,7 +20,7 @@ libc { } GLIBC_2.2 { # r* - __res_state; __res_ninit; + __res_state; __res_init; __res_nclose; __res_ninit; } } @@ -51,8 +51,11 @@ libresolv { __ns_name_unpack; __ns_name_ntop; } GLIBC_2.2 { - __res_nmkquery; __res_nquery; __res_nquerydomain; __res_nsearch; - __ns_get16; __res_hostalias; + __dn_expand; + __ns_get16; __ns_samename; + __res_hostalias; __res_mkquery; __res_nmkquery; __res_nquery; + __res_nquerydomain; __res_nsearch; __res_nsend; __res_query; + __res_querydomain; __res_search; } libnss_dns { Index: resolv/base64.c =================================================================== RCS file: /cvs/glibc/libc/resolv/base64.c,v retrieving revision 1.5 diff -u -p -r1.5 base64.c --- resolv/base64.c 1997/05/29 11:54:03 1.5 +++ resolv/base64.c 2000/07/18 22:19:36 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996 by Internet Software Consortium. + * Copyright (c) 1996-1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -40,9 +40,14 @@ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. */ +#if !defined(LINT) && !defined(CODECENTER) +static const char rcsid[] = "$BINDId: base64.c,v 8.7 1999/10/13 16:39:33 vixie Exp $"; +#endif /* not lint */ + #include #include #include + #include #include #include @@ -50,14 +55,9 @@ #include #include #include +#include +#include -#if defined(BSD) && (BSD >= 199103) && defined(AF_INET6) -# include -# include -#else -# include "../conf/portability.h" -#endif - #define Assert(Cond) if (!(Cond)) abort() static const char Base64[] = @@ -112,9 +112,9 @@ static const char Pad64 = '='; end of the data is performed using the '=' character. Since all base64 input is an integral number of octets, only the - ------------------------------------------------- + ------------------------------------------------- following cases can arise: - + (1) the final quantum of encoding input is an integral multiple of 24 bits; here, the final unit of encoded output will be an integral multiple of 4 characters @@ -128,12 +128,7 @@ static const char Pad64 = '='; */ int -b64_ntop(src, srclength, target, targsize) - u_char const *src; - size_t srclength; - char *target; - size_t targsize; -{ +b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) { size_t datalength = 0; u_char input[3]; u_char output[4]; @@ -161,14 +156,14 @@ b64_ntop(src, srclength, target, targsiz target[datalength++] = Base64[output[2]]; target[datalength++] = Base64[output[3]]; } - + /* Now we worry about padding. */ if (0 != srclength) { /* Get what's left. */ input[0] = input[1] = input[2] = '\0'; for (i = 0; i < srclength; i++) input[i] = *src++; - + output[0] = input[0] >> 2; output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); @@ -204,8 +199,7 @@ b64_pton(src, target, targsize) u_char *target; size_t targsize; { - size_t tarindex; - int state, ch; + int tarindex, state, ch; char *pos; state = 0; @@ -225,7 +219,7 @@ b64_pton(src, target, targsize) switch (state) { case 0: if (target) { - if (tarindex >= targsize) + if ((size_t)tarindex >= targsize) return (-1); target[tarindex] = (pos - Base64) << 2; } @@ -233,7 +227,7 @@ b64_pton(src, target, targsize) break; case 1: if (target) { - if (tarindex + 1 >= targsize) + if ((size_t)tarindex + 1 >= targsize) return (-1); target[tarindex] |= (pos - Base64) >> 4; target[tarindex+1] = ((pos - Base64) & 0x0f) @@ -244,7 +238,7 @@ b64_pton(src, target, targsize) break; case 2: if (target) { - if (tarindex + 1 >= targsize) + if ((size_t)tarindex + 1 >= targsize) return (-1); target[tarindex] |= (pos - Base64) >> 2; target[tarindex+1] = ((pos - Base64) & 0x03) @@ -255,7 +249,7 @@ b64_pton(src, target, targsize) break; case 3: if (target) { - if (tarindex >= targsize) + if ((size_t)tarindex >= targsize) return (-1); target[tarindex] |= (pos - Base64); } @@ -281,12 +275,7 @@ b64_pton(src, target, targsize) case 2: /* Valid, means one byte of info */ /* Skip any number of spaces. */ -#ifdef _LIBC - /* To avoid warnings. */ - for ( ; ch != '\0'; ch = *src++) -#else - for (NULL; ch != '\0'; ch = *src++) -#endif + for ((void)NULL; ch != '\0'; ch = *src++) if (!isspace(ch)) break; /* Make sure there is another trailing = sign. */ @@ -301,12 +290,7 @@ b64_pton(src, target, targsize) * We know this char is an =. Is there anything but * whitespace after it? */ -#ifdef _LIBC - /* To avoid warnings. */ - for ( ; ch != '\0'; ch = *src++) -#else - for (NULL; ch != '\0'; ch = *src++) -#endif + for ((void)NULL; ch != '\0'; ch = *src++) if (!isspace(ch)) return (-1); Index: resolv/herror.c =================================================================== RCS file: /cvs/glibc/libc/resolv/herror.c,v retrieving revision 1.11 diff -u -p -r1.11 herror.c --- resolv/herror.c 1999/06/19 09:47:28 1.11 +++ resolv/herror.c 2000/07/18 22:19:36 @@ -1,9 +1,7 @@ /* - * ++Copyright++ 1987, 1993 - * - * Copyright (c) 1987, 1993 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -15,7 +13,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -27,44 +25,43 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - - * Portions Copyright (c) 1993 by Digital Equipment Corporation. + */ + +/* + * Portions Copyright (c) 1996-1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. + * copyright notice and this permission notice appear in all copies. * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. - * - - * --Copyright-- */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: herror.c,v 1.11 1999/06/19 09:47:28 drepper Exp $"; +static const char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93"; +static const char rcsid[] = "$BINDId: herror.c,v 8.11 1999/10/13 16:39:39 vixie Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include + +#include +#include + #include +#include +#include +#include + #include -#if defined(BSD) && (BSD >= 199103) -# include -# include -#else -# include "../conf/portability.h" -#endif const char *h_errlist[] = { N_("Resolver Error 0 (no error)"), @@ -75,23 +72,17 @@ const char *h_errlist[] = { }; int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] }; -#ifndef h_errno -extern int h_errno; -#endif - /* * herror -- * print the error indicated by the h_errno value. */ void -herror(s) - const char *s; -{ - struct iovec iov[4]; - register struct iovec *v = iov; +herror(const char *s) { + struct iovec iov[4], *v = iov; + extern int * __h_errno(); - if (s && *s) { - v->iov_base = (char *)s; + if (s != NULL && *s != '\0') { + v->iov_base = (/*noconst*/ char *)s; v->iov_len = strlen(s); v++; v->iov_base = ": "; @@ -106,10 +97,12 @@ herror(s) __writev(STDERR_FILENO, iov, (v - iov) + 1); } +/* + * hstrerror -- + * return the string associated with a given "host" errno value. + */ const char * -hstrerror(err) - int err; -{ +hstrerror(int err) { if (err < 0) return _("Resolver internal error"); else if (err < h_nerr) Index: resolv/inet_addr.c =================================================================== RCS file: /cvs/glibc/libc/resolv/inet_addr.c,v retrieving revision 1.16 diff -u -p -r1.16 inet_addr.c --- resolv/inet_addr.c 2000/04/02 03:07:12 1.16 +++ resolv/inet_addr.c 2000/07/18 22:19:36 @@ -1,9 +1,7 @@ /* - * ++Copyright++ 1983, 1990, 1993 - * - * Copyright (c) 1983, 1990, 1993 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -15,7 +13,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -27,16 +25,18 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - + */ + +/* * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -44,21 +44,39 @@ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +/* + * Portions Copyright (c) 1996-1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. - * - - * --Copyright-- */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; -static char rcsid[] = "$Id: inet_addr.c,v 1.16 2000/04/02 03:07:12 drepper Exp $"; +static const char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; +static const char rcsid[] = "$BINDId: inet_addr.c,v 8.11 1999/10/13 16:39:25 vixie Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include + #include #include + #include + #ifdef _LIBC # include # include @@ -66,18 +84,13 @@ static char rcsid[] = "$Id: inet_addr.c, # include # include #endif -#include "../conf/portability.h" -/* these are compatibility routines, not needed on recent BSD releases */ - /* * Ascii internet address interpretation routine. * The value returned is in network order. */ in_addr_t -inet_addr(cp) - register const char *cp; -{ +inet_addr(const char *cp) { struct in_addr val; if (__inet_aton(cp, &val)) @@ -85,7 +98,7 @@ inet_addr(cp) return (INADDR_NONE); } -/* +/* * Check whether "cp" is a valid ascii representation * of an Internet address and convert to a binary address. * Returns 1 if the address is valid, 0 if not. @@ -93,21 +106,18 @@ inet_addr(cp) * cannot distinguish between failure and a local broadcast address. */ in_addr_t -__inet_aton(cp, addr) - const char *cp; - struct in_addr *addr; -{ +__inet_aton(const char *cp, struct in_addr *addr) { static const in_addr_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff }; - register in_addr_t val; + in_addr_t val; #ifndef _LIBC - register int base; + int base; #endif - register char c; + char c; union iaddr { uint8_t bytes[4]; uint32_t word; } res; - register uint8_t *pp = res.bytes; + uint8_t *pp = res.bytes; int digit; #ifdef _LIBC @@ -140,23 +150,28 @@ __inet_aton(cp, addr) } c = *cp; #else - base = 10; + val = 0; base = 10; digit = 0; if (c == '0') { c = *++cp; if (c == 'x' || c == 'X') base = 16, c = *++cp; - else + else { base = 8; + digit = 1 ; + } } - val = 0; for (;;) { if (isascii(c) && isdigit(c)) { + if (base == 8 && (c == '8' || c == '9')) + return (0); val = (val * base) + (c - '0'); c = *++cp; + digit = 1; } else if (base == 16 && isascii(c) && isxdigit(c)) { val = (val << 4) | (c + 10 - (islower(c) ? 'a' : 'A')); c = *++cp; + digit = 1; } else break; } @@ -168,8 +183,7 @@ __inet_aton(cp, addr) * a.b.c (with c treated as 16 bits) * a.b (with b treated as 24 bits) */ - if (pp > res.bytes + 3 - || val > 0xff) + if (pp > res.bytes + 3 || val > 0xff) goto ret_0; *pp++ = val; c = *++cp; @@ -181,7 +195,6 @@ __inet_aton(cp, addr) */ if (c != '\0' && (!isascii(c) || !isspace(c))) goto ret_0; - /* * Did we get a valid digit? */ @@ -193,7 +206,7 @@ __inet_aton(cp, addr) if (val > max[pp - res.bytes]) goto ret_0; - if (addr) + if (addr != NULL) addr->s_addr = res.word | htonl (val); #ifdef _LIBC Index: resolv/inet_net_ntop.c =================================================================== RCS file: /cvs/glibc/libc/resolv/inet_net_ntop.c,v retrieving revision 1.3 diff -u -p -r1.3 inet_net_ntop.c --- resolv/inet_net_ntop.c 1999/10/02 06:08:06 1.3 +++ resolv/inet_net_ntop.c 2000/07/18 22:19:36 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996 by Internet Software Consortium. + * Copyright (c) 1996,1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.3 1999/10/02 06:08:06 drepper Exp $"; +static const char rcsid[] = "$BINDId: inet_net_ntop.c,v 1.6 1999/01/08 19:23:42 vixie Exp $"; #endif #include @@ -74,7 +74,7 @@ inet_net_ntop(af, src, bits, dst, size) * pointer to dst, or NULL if an error occurred (check errno). * note: * network byte order assumed. this means 192.5.5.240/28 has - * 0x11110000 in its fourth octet. + * 0b11110000 in its fourth octet. * author: * Paul Vixie (ISC), July 1996 */ @@ -98,7 +98,7 @@ inet_net_ntop_ipv4(src, bits, dst, size) if (size < sizeof "0") goto emsgsize; *dst++ = '0'; - --size; + size--; *dst = '\0'; } Index: resolv/inet_net_pton.c =================================================================== RCS file: /cvs/glibc/libc/resolv/inet_net_pton.c,v retrieving revision 1.8 diff -u -p -r1.8 inet_net_pton.c --- resolv/inet_net_pton.c 1999/10/02 20:40:03 1.8 +++ resolv/inet_net_pton.c 2000/07/18 22:19:36 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996 by Internet Software Consortium. + * Copyright (c) 1996,1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_net_pton.c,v 1.8 1999/10/02 20:40:03 drepper Exp $"; +static const char rcsid[] = "$BINDId: inet_net_pton.c,v 1.11 1999/01/08 19:23:44 vixie Exp $"; #endif #include @@ -81,7 +81,7 @@ inet_net_pton(af, src, dst, size) * not an IPv4 network specification. * note: * network byte order assumed. this means 192.5.5.240/28 has - * 0x11110000 in its fourth octet. + * 0b11110000 in its fourth octet. * author: * Paul Vixie (ISC), June 1996 */ @@ -101,7 +101,7 @@ inet_net_pton_ipv4(src, dst, size) /* Hexadecimal: Eat nybble string. */ if (size <= 0) goto emsgsize; - *dst = 0, dirty = 0; + dirty = 0; tmp = 0; /* To calm down gcc. */ src++; /* skip x or X. */ while (isxdigit((ch = *src++))) { @@ -109,9 +109,9 @@ inet_net_pton_ipv4(src, dst, size) n = (const char *) __rawmemchr(xdigits, ch) - xdigits; assert(n >= 0 && n <= 15); if (dirty == 0) - tmp = n << 4; + tmp = n; else - tmp |= n; + tmp = (tmp << 4) | n; if (++dirty == 2) { if (size-- <= 0) goto emsgsize; @@ -119,10 +119,10 @@ inet_net_pton_ipv4(src, dst, size) dirty = 0; } } - if (dirty) { + if (dirty) { /* Odd trailing nybble? */ if (size-- <= 0) goto emsgsize; - *dst = (u_char) tmp; + *dst++ = (u_char) (tmp << 4); } } else if (isascii(ch) && isdigit(ch)) { /* Decimal: eat dotted digit string. */ Index: resolv/inet_neta.c =================================================================== RCS file: /cvs/glibc/libc/resolv/inet_neta.c,v retrieving revision 1.4 diff -u -p -r1.4 inet_neta.c --- resolv/inet_neta.c 1997/12/03 23:11:54 1.4 +++ resolv/inet_neta.c 2000/07/18 22:19:36 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996 by Internet Software Consortium. + * Copyright (c) 1996,1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_neta.c,v 1.4 1997/12/03 23:11:54 drepper Exp $"; +static const char rcsid[] = "$BINDId: inet_neta.c,v 1.6 1999/01/08 19:23:45 vixie Exp $"; #endif #include Index: resolv/inet_ntop.c =================================================================== RCS file: /cvs/glibc/libc/resolv/inet_ntop.c,v retrieving revision 1.7 diff -u -p -r1.7 inet_ntop.c --- resolv/inet_ntop.c 2000/04/06 05:00:52 1.7 +++ resolv/inet_ntop.c 2000/07/18 22:19:36 @@ -1,4 +1,5 @@ -/* Copyright (c) 1996 by Internet Software Consortium. +/* + * Copyright (c) 1996-1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,19 +16,20 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$Id: inet_ntop.c,v 1.7 2000/04/06 05:00:52 drepper Exp $"; +static const char rcsid[] = "$BINDId: inet_ntop.c,v 1.8 1999/10/13 16:39:28 vixie Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include + #include #include #include -#include + #include #include -#include "../conf/portability.h" +#include #ifdef SPRINTF_CHAR # define SPRINTF(x) strlen(sprintf/**/x) @@ -40,9 +42,9 @@ static char rcsid[] = "$Id: inet_ntop.c, * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. */ -static const char *inet_ntop4 __P((const u_char *src, char *dst, socklen_t size)) +static const char *inet_ntop4 (const u_char *src, char *dst, socklen_t size) internal_function; -static const char *inet_ntop6 __P((const u_char *src, char *dst, socklen_t size)) +static const char *inet_ntop6 (const u_char *src, char *dst, socklen_t size) internal_function; /* char * @@ -74,7 +76,7 @@ inet_ntop(af, src, dst, size) /* const char * * inet_ntop4(src, dst, size) - * format an IPv4 address, more or less like inet_ntoa() + * format an IPv4 address * return: * `dst' (as a const) * notes: @@ -122,7 +124,7 @@ inet_ntop6(src, dst, size) */ char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp; struct { int base, len; } best, cur; - u_int words[IN6ADDRSZ / INT16SZ]; + u_int words[NS_IN6ADDRSZ / NS_INT16SZ]; int i; /* @@ -131,11 +133,11 @@ inet_ntop6(src, dst, size) * Find the longest run of 0x00's in src[] for :: shorthanding. */ memset(words, '\0', sizeof words); - for (i = 0; i < IN6ADDRSZ; i += 2) + for (i = 0; i < NS_IN6ADDRSZ; i += 2) words[i / 2] = (src[i] << 8) | src[i + 1]; best.base = -1; cur.base = -1; - for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { if (words[i] == 0) { if (cur.base == -1) cur.base = i, cur.len = 1; @@ -160,7 +162,7 @@ inet_ntop6(src, dst, size) * Format the result. */ tp = tmp; - for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { /* Are we inside the best run of 0x00's? */ if (best.base != -1 && i >= best.base && i < (best.base + best.len)) { @@ -182,7 +184,8 @@ inet_ntop6(src, dst, size) tp += SPRINTF((tp, "%x", words[i])); } /* Was it a trailing run of 0x00's? */ - if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) + if (best.base != -1 && (best.base + best.len) == + (NS_IN6ADDRSZ / NS_INT16SZ)) *tp++ = ':'; *tp++ = '\0'; Index: resolv/inet_pton.c =================================================================== RCS file: /cvs/glibc/libc/resolv/inet_pton.c,v retrieving revision 1.10 diff -u -p -r1.10 inet_pton.c --- resolv/inet_pton.c 2000/05/28 19:31:28 1.10 +++ resolv/inet_pton.c 2000/07/18 22:19:36 @@ -1,4 +1,5 @@ -/* Copyright (c) 1996 by Internet Software Consortium. +/* + * Copyright (c) 1996,1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$Id: inet_pton.c,v 1.10 2000/05/28 19:31:28 drepper Exp $"; +static const char rcsid[] = "$BINDId: inet_pton.c,v 1.7 1999/10/13 16:39:28 vixie Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -27,7 +28,6 @@ static char rcsid[] = "$Id: inet_pton.c, #include #include #include -#include /* * WARNING: Don't even consider trying to compile this on a system where @@ -83,7 +83,7 @@ inet_pton4(src, dst) u_char *dst; { int saw_digit, octets, ch; - u_char tmp[INADDRSZ], *tp; + u_char tmp[NS_INADDRSZ], *tp; saw_digit = 0; octets = 0; @@ -111,8 +111,7 @@ inet_pton4(src, dst) } if (octets < 4) return (0); - - memcpy(dst, tmp, INADDRSZ); + memcpy(dst, tmp, NS_INADDRSZ); return (1); } @@ -136,13 +135,13 @@ inet_pton6(src, dst) u_char *dst; { static const char xdigits[] = "0123456789abcdef"; - u_char tmp[IN6ADDRSZ], *tp, *endp, *colonp; + u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; const char *curtok; int ch, saw_xdigit; u_int val; - tp = memset(tmp, '\0', IN6ADDRSZ); - endp = tp + IN6ADDRSZ; + tp = memset(tmp, '\0', NS_IN6ADDRSZ); + endp = tp + NS_IN6ADDRSZ; colonp = NULL; /* Leading :: requires some special handling. */ if (*src == ':') @@ -170,8 +169,10 @@ inet_pton6(src, dst) return (0); colonp = tp; continue; + } else if (*src == '\0') { + return (0); } - if (tp + INT16SZ > endp) + if (tp + NS_INT16SZ > endp) return (0); *tp++ = (u_char) (val >> 8) & 0xff; *tp++ = (u_char) val & 0xff; @@ -179,16 +180,16 @@ inet_pton6(src, dst) val = 0; continue; } - if (ch == '.' && ((tp + INADDRSZ) <= endp) && + if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && inet_pton4(curtok, tp) > 0) { - tp += INADDRSZ; + tp += NS_INADDRSZ; saw_xdigit = 0; break; /* '\0' was seen by inet_pton4(). */ } return (0); } if (saw_xdigit) { - if (tp + INT16SZ > endp) + if (tp + NS_INT16SZ > endp) return (0); *tp++ = (u_char) (val >> 8) & 0xff; *tp++ = (u_char) val & 0xff; @@ -201,6 +202,8 @@ inet_pton6(src, dst) const int n = tp - colonp; int i; + if (tp == endp) + return (0); for (i = 1; i <= n; i++) { endp[- i] = colonp[n - i]; colonp[n - i] = 0; @@ -209,6 +212,6 @@ inet_pton6(src, dst) } if (tp != endp) return (0); - memcpy(dst, tmp, IN6ADDRSZ); + memcpy(dst, tmp, NS_IN6ADDRSZ); return (1); } Index: resolv/ns_name.c =================================================================== RCS file: /cvs/glibc/libc/resolv/ns_name.c,v retrieving revision 1.1 diff -u -p -r1.1 ns_name.c --- resolv/ns_name.c 1999/12/04 18:03:12 1.1 +++ resolv/ns_name.c 2000/07/18 22:19:37 @@ -15,8 +15,8 @@ * SOFTWARE. */ -#ifndef lint -static const char rcsid[] = "$Id: ns_name.c,v 1.1 1999/12/04 18:03:12 drepper Exp $"; +#if !defined(_LIBC) && !defined(lint) +static const char rcsid[] = "$BINDId: ns_name.c,v 8.15 2000/03/30 22:53:46 vixie Exp $"; #endif #include @@ -375,7 +375,7 @@ ns_name_pack(const u_char *src, u_char * u_char *dstp; const u_char **cpp, **lpp, *eob, *msg; const u_char *srcp; - int n, l; + int n, l, first = 1; srcp = src; dstp = dst; @@ -424,9 +424,10 @@ ns_name_pack(const u_char *src, u_char * } /* Not found, save it. */ if (lastdnptr != NULL && cpp < lastdnptr - 1 && - (dstp - msg) < 0x4000) { + (dstp - msg) < 0x4000 && first) { *cpp++ = dstp; *cpp = NULL; + first = 0; } } /* copy label to buffer */ @@ -499,6 +500,23 @@ ns_name_compress(const char *src, u_char } /* + * Reset dnptrs so that there are no active references to pointers at or + * after src. + */ +void +ns_name_rollback(const u_char *src, const u_char **dnptrs, + const u_char **lastdnptr) +{ + while (dnptrs < lastdnptr && *dnptrs != NULL) { + if (*dnptrs >= src) { + *dnptrs = NULL; + break; + } + dnptrs++; + } +} + +/* * ns_name_skip(ptrptr, eom) * Advance *ptrptr to skip over the compressed name it points at. * return: @@ -600,36 +618,48 @@ dn_find(const u_char *domain, const u_ch u_int n; for (cpp = dnptrs; cpp < lastdnptr; cpp++) { - dn = domain; - sp = cp = *cpp; - while ((n = *cp++) != 0) { - /* - * check for indirection - */ - switch (n & NS_CMPRSFLGS) { - case 0: /* normal case, n == len */ - if (n != *dn++) - goto next; - for ((void)NULL; n > 0; n--) - if (mklower(*dn++) != mklower(*cp++)) + sp = *cpp; + /* + * terminate search on: + * root label + * compression pointer + * unusable offset + */ + while (*sp != 0 && (*sp & NS_CMPRSFLGS) == 0 && + (sp - msg) < 0x4000) { + dn = domain; + cp = sp; + while ((n = *cp++) != 0) { + /* + * check for indirection + */ + switch (n & NS_CMPRSFLGS) { + case 0: /* normal case, n == len */ + if (n != *dn++) goto next; - /* Is next root for both ? */ - if (*dn == '\0' && *cp == '\0') - return (sp - msg); - if (*dn) - continue; - goto next; - - case NS_CMPRSFLGS: /* indirection */ - cp = msg + (((n & 0x3f) << 8) | *cp); - break; + for ((void)NULL; n > 0; n--) + if (mklower(*dn++) != + mklower(*cp++)) + goto next; + /* Is next root for both ? */ + if (*dn == '\0' && *cp == '\0') + return (sp - msg); + if (*dn) + continue; + goto next; - default: /* illegal type */ - __set_errno (EMSGSIZE); - return (-1); + case NS_CMPRSFLGS: /* indirection */ + cp = msg + (((n & 0x3f) << 8) | *cp); + break; + + default: /* illegal type */ + __set_errno (EMSGSIZE); + return (-1); + } } + next: + sp += *sp + 1; } - next: ; } __set_errno (ENOENT); return (-1); Index: resolv/ns_netint.c =================================================================== RCS file: /cvs/glibc/libc/resolv/ns_netint.c,v retrieving revision 1.1 diff -u -p -r1.1 ns_netint.c --- resolv/ns_netint.c 1999/12/04 18:03:12 1.1 +++ resolv/ns_netint.c 2000/07/18 22:19:37 @@ -15,8 +15,8 @@ * SOFTWARE. */ -#ifndef lint -static const char rcsid[] = "$Id: ns_netint.c,v 1.1 1999/12/04 18:03:12 drepper Exp $"; +#if !defined(_LIBC) && !defined(lint) +static const char rcsid[] = "$BINDId: ns_netint.c,v 8.4 1999/10/13 16:39:35 vixie Exp $"; #endif /* Import. */ Index: resolv/ns_parse.c =================================================================== RCS file: /cvs/glibc/libc/resolv/ns_parse.c,v retrieving revision 1.1 diff -u -p -r1.1 ns_parse.c --- resolv/ns_parse.c 1999/12/04 18:03:12 1.1 +++ resolv/ns_parse.c 2000/07/18 22:19:37 @@ -15,8 +15,8 @@ * SOFTWARE. */ -#ifndef lint -static const char rcsid[] = "$Id: ns_parse.c,v 1.1 1999/12/04 18:03:12 drepper Exp $"; +#if !defined(_LIBC) && !defined(lint) +static const char rcsid[] = "$BINDId: ns_parse.c,v 8.13 1999/10/13 16:39:35 vixie Exp $"; #endif /* Import. */ Index: resolv/ns_print.c =================================================================== RCS file: /cvs/glibc/libc/resolv/ns_print.c,v retrieving revision 1.1 diff -u -p -r1.1 ns_print.c --- resolv/ns_print.c 1999/12/04 18:03:12 1.1 +++ resolv/ns_print.c 2000/07/18 22:19:37 @@ -15,11 +15,12 @@ * SOFTWARE. */ -#ifndef lint -static const char rcsid[] = "$Id: ns_print.c,v 1.1 1999/12/04 18:03:12 drepper Exp $"; +#if !defined(_LIBC) && !defined(lint) +static const char rcsid[] = "$BINDId: ns_print.c,v 8.18 2000/02/29 05:48:12 vixie Exp $"; #endif /* Import. */ + #include #include @@ -27,6 +28,7 @@ static const char rcsid[] = "$Id: ns_pri #include #include +#include #include #include #include @@ -53,6 +55,7 @@ static int addtab(size_t len, size_t tar char **buf, size_t *buflen); /* Proto. */ + #ifndef _LIBC u_int16_t dst_s_dns_key_id(const u_char *, const int); #endif @@ -122,9 +125,10 @@ ns_sprintrrf(const u_char *msg, size_t m T(addstr("@\t\t\t", 4, &buf, &buflen)); } else { T(addstr(name, len, &buf, &buflen)); - /* Origin not used and no trailing dot? */ - if ((!origin || !origin[0] || name[len] == '\0') && - name[len - 1] != '.') { + /* Origin not used or not root, and no trailing dot? */ + if (((origin == NULL || origin[0] == '\0') || + (origin[0] != '.' && origin[1] != '\0' && + name[len] == '\0')) && name[len - 1] != '.') { T(addstr(".", 1, &buf, &buflen)); len++; } @@ -480,6 +484,7 @@ ns_sprintrrf(const u_char *msg, size_t m n = SPRINTF((tmp, " ; key_tag= %u", key_id)); T(addstr(tmp, n, &buf, &buflen)); #endif /* !_LIBC */ + break; } @@ -749,20 +754,22 @@ addname(const u_char *msg, size_t msglen if (n < 0) goto enospc; /* Guess. */ newlen = prune_origin(*buf, origin); - if ((origin == NULL || origin[0] == '\0' || (*buf)[newlen] == '\0') && - (newlen == 0 || (*buf)[newlen - 1] != '.')) { - /* No trailing dot. */ - if (newlen + 2 > *buflen) - goto enospc; /* No room for ".\0". */ - (*buf)[newlen++] = '.'; - (*buf)[newlen] = '\0'; - } if (newlen == 0) { /* Use "@" instead of name. */ if (newlen + 2 > *buflen) goto enospc; /* No room for "@\0". */ (*buf)[newlen++] = '@'; (*buf)[newlen] = '\0'; + } else { + if (((origin == NULL || origin[0] == '\0') || + (origin[0] != '.' && origin[1] != '\0' && + (*buf)[newlen] == '\0')) && (*buf)[newlen - 1] != '.') { + /* No trailing dot. */ + if (newlen + 2 > *buflen) + goto enospc; /* No room for ".\0". */ + (*buf)[newlen++] = '.'; + (*buf)[newlen] = '\0'; + } } *pp += n; addlen(newlen, buf, buflen); @@ -777,9 +784,7 @@ addname(const u_char *msg, size_t msglen static void addlen(size_t len, char **buf, size_t *buflen) { -#if 0 - INSIST(len <= *buflen); -#endif + assert(len <= *buflen); *buf += len; *buflen -= len; } Index: resolv/ns_samedomain.c =================================================================== RCS file: /cvs/glibc/libc/resolv/ns_samedomain.c,v retrieving revision 1.1 diff -u -p -r1.1 ns_samedomain.c --- resolv/ns_samedomain.c 1999/12/04 18:03:12 1.1 +++ resolv/ns_samedomain.c 2000/07/18 22:19:37 @@ -15,8 +15,8 @@ * SOFTWARE. */ -#ifndef lint -static const char rcsid[] = "$Id: ns_samedomain.c,v 1.1 1999/12/04 18:03:12 drepper Exp $"; +#if !defined(_LIBC) && !defined(lint) +static const char rcsid[] = "$BINDId: ns_samedomain.c,v 8.9 1999/10/15 21:06:51 vixie Exp $"; #endif #include Index: resolv/ns_ttl.c =================================================================== RCS file: /cvs/glibc/libc/resolv/ns_ttl.c,v retrieving revision 1.1 diff -u -p -r1.1 ns_ttl.c --- resolv/ns_ttl.c 1999/12/04 18:03:12 1.1 +++ resolv/ns_ttl.c 2000/07/18 22:19:37 @@ -15,11 +15,12 @@ * SOFTWARE. */ -#ifndef lint -static const char rcsid[] = "$Id: ns_ttl.c,v 1.1 1999/12/04 18:03:12 drepper Exp $"; +#if !defined(_LIBC) && !defined(lint) +static const char rcsid[] = "$BINDId: ns_ttl.c,v 8.8 1999/10/13 16:39:36 vixie Exp $"; #endif /* Import. */ + #include #include Index: resolv/nsap_addr.c =================================================================== RCS file: /cvs/glibc/libc/resolv/nsap_addr.c,v retrieving revision 1.8 diff -u -p -r1.8 nsap_addr.c --- resolv/nsap_addr.c 1999/12/04 18:02:08 1.8 +++ resolv/nsap_addr.c 2000/07/18 22:19:37 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996 by Internet Software Consortium. + * Copyright (c) 1996-1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,15 +16,17 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$Id: nsap_addr.c,v 1.8 1999/12/04 18:02:08 drepper Exp $"; +static const char rcsid[] = "$BINDId: nsap_addr.c,v 8.10 1999/10/13 16:39:28 vixie Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include + #include #include #include + #include #include @@ -38,7 +40,7 @@ inet_nsap_addr(const char *ascii, u_char u_char c, nib; u_int len = 0; - while ((c = *ascii++) != '\0' && (int) len < maxlen) { + while ((c = *ascii++) != '\0' && len < (u_int)maxlen) { if (c == '.' || c == '+' || c == '/') continue; if (!isascii(c)) Index: resolv/res_comp.c =================================================================== RCS file: /cvs/glibc/libc/resolv/res_comp.c,v retrieving revision 1.18 diff -u -p -r1.18 res_comp.c --- resolv/res_comp.c 1999/12/04 18:02:08 1.18 +++ resolv/res_comp.c 2000/07/18 22:19:38 @@ -1,7 +1,7 @@ /* * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -25,16 +25,18 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - + */ + +/* * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -64,23 +66,19 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_comp.c,v 1.18 1999/12/04 18:02:08 drepper Exp $"; +static const char rcsid[] = "$BINDId: res_comp.c,v 8.15 1999/10/13 16:39:39 vixie Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include #include - #include -#include #include #include - #include #include - /* * Expand compressed domain name 'comp_dn' to full domain name. * 'msg' is a pointer to the begining of the message, @@ -157,7 +155,7 @@ res_hnok(const char *dn) { int nch = *dn++; if (periodchar(ch)) { - /* NULL */; + (void)NULL; } else if (periodchar(pch)) { if (!borderchar(ch)) return (0); @@ -198,7 +196,7 @@ res_mailok(const char *dn) { /* "." is a valid missing representation */ if (*dn == '\0') - return(1); + return (1); /* otherwise