From patchwork Mon Nov 9 20:18:24 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: 41001 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 2A3823896C3F; Mon, 9 Nov 2020 20:19:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A3823896C3F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1604953148; bh=TcTFrCeFZ5ryiItulKtbdvg6p5MzaW/ftChGUIRsaL0=; 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=IMfe6pkRGi1UqvesW6vzT2od1VNJhYNUSvPnH/mlPRaspZuX8ZdRXNw0GnmqLsmYA X5mmuWYgO/moNlFnb17KAC7HEj+d3CzIIIC0R2AItbXJCkOSXraqJ323EhhtRq7XVC kGXrsJp18Huqmst1eIYc0klibq4K8bfuq6gQuFVg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by sourceware.org (Postfix) with ESMTPS id 79CAB39730BC for ; Mon, 9 Nov 2020 20:19:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 79CAB39730BC Received: by mail-qt1-x844.google.com with SMTP id g17so6978327qts.5 for ; Mon, 09 Nov 2020 12:19:05 -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=TcTFrCeFZ5ryiItulKtbdvg6p5MzaW/ftChGUIRsaL0=; b=SNbwlKkNfX8KM6qfA+xTa2vYoVgnzoHMaEAMNlXOscFG8pVHaldbe34XSYfsk2WXdH jmmOfNr5eUgBBuoIsP/iVlgSgV8LuzNaSwPbIfJB1k5GKjE/Z820E2Qq50ooaPuqWNvM 6Cw04uiYGOSKkmSTprRIKQaK/mR6MPei2GJnkaeqeijhf+r/z46WD5ycThgGMst2mYsV ASf/vR1KuXqgA4rGumimLTit0CPQPMEmq0nkwp5UZdcjmO0DKA9JU8MBDiL9rwy+o7Aq XZgOvi3rUM4kd7w14/XVn3Ppc3tSEGclffKwQEyQZTv79gYIpjiUZuCUflOhlnCO9yE1 b/9A== X-Gm-Message-State: AOAM532qZZYswJrjouj2G1fpcFCicorqC4PDyTTK6qFiU2/E/Q5TuBP2 tX61lhLvHzfgS+6+sa8LwKeKJkJPsyIISA== X-Google-Smtp-Source: ABdhPJxgiZ5VckpBicqx1vJc/ylIYq3o4YrDCDmCPwDp4FZE1QSPVBtn+ddIFxDwOvGRAqmrNAedoA== X-Received: by 2002:ac8:4d99:: with SMTP id a25mr4512575qtw.122.1604953144849; Mon, 09 Nov 2020 12:19:04 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id z2sm6843407qkl.22.2020.11.09.12.19.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 12:19:04 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 21/23] linux: Use generic __syscall_error for nios2 Date: Mon, 9 Nov 2020 17:18:24 -0300 Message-Id: <20201109201826.120534-22-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" The usage of __syscall_error function on dynamic objects only increases the total size slightly: --- sizes-nios2-linux-gnu.inline +++ sizes-nios2-linux-gnu.outline text data bss dec hex filename -1425296 78844 9224 1513364 171794 libc.so - 143824 8138 184 152146 25252 elf/ld.so - 101762 9260 8356 119378 1d252 nptl/libpthread.so - 26183 2392 160 28735 703f rt/librt.so +1425592 80724 9224 1515540 172014 libc.so + 143960 8142 184 152286 252de elf/ld.so + 102278 10552 8356 121186 1d962 nptl/libpthread.so + 26175 2396 160 28731 703b rt/librt.so And since the port already issues the function call for static object it simplifies the implementation since it avoid add an arch-specific syscall_error.c. Checked with cross make check for nios2-linux-gnu. --- sysdeps/unix/sysv/linux/nios2/sysdep.S | 50 -------------------------- sysdeps/unix/sysv/linux/nios2/sysdep.h | 2 ++ 2 files changed, 2 insertions(+), 50 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/nios2/sysdep.S diff --git a/sysdeps/unix/sysv/linux/nios2/sysdep.S b/sysdeps/unix/sysv/linux/nios2/sysdep.S deleted file mode 100644 index 6efbb5aff6..0000000000 --- a/sysdeps/unix/sysv/linux/nios2/sysdep.S +++ /dev/null @@ -1,50 +0,0 @@ -/* Static library error handling code fragment for Nios II. - Copyright (C) 2015-2020 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, see - . */ - -#include - -/* The following code is only used in the static library. In the shared - library, the error handling code is at the end of each function. */ - -#ifndef PIC - -/* In the static library, the syscall stubs jump here when they detect - an error. */ - -# undef CALL_MCOUNT -# define CALL_MCOUNT /* Don't insert the profiling call, it clobbers r2. */ - -# if IS_IN (libc) -# define SYSCALL_ERROR_ERRNO __libc_errno -# else -# define SYSCALL_ERROR_ERRNO errno -# endif - .text -ENTRY (__syscall_error) - nextpc r3 -1: - movhi r8, %hiadj(_gp_got - 1b) - addi r8, r8, %lo(_gp_got - 1b) - add r3, r3, r8 - ldw r3, %tls_ie(SYSCALL_ERROR_ERRNO)(r3) - add r3, r23, r3 - stw r2, 0(r3) - movi r2, -1 - ret -END (__syscall_error) -#endif diff --git a/sysdeps/unix/sysv/linux/nios2/sysdep.h b/sysdeps/unix/sysv/linux/nios2/sysdep.h index 520c9460a2..882762785b 100644 --- a/sysdeps/unix/sysv/linux/nios2/sysdep.h +++ b/sysdeps/unix/sysv/linux/nios2/sysdep.h @@ -19,6 +19,8 @@ #ifndef _LINUX_NIOS2_SYSDEP_H #define _LINUX_NIOS2_SYSDEP_H 1 +#define SYSCALL_ERROR_FUNC + #include #include #include