From patchwork Fri Nov 13 16:58:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 41055 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 AD2CC39450F4; Fri, 13 Nov 2020 16:59:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD2CC39450F4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605286741; bh=G55LUaoorN8z5ckcfr0DxIlqORlmUd3ZXyKja7ArvF0=; 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=mq8qVnIqRfVlnc6e9KvtpIBdoYgZ2VRJLfP4fHR23ppYTZoDtCPHqb6aEllqF4APE HyFwSXe2Arws4lVKbvxpXhZk8FA970Ebv49Xy6k54eC9eXBAfNNKNbMejx8v/C7LAw 5K3ufnDlpYezbu1tdNKsr+F8vjOFtJSxl7tiuifI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by sourceware.org (Postfix) with ESMTPS id 1EB1B39450ED for ; Fri, 13 Nov 2020 16:58:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1EB1B39450ED Received: by mail-qt1-x843.google.com with SMTP id n63so7126317qte.4 for ; Fri, 13 Nov 2020 08:58:58 -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=G55LUaoorN8z5ckcfr0DxIlqORlmUd3ZXyKja7ArvF0=; b=g1FD/6loTG+uAy0zut/O1x1HqMa/adSDfKGpvCHyDNsdQWHxHbh1ZMb9j+q7sF3CJQ hcmxG8OvzEF9ICOgEZFcuXLXHXBnKx+46Kw7vuGYvmPRHnU1zkWKld8mZKeui5Zo8CuK RP5flbE9qA7A1NHC7qlb1Sww+TQpNQov5EFKFtTT5BVZOo6wKn82mHkyyKsOdhWmnqnr iAFVfQ4bnfZBlkJyW/3V5bST33R4XoszAIF5gVcG8GTtfof31Sal7n4mK5jYotVpdXyh AA507+RvPmMtxNp0OdhmEwCpl/NLCdeAApSkAtdbSKJW/bU/0jJOud1T+B/lgUfz+umB vzBA== X-Gm-Message-State: AOAM530BpmVZ+FbpbYCbhGDC1MAd3W8qSe/vvBZrwUS33pH8UEcFQdXk LFd1iOgpGEOirtDGlsCMk/TRXA4wzmcxWQ== X-Google-Smtp-Source: ABdhPJw5gmGJ8lTlTw1BvT7Ghzf10RErJdyaXfldshEOIv89t/OTzWRz02WHoByNDzlHQdPVoXMlUA== X-Received: by 2002:ac8:4250:: with SMTP id r16mr2946821qtm.225.1605286732561; Fri, 13 Nov 2020 08:58:52 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id s16sm7363931qkg.5.2020.11.13.08.58.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 08:58:52 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 07/23] linux: Use generic __syscall_error for arc Date: Fri, 13 Nov 2020 13:58:21 -0300 Message-Id: <20201113165837.121629-8-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=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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" Moving to intra DSO calls generates slight better code and avoid a GLIBC_PRIVATE symbol (only librt increases because it issues syscalls only in specific places). --- sizes-arc-linux-gnuhf.before +++ sizes-arc-linux-gnuhf.after text data bss dec hex filename - 962196 9400 8116 979712 ef300 libc.so - 110145 3724 192 114061 1bd8d elf/ld.so - 75099 796 8348 84243 14913 nptl/libpthread.so - 18882 600 156 19638 4cb6 rt/librt.so + 961186 9400 8116 978702 eef0e libc.so + 109745 3724 192 113661 1bbfd elf/ld.so + 75463 796 8348 84607 14a7f nptl/libpthread.so + 18704 596 156 19456 4c00 rt/librt.so Checked with build for arc-linux-gnuabihf. --- sysdeps/arc/Versions | 3 --- .../linux/arc/{sysdep.c => syscall_error.h} | 20 ++++++------------- sysdeps/unix/sysv/linux/arc/sysdep.h | 12 +---------- 3 files changed, 7 insertions(+), 28 deletions(-) rename sysdeps/unix/sysv/linux/arc/{sysdep.c => syscall_error.h} (67%) diff --git a/sysdeps/arc/Versions b/sysdeps/arc/Versions index 6ac7b8e495..ff157421a5 100644 --- a/sysdeps/arc/Versions +++ b/sysdeps/arc/Versions @@ -2,7 +2,4 @@ libc { GLIBC_2.32 { __mcount; } - GLIBC_PRIVATE { - __syscall_error; - } } diff --git a/sysdeps/unix/sysv/linux/arc/sysdep.c b/sysdeps/unix/sysv/linux/arc/syscall_error.h similarity index 67% rename from sysdeps/unix/sysv/linux/arc/sysdep.c rename to sysdeps/unix/sysv/linux/arc/syscall_error.h index fe904d723b..a45e02dbe4 100644 --- a/sysdeps/unix/sysv/linux/arc/sysdep.c +++ b/sysdeps/unix/sysv/linux/arc/syscall_error.h @@ -1,4 +1,4 @@ -/* ARC wrapper for setting errno. +/* Linux wrappers for setting errno. AArch64 version. Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,18 +16,10 @@ License along with the GNU C Library; if not, see . */ -#include +#ifndef _SYSCALL_ERROR_H +#define _SYSCALL_ERROR_H -extern long int __syscall_error (long int); -libc_hidden_proto (__syscall_error) +#define SYSCALL_ERROR_FUNC 1 +#define SYSCALL_ERROR_FUNC_ATTR -/* All syscall handlers land here to avoid generated code bloat due to - GOT reference to errno_location or it's equivalent. */ -long int -__syscall_error (long int err_no) -{ - __set_errno (-err_no); - return -1; -} - -libc_hidden_def (__syscall_error) +#endif diff --git a/sysdeps/unix/sysv/linux/arc/sysdep.h b/sysdeps/unix/sysv/linux/arc/sysdep.h index 4ab44f6925..7b36b72963 100644 --- a/sysdeps/unix/sysv/linux/arc/sysdep.h +++ b/sysdeps/unix/sysv/linux/arc/sysdep.h @@ -103,22 +103,12 @@ # define PSEUDO_END_ERRVAL(name) \ END (name) - -/* To reduce the code footprint, we confine the actual errno access - to single place in __syscall_error(). - This takes raw kernel error value, sets errno and returns -1. */ -# if IS_IN (libc) -# define CALL_ERRNO_SETTER_C bl PLTJMP(HIDDEN_JUMPTARGET(__syscall_error)) -# else -# define CALL_ERRNO_SETTER_C bl PLTJMP(__syscall_error) -# endif - # define SYSCALL_ERROR_HANDLER \ L (call_syscall_err): ASM_LINE_SEP \ push_s blink ASM_LINE_SEP \ cfi_adjust_cfa_offset (4) ASM_LINE_SEP \ cfi_rel_offset (blink, 0) ASM_LINE_SEP \ - CALL_ERRNO_SETTER_C ASM_LINE_SEP \ + bl __syscall_error ASM_LINE_SEP \ pop_s blink ASM_LINE_SEP \ cfi_adjust_cfa_offset (-4) ASM_LINE_SEP \ cfi_restore (blink) ASM_LINE_SEP \