From patchwork Fri Nov 13 16:58:30 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: 41064 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 99C2D3947411; Fri, 13 Nov 2020 16:59:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99C2D3947411 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605286753; bh=16rCmTjppid7RBBc2F/YsjJTy2YFJGHxKb5dD0u4zgQ=; 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=nnrP+n5AOOa1bsNQGuW8Oyc5D77hsGOh2CTQic8x4meJuIlagzeiZGvWOQDBBfBQ1 s3du/VS9nHeKCzLcNW7DvUp15Wh7THd/+W2L8Y/RdDhZkqn3AVBQBUDjyxiPi1pm7+ 2uJsz4xp7zheo5pDk+NjBhti52EYozKXlaIf3kfI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by sourceware.org (Postfix) with ESMTPS id 024EF3947407 for ; Fri, 13 Nov 2020 16:59:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 024EF3947407 Received: by mail-qv1-xf41.google.com with SMTP id g19so4919434qvy.2 for ; Fri, 13 Nov 2020 08:59:10 -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=16rCmTjppid7RBBc2F/YsjJTy2YFJGHxKb5dD0u4zgQ=; b=lIQkEpGKqcMX4wl3qZZ4UtftueTX+MpWjnLUkU5D6X3m80dlkVgeDtjR28tFLCzG5k 8u5HZwQiZxgBIbiNYjktJjL32BVNubejKT8vCCFRTDgMrA7RrWXgaLTYUC+C7CdGNg4E 7lHrqQVjpaO+lO8ACt2dBNME5aIU5Vrqu49HWfQeK7srVCiyP9j5esSvNvARMjP9UQuj zReKzpCsbNaJPdCo4XvXvwZaDovkNeFJR90+2+ZGsU/feh0Jc0b0dCPgPnJTQeIjkJF9 XdZFMa/z9QFjlinyYPxpgGPreWqnLkMjCiI0Tad88znovw0q64U3xiIbikWrznT59fGN 5G5g== X-Gm-Message-State: AOAM532nAy3BE7zaOcvXK2xOVeY14Lsi+5NRxQv/QdQfVuP0kR9kgBpm dPbPEaPrl9B1s/HyhoE0z8q5b5hrXdKopA== X-Google-Smtp-Source: ABdhPJx97IGR1WnRz8gc0ZjUI5HsgKph8KXkce2jkbyjq6R2kBiJrgQ8Lxucp/kKvziPZsJPlR/YSQ== X-Received: by 2002:a0c:f951:: with SMTP id i17mr3322609qvo.22.1605286745339; Fri, 13 Nov 2020 08:59:05 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id s16sm7363931qkg.5.2020.11.13.08.59.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 08:59:04 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 16/23] linux: Use generic __syscall_error for ia64 Date: Fri, 13 Nov 2020 13:58:30 -0300 Message-Id: <20201113165837.121629-17-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" Although the auto-generated syscall issues __syscall_errno, using an inline function generates much more compact code: --- sizes-ia64-linux-gnu.inline +++ sizes-ia64-linux-gnu.outline text data bss dec hex filename -2940053 20776 14424 2975253 2d6615 libc.so - 301887 23190 1968 327045 4fd85 elf/ld.so - 203203 2472 16640 222315 3646b nptl/libpthread.so - 47153 1764 2272 51189 c7f5 rt/librt.so +2947445 20776 14424 2982645 2d82f5 libc.so + 302591 23190 1968 327749 50045 elf/ld.so + 204987 2472 16640 224099 36b63 nptl/libpthread.so + 47609 1764 2272 51645 c9bd rt/librt.so Checked with a cross make check for ia64-linux-gnu. --- sysdeps/ia64/nptl/Makefile | 5 -- sysdeps/unix/sysv/linux/ia64/Makefile | 5 -- sysdeps/unix/sysv/linux/ia64/rt-sysdep.S | 1 - sysdeps/unix/sysv/linux/ia64/syscall_error.c | 5 ++ sysdeps/unix/sysv/linux/ia64/sysdep.S | 58 -------------------- 5 files changed, 5 insertions(+), 69 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/ia64/rt-sysdep.S create mode 100644 sysdeps/unix/sysv/linux/ia64/syscall_error.c delete mode 100644 sysdeps/unix/sysv/linux/ia64/sysdep.S diff --git a/sysdeps/ia64/nptl/Makefile b/sysdeps/ia64/nptl/Makefile index d34cb27699..7869dd571c 100644 --- a/sysdeps/ia64/nptl/Makefile +++ b/sysdeps/ia64/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/ia64/Makefile b/sysdeps/unix/sysv/linux/ia64/Makefile index 97fc7df0b1..57917e78db 100644 --- a/sysdeps/unix/sysv/linux/ia64/Makefile +++ b/sysdeps/unix/sysv/linux/ia64/Makefile @@ -17,11 +17,6 @@ ifeq ($(subdir),elf) sysdep-dl-routines += dl-static endif -ifeq ($(subdir),rt) -librt-routines += rt-sysdep -librt-shared-only-routines += rt-sysdep -endif - ifeq ($(subdir),nptl) libpthread-sysdep_routines += __ia64_longjmp unwind_longjmp __sigstack_longjmp endif diff --git a/sysdeps/unix/sysv/linux/ia64/rt-sysdep.S b/sysdeps/unix/sysv/linux/ia64/rt-sysdep.S deleted file mode 100644 index f966bf1e59..0000000000 --- a/sysdeps/unix/sysv/linux/ia64/rt-sysdep.S +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/ia64/syscall_error.c b/sysdeps/unix/sysv/linux/ia64/syscall_error.c new file mode 100644 index 0000000000..2cd3e3a200 --- /dev/null +++ b/sysdeps/unix/sysv/linux/ia64/syscall_error.c @@ -0,0 +1,5 @@ +/* The auto-generated syscalls calls __syscall_error. */ +#include +#undef SYSCALL_ERROR_FUNC +#define SYSCALL_ERROR_FUNC 1 +#include diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.S b/sysdeps/unix/sysv/linux/ia64/sysdep.S deleted file mode 100644 index 75fc3d6456..0000000000 --- a/sysdeps/unix/sysv/linux/ia64/sysdep.S +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (C) 1999-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Mosberger-Tang . - - 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 -#include - -ENTRY(__syscall_error) -#if RTLD_PRIVATE_ERRNO - /* - * Note that the gp has to be set properly for this to work. - * As long as all syscalls are in the same load unit - * (executable or shared library) as this routine, we should - * be fine. Otherwise, we would have to first load the global - * pointer register from __gp. - */ - addl r2=@gprel(rtld_errno),gp - ;; - st4 [r2]=r8 - mov r8=-1 -#else -# if IS_IN (libc) -# define SYSCALL_ERROR_ERRNO __libc_errno -# else -# define SYSCALL_ERROR_ERRNO errno -# endif - addl r2=@ltoff(@tprel(SYSCALL_ERROR_ERRNO)), gp;; - ld8 r2=[r2] - mov r3=r8;; - mov r8=-1 - add r2=r2,r13;; - st4 [r2]=r3 -#endif - ret // ret is #define'd in syscall.h! -END(__syscall_error) - -ENTRY(__ia64_syscall) - mov r15=r37 /* syscall number */ - break __IA64_BREAK_SYSCALL - cmp.eq p6,p0=-1,r10 /* r10 = -1 on error */ -(p6) br.cond.spnt.few __syscall_error - ret -PSEUDO_END(__ia64_syscall)