From patchwork Fri Nov 13 16:58:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41061 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 7ED6C39450FB; Fri, 13 Nov 2020 16:59:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7ED6C39450FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605286749; bh=g7rlNkUkA5ez0wCziPE2B/2bIA7NVoJEwtGokAc0t0g=; 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=YKBX7+bW+3P7NDwSAp7q4QHsfOFlEx+L8vK7HtP3fMALdj0ndusXkvw2ybR6pXMKa LUMY8xUnoAEg7HsvAF+D5t91tVhJR/bMgiaHTzUvo7+IPvykbvAeNkGFY5PFqJPJH/ IIRwUFILiVOdPpDu7QRI0y4yx0jSkaQXBPHCnm0w= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by sourceware.org (Postfix) with ESMTPS id D97C33945C26 for ; Fri, 13 Nov 2020 16:59:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D97C33945C26 Received: by mail-qt1-x833.google.com with SMTP id 7so7156516qtp.1 for ; Fri, 13 Nov 2020 08:59:06 -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=g7rlNkUkA5ez0wCziPE2B/2bIA7NVoJEwtGokAc0t0g=; b=qtwyfGSbX0p26LMviCYqGxflSykt61u7AMSszt6uosxt/disdt0dUBZHjNg/5zAqRQ Ge8Le8rwJ0jIG4dxBESy3hIvVjYELAvjxqeogwHB8LOIiyeD/D+OolfIRa34Fx/c1MLW ZCq7MZbW+60klNY88CEC6N17qpnko7we+UQbNMCbFG08w9XkIl0KkTkH1jbTzzyOUGbd au3iQwrL/PzVdjGH/BKt8QlQA9WQHhuq/59THVhzqSxE3Eh4IUrT3xNqg1C1WcZCrnho lOIWIHgHQ9Sf6nNIPIkSZG9RwUKnIPBszxB8S4jBq8Uf+yoX0Nyyf4AfF01ceCIsJFel pPuw== X-Gm-Message-State: AOAM533mWl6wa8o2e38/iA4hyyLHkiPXDqGyeLOhJi6d9m0BPphW+Vs3 jaHsFdbRPXXJKP/yh7wGJCk+VTGh7MYxVQ== X-Google-Smtp-Source: ABdhPJxsDl/sktMv9Ve7EFPlItrZgmPA3cML3cDcKzV4gdWGNXVUME9gcidSoFVxmxhlJ81hO+sJjA== X-Received: by 2002:aed:2c02:: with SMTP id f2mr3000689qtd.48.1605286741290; Fri, 13 Nov 2020 08:59:01 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id s16sm7363931qkg.5.2020.11.13.08.59.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 08:59:00 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 13/23] linux: Use generic __syscall_error for s390 Date: Fri, 13 Nov 2020 13:58:27 -0300 Message-Id: <20201113165837.121629-14-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201113165837.121629-1-adhemerval.zanella@linaro.org> References: <20201113165837.121629-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.9 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 Netto 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 | 7 ++ 6 files changed, 7 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..de5491dc50 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/syscall_error.c @@ -0,0 +1,7 @@ +/* The auto-generated syscalls calls __syscall_error for static objects. */ +#include +#ifndef SHARED +# undef SYSCALL_ERROR_FUNC +# define SYSCALL_ERROR_FUNC 1 +#endif +#include