From patchwork Mon Nov 9 20:18:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 40994 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 16CE5397308E; Mon, 9 Nov 2020 20:19:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16CE5397308E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1604953140; bh=9R6zYH6Keq9LU9J1DEnIDv7FEiLaBiIsIurLXE1EvW4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=c2GZWZTMuitwMxgOvuAl1iIJH3KJ0tdKOx9YX5oQmZowGh6eAbng+YW+lY53LOM/x mQXs+iamAsHFXbAu5uAVvfnLsm3uwLoHMEVB/PFXVHK0dX5YtziTRhBzmXcbThJxMg K3UTPs4lIzEUEF8GpicyjtXXNhyRxF26fIhw7V8o= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by sourceware.org (Postfix) with ESMTPS id 3DFFB3973072 for ; Mon, 9 Nov 2020 20:18:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3DFFB3973072 Received: by mail-qt1-x82d.google.com with SMTP id v11so6583547qtq.12 for ; Mon, 09 Nov 2020 12:18:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9R6zYH6Keq9LU9J1DEnIDv7FEiLaBiIsIurLXE1EvW4=; b=j5sfeE9d2ClZf16skPIR1s6f5mdc639UV7AMYsH2YViYfDFSIGvWUBmXRi/lNNUEy4 cvd7e7LAYBRiPZ9up3gdYeH5dswUaNpsVkXA5G0ydyd8FmZQdiCEmfn7YdK0iLeZVs11 Jh9rQfPsIxtGq8ldSKC4VkE+M4iMdrZJKTo5/qOJISGSXkSQRAiHuBc/dKsX6fgoeBlz XSl11ndGQLijsYN4eiw68xGNIhqhl3mLnbtH0JS705gqL5R8P4OWTYL48aS5rhdGvkjV aE1AZOIZ6wDOH3Z+K+GtkiczgleGT7xw7NYgqmgeGq1X4qot72JDSVE8C1Jt6aqzm86Y TIkQ== X-Gm-Message-State: AOAM532SabJ5TVEbwlKPX7ENR+YbEsVIkiKORx94sCwoDsNRvI1a+YI7 1vdmNNRNfVE2RQDca0anDj59Aqn0EHRE3g== X-Google-Smtp-Source: ABdhPJwNfyp25dARK0hJnHz7Yjhby4CVl8XYMVBM7ugxQ5M7nyEfRq5TkKulbjferlh+i4qdWpY0Mg== X-Received: by 2002:ac8:6898:: with SMTP id m24mr15121332qtq.157.1604953135476; Mon, 09 Nov 2020 12:18:55 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id z2sm6843407qkl.22.2020.11.09.12.18.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 12:18:55 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 14/23] linux: Use generic __syscall_error for s390 Date: Mon, 9 Nov 2020 17:18:17 -0300 Message-Id: <20201109201826.120534-15-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201109201826.120534-1-adhemerval.zanella@linaro.org> References: <20201109201826.120534-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The auto-generated syscalls issue the __syscall_error only for static objects, so an arch specific syscall_error is added. However the size of using inline __syscall_error is slight better even for static case: --- size-fstatat64.inline +++ size-fstatat64.outline @@ -1,2 +1,2 @@ text data bss dec hex filename - 120 0 0 120 78 io/fstatat64.o + 128 0 0 128 80 io/fstatat64.o For shared objects the inline syscall generates slight large code (specially for libc.so). --- sizes-s390x-linux-gnu.outline +++ sizes-s390x-linux-gnu.inline text data bss dec hex filename -1755806 20232 14544 1790582 1b5276 libc.so - 169705 6696 336 176737 2b261 elf/ld.so - 111982 1664 16680 130326 1fd16 nptl/libpthread.so - 29703 1132 2296 33131 816b rt/librt.so +1756334 20232 14544 1791110 1b5486 libc.so + 169385 6696 336 176417 2b121 elf/ld.so + 112198 1664 16680 130542 1fdee nptl/libpthread.so + 29719 1132 2296 33147 817b rt/librt.so Checked on s390x-linux-gnu and s390-linux-gnu. --- sysdeps/s390/nptl/Makefile | 5 -- sysdeps/unix/sysv/linux/s390/Makefile | 5 -- sysdeps/unix/sysv/linux/s390/rt-sysdep.S | 1 - sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S | 74 ------------------ sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S | 75 ------------------- sysdeps/unix/sysv/linux/s390/syscall_error.c | 5 ++ 6 files changed, 5 insertions(+), 160 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/s390/rt-sysdep.S delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S create mode 100644 sysdeps/unix/sysv/linux/s390/syscall_error.c diff --git a/sysdeps/s390/nptl/Makefile b/sysdeps/s390/nptl/Makefile index d34cb27699..7869dd571c 100644 --- a/sysdeps/s390/nptl/Makefile +++ b/sysdeps/s390/nptl/Makefile @@ -18,8 +18,3 @@ ifeq ($(subdir),csu) gen-as-const-headers += tcb-offsets.sym endif - -ifeq ($(subdir),nptl) -libpthread-routines += sysdep -libpthread-shared-only-routines += sysdep -endif diff --git a/sysdeps/unix/sysv/linux/s390/Makefile b/sysdeps/unix/sysv/linux/s390/Makefile index d9db1b5422..0d88f8d7ff 100644 --- a/sysdeps/unix/sysv/linux/s390/Makefile +++ b/sysdeps/unix/sysv/linux/s390/Makefile @@ -2,11 +2,6 @@ abi-variants := 32 64 abi-32-condition := __WORDSIZE == 32 abi-64-condition := __WORDSIZE == 64 -ifeq ($(subdir),rt) -librt-routines += rt-sysdep -librt-shared-only-routines += rt-sysdep -endif - ifeq ($(subdir),stdlib) gen-as-const-headers += ucontext_i.sym endif diff --git a/sysdeps/unix/sysv/linux/s390/rt-sysdep.S b/sysdeps/unix/sysv/linux/s390/rt-sysdep.S deleted file mode 100644 index f966bf1e59..0000000000 --- a/sysdeps/unix/sysv/linux/s390/rt-sysdep.S +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S deleted file mode 100644 index f8a6b7901d..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (C) 2000-2020 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). - 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, see - . */ - -#include -#include - -/* The following code is only used in the shared library when we - compile the reentrant version. Otherwise each system call defines - each own version. */ - -/* The syscall stubs jump here when they detect an error. */ - -#undef CALL_MCOUNT -#define CALL_MCOUNT - - .text -ENTRY(__syscall_error) -#ifndef PIC -# if IS_IN (libc) -# define SYSCALL_ERROR_ERRNO __libc_errno -# else -# define SYSCALL_ERROR_ERRNO errno -# endif - basr %r1,0 -0: l %r1,1f-0b(%r1) - ear %r3,%a0 - lcr %r2,%r2 - st %r2,0(%r1,%r3) - lhi %r2,-1 - br %r14 -1: .long SYSCALL_ERROR_ERRNO@ntpoff -#else -# if RTLD_PRIVATE_ERRNO - basr %r1,0 -0: al %r1,1f-0b(%r1) - lcr %r2,%r2 - st %r2,0(%r1) - lhi %r2,-1 - br %r14 -1: .long rtld_errno - 0b -# else -# if IS_IN (libc) -# define SYSCALL_ERROR_ERRNO __libc_errno -# else -# define SYSCALL_ERROR_ERRNO errno -# endif - basr %r1,0 -0: al %r1,1f-0b(%r1) - ear %r3,%a0 - l %r1,SYSCALL_ERROR_ERRNO@gotntpoff(%r1) - lcr %r2,%r2 - st %r2,0(%r1,%r3) - lhi %r2,-1 - br %r14 -1: .long _GLOBAL_OFFSET_TABLE_-0b -# endif -#endif - -END (__syscall_error) diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S deleted file mode 100644 index 98c8dd3913..0000000000 --- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright (C) 2001-2020 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). - 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, see - . */ - -#include -#include - - -/* The following code is only used in the shared library when we - compile the reentrant version. Otherwise each system call defines - each own version. */ - -/* The syscall stubs jump here when they detect an error. */ - -#undef CALL_MCOUNT -#define CALL_MCOUNT - -.text -ENTRY(__syscall_error) -#ifndef PIC -# if IS_IN (libc) -# define SYSCALL_ERROR_ERRNO __libc_errno -# else -# define SYSCALL_ERROR_ERRNO errno -# endif - basr %r1,0 -0: lg %r1,1f-0b(%r1) - ear %r3,%a0 - sllg %r3,%r3,32 - ear %r3,%a1 - lcr %r2,%r2 - st %r2,0(%r1,%r3) - lghi %r2,-1 - br %r14 -1: .quad SYSCALL_ERROR_ERRNO@ntpoff -#else -# if RTLD_PRIVATE_ERRNO - larl %r1,rtld_errno - lcr %r2,%r2 - st %r2,0(%r1) - lghi %r2,-1 - br %r14 -# else -# if IS_IN (libc) -# define SYSCALL_ERROR_ERRNO __libc_errno -# else -# define SYSCALL_ERROR_ERRNO errno -# endif - larl %r1,_GLOBAL_OFFSET_TABLE_ - lg %r1,SYSCALL_ERROR_ERRNO@gotntpoff(%r1) - ear %r3,%a0 - sllg %r3,%r3,32 - ear %r3,%a1 - lcr %r2,%r2 - st %r2,0(%r1,%r3) - lghi %r2,-1 - br %r14 -# endif -#endif - -END (__syscall_error) diff --git a/sysdeps/unix/sysv/linux/s390/syscall_error.c b/sysdeps/unix/sysv/linux/s390/syscall_error.c new file mode 100644 index 0000000000..40528f8ae9 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/syscall_error.c @@ -0,0 +1,5 @@ +/* The auto-generated syscalls calls __syscall_error for static objects. */ +#ifndef SHARED +# define SYSCALL_ERROR_FUNC +#endif +#include