From patchwork Mon Nov 9 20:18:20 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: 40997 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 314DD397306D; Mon, 9 Nov 2020 20:19:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 314DD397306D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1604953143; bh=wjP8ci4O1Y0ir56v74MAt0XOwh2pQomJOkouxEhKuzc=; 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=mWDMhmI0d8eHDc7+ZIlE6ycaWcC1gB4nEDWvJXL5AzFTQRgz7GeOcapA9+pnulONZ sXOInQ+5qyH5QpT1OrezDChQDA2QktSstBPzJDDDg1yHFZgio+hIcgfOQDptDVinQY cqCnk3lSEC5AtnEQvLw3H41MY1lkyWmbC8OQ92tE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by sourceware.org (Postfix) with ESMTPS id 365D13973096 for ; Mon, 9 Nov 2020 20:19:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 365D13973096 Received: by mail-qt1-x842.google.com with SMTP id h12so6962133qtc.9 for ; Mon, 09 Nov 2020 12:19:00 -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=wjP8ci4O1Y0ir56v74MAt0XOwh2pQomJOkouxEhKuzc=; b=GrRRYCeLnpijOAFEJWO01Xumlq4HGYzx3IyJyOkY7ugQN1I6M31Cjh74DrwSd4wY3z SYGYQqhXpUU3DQZKAtp0dW6oK/utIYLsnFYstZae/ExKqO/nnbsGQGqSD0l92QnpX4Ha u2fCFn7OjzFYrB4c2wqTkAPDT1bTPth+7nKLR8bBSXVcddKq7h6PHj7XhkN60zy7ro5C o4QS/XHBSpHElwh8r4z+MZFLPbGPoPHEtPWJyS/CI48aWbpdtJuNDne+sdoIsxlQ07gW h7td9mlc+8SHfas7o+54phrlKDSFSaYCMGfBboOb4e5AE4TdRs5bvLHQ5qa9kT0OOkvq nE0Q== X-Gm-Message-State: AOAM532/aq05hzBjJN/TippNzEWDcAekLjqXG8j780W7Hx3SFei5dfO6 7T+nNPJNEB9GEKcCI9zmrNwQTEtPH6WXuQ== X-Google-Smtp-Source: ABdhPJxr7hyX7BLauy0tsu45BP0SLh6p0PSBvOx49fH7OMLNAeOS0kq3hugnuBe4dmHIqEt7OAGGnw== X-Received: by 2002:aed:2aa2:: with SMTP id t31mr4492853qtd.375.1604953139510; Mon, 09 Nov 2020 12:18:59 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id z2sm6843407qkl.22.2020.11.09.12.18.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 12:18:59 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 17/23] linux: Use generic __syscall_error for ia64 Date: Mon, 9 Nov 2020 17:18:20 -0300 Message-Id: <20201109201826.120534-18-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 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 | 3 + sysdeps/unix/sysv/linux/ia64/sysdep.S | 58 -------------------- 5 files changed, 3 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..60fa99a158 --- /dev/null +++ b/sysdeps/unix/sysv/linux/ia64/syscall_error.c @@ -0,0 +1,3 @@ +/* The auto-generated syscalls calls __syscall_error. */ +#define SYSCALL_ERROR_FUNC +#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)