From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21349 invoked by alias); 30 Jun 2004 18:28:03 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 21331 invoked from network); 30 Jun 2004 18:28:02 -0000 Received: from unknown (HELO sunsite.ms.mff.cuni.cz) (195.113.15.26) by sourceware.org with SMTP; 30 Jun 2004 18:28:02 -0000 Received: from sunsite.ms.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8) with ESMTP id i5UGD23j012449; Wed, 30 Jun 2004 18:13:02 +0200 Received: (from jakub@localhost) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8/Submit) id i5UGD1kb012447; Wed, 30 Jun 2004 18:13:01 +0200 Date: Wed, 30 Jun 2004 18:28:00 -0000 From: Jakub Jelinek To: Ulrich Drepper , Martin Schwidefsky Cc: Glibc hackers Subject: [PATCH] .plt slot reduction on s390 Message-ID: <20040630161301.GV5191@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2004-06/txt/msg00066.txt.bz2 Hi! sysdep.S changes get rid of __errno_location .plt slot. clone.S changes get rid of _exit .plt slot and furthermore make it more correct - clone should at the end just exit the current thread, not the whole process. mathinline.h was introduced to get rid of __signbit .plt slot and glob64 changes because GCC on s390 31-bit is not able to figure out it doesn't have to hop through .plt for a recursive call. Something still should be done with ffs (guess libc_hidden_builtin_proto and corresponding changes), but I haven't tested that yet. 2004-06-30 Jakub Jelinek * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S: Include tls.h. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: Include tls.h. * sysdeps/unix/sysv/linux/s390/s390-32/clone.S (thread_start): DO_CALL (exit, 1) instead of branching to _exit. * sysdeps/unix/sysv/linux/s390/s390-64/clone.S (thread_start): Likewise. * sysdeps/s390/fpu/bits/mathinline.h: New file. * include/glob.h (glob64): Add libc_hidden_proto. * sysdeps/generic/glob64.c (glob64): Add libc_hidden_def. * sysdeps/gnu/glob64.c (glob64): Likewise. * sysdeps/unix/sysv/linux/i386/glob64.c (glob64): Likewise. --- libc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S.jj 2003-12-11 22:23:20.000000000 +0100 +++ libc/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S 2004-06-30 18:40:56.787160200 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. @@ -18,6 +18,7 @@ 02111-1307 USA. */ #include +#include /* The following code is only used in the shared library when we compile the reentrant version. Otherwise each system call defines --- libc/sysdeps/unix/sysv/linux/s390/s390-32/clone.S.jj 2003-12-11 22:23:20.000000000 +0100 +++ libc/sysdeps/unix/sysv/linux/s390/s390-32/clone.S 2004-06-30 17:59:19.726127752 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). @@ -59,18 +59,5 @@ thread_start: ahi %r15,-96 /* make room on the stack for the save area */ xc 0(4,%r15),0(%r15) basr %r14,%r1 /* jump to fn */ -#ifdef PIC - basr %r12,0 -.L0: lr %r1,%r12 - al %r12,.L1-.L0(%r12) - al %r1,.L2-.L0(%r1) - br %r1 /* branch to _exit -> thread termination */ -.L1: .long _GLOBAL_OFFSET_TABLE_ - .L0 -.L2: .long _exit@PLT - .L0 -#else - basr %r1,0 -.L0: al %r1,.L1-.L0(0,%r1) - br %r1 /* branch to _exit -> thread termination */ -.L1: .long _exit - .L0 -#endif + DO_CALL (exit, 1) weak_alias (__clone, clone) --- libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S.jj 2003-12-11 22:23:20.000000000 +0100 +++ libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S 2004-06-30 18:41:21.968709802 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. @@ -18,6 +18,7 @@ 02111-1307 USA. */ #include +#include /* The following code is only used in the shared library when we --- libc/sysdeps/unix/sysv/linux/s390/s390-64/clone.S.jj 2003-12-11 22:23:20.000000000 +0100 +++ libc/sysdeps/unix/sysv/linux/s390/s390-64/clone.S 2004-06-30 18:00:34.805870663 +0200 @@ -1,5 +1,5 @@ /* Wrapper around clone system call. 64 bit S/390 version. - Copyright (C) 2001, 2003 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. @@ -60,9 +60,5 @@ thread_start: aghi %r15,-160 /* make room on the stack for the save area */ xc 0(8,%r15),0(%r15) basr %r14,%r1 /* jump to fn */ -#ifdef PIC - jg _exit@PLT /* branch to _exit -> thread termination */ -#else - jg _exit /* branch to _exit -> thread termination */ -#endif + DO_CALL (exit, 1) weak_alias (__clone, clone) --- libc/sysdeps/unix/sysv/linux/i386/glob64.c.jj 2004-03-10 10:32:06.000000000 +0100 +++ libc/sysdeps/unix/sysv/linux/i386/glob64.c 2004-06-30 19:17:19.187262127 +0200 @@ -23,6 +23,7 @@ #include "shlib-compat.h" +libc_hidden_def (glob64) libc_hidden_def (globfree64) versioned_symbol (libc, __glob64, glob64, GLIBC_2_2); --- libc/sysdeps/gnu/glob64.c.jj 2002-08-05 02:30:59.000000000 +0200 +++ libc/sysdeps/gnu/glob64.c 2004-06-30 19:10:30.503523097 +0200 @@ -21,4 +21,5 @@ #include +libc_hidden_def (glob64) libc_hidden_def (globfree64) --- libc/sysdeps/s390/fpu/bits/mathinline.h.jj 2004-06-30 19:55:43.032815447 +0200 +++ libc/sysdeps/s390/fpu/bits/mathinline.h 2004-06-30 19:55:39.457447993 +0200 @@ -0,0 +1,50 @@ +/* Inline math functions for s390. + Copyright (C) 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _MATH_H +# error "Never use directly; include instead." +#endif + +#ifdef __cplusplus +# define __MATH_INLINE __inline +#else +# define __MATH_INLINE extern __inline +#endif + +#if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \ + && defined __OPTIMIZE__ + +#ifdef __USE_ISOC99 + +/* Test for negative number. Used in the signbit() macro. */ +__MATH_INLINE int __signbitf (float __x) __THROW +{ + __extension__ union { float __f; int __i; } __u = { __f: __x }; + return __u.__i < 0; +} + +__MATH_INLINE int __signbit (double __x) __THROW +{ + __extension__ union { double __d; long __i; } __u = { __d: __x }; + return __u.__i < 0; +} + +#endif /* C99 */ + +#endif /* __NO_MATH_INLINES */ --- libc/sysdeps/generic/glob64.c.jj 2002-08-04 05:30:42.000000000 +0200 +++ libc/sysdeps/generic/glob64.c 2004-06-30 19:10:01.603633194 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 1998,99,2002 Free Software Foundation, Inc. +/* Copyright (C) 1998,99,2002,2004 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 @@ -42,12 +42,13 @@ glob64 (const char *pattern, int flags, __set_errno (ENOSYS); return GLOB_NOSYS; } +libc_hidden_def (glob64) void globfree64 (glob64_t *pglob) { } -libc_hidden_def (globfree64); +libc_hidden_def (globfree64) stub_warning (glob64) #include --- libc/include/glob.h.jj 2002-08-04 05:30:42.000000000 +0200 +++ libc/include/glob.h 2004-06-30 19:08:57.102038499 +0200 @@ -2,6 +2,7 @@ #include libc_hidden_proto (glob) +libc_hidden_proto (glob64) libc_hidden_proto (globfree) libc_hidden_proto (globfree64) Jakub