From patchwork Mon Nov 9 20:18:11 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: 40988 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 63CD93973056; Mon, 9 Nov 2020 20:18:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63CD93973056 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1604953129; bh=++HMeDOAkSjxgUePLEy5rvM6XJSAqf0j2oVe+EF/HOI=; 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=kMyqo6eQ+6/CaRgCLpZyYMyLQXSOQVKkQeWL9iThMrNB7mM2edSJEcTvoLN0gxCtP TMXbaRxKXny5ujiqz4mpJVmUpa/Cy5dy9lob0l02oBL1MICMq6pssR8aERXiphPzrJ KdqoClD3UbhxelqxP7cOhq2+rmrVBHYr/rD5MNoU= 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 57BC73973008 for ; Mon, 9 Nov 2020 20:18:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 57BC73973008 Received: by mail-qt1-x844.google.com with SMTP id n63so6971236qte.4 for ; Mon, 09 Nov 2020 12:18:47 -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=++HMeDOAkSjxgUePLEy5rvM6XJSAqf0j2oVe+EF/HOI=; b=UE6zsqwAH+yIFuqMY95SFZEGRykVmxFtlcKGM+vMPRRidpxNFrsSsljRRr0GYfkXKW HdCdZIgn7dNYcxDatqkO4fyPOFupX91Pq2W26N0zjTEt1/2Oc0reuH3wxSOoZd1GelFL SSYQv8k19vOwwtvuObpb5IaD2gj9zA4EKxZemZ301yG33iJ/wXZTI7GzrtYoOd/7b5DJ ScblNALOtJyj64iMgXRZRdPPfLT0JSkCToZ9Mc1LyZHsXSYS31bYNUNvwwoNgXzsRKIJ i+spe8XBBnaNGGrq0PP6QDLZ6qOLf1nGc6++3IkFXVo1kT6qGT8DqnW4pPI1NtkkrzHh urIQ== X-Gm-Message-State: AOAM531EWTyYL6ULa5ctvQqhgGXsI74cTYCrkynNXa0pJYA+18r4uyWU YXcWd3gJjIw3gJR+pGjUVZsOgsiU0p3XQQ== X-Google-Smtp-Source: ABdhPJyppIeVBM1YHTx9c5dwaXuXNjelZjL1FpTz5J7dnLPhKqMnqz1j/WI3sUKFT6mgZDQ8osoW9Q== X-Received: by 2002:ac8:3890:: with SMTP id f16mr15066841qtc.372.1604953126676; Mon, 09 Nov 2020 12:18:46 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id z2sm6843407qkl.22.2020.11.09.12.18.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 12:18:45 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 08/23] linux: Use generic __syscall_error for arc Date: Mon, 9 Nov 2020 17:18:11 -0300 Message-Id: <20201109201826.120534-9-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.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 Netto 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 --- sysdeps/unix/sysv/linux/arc/sysdep.c | 33 ---------------------------- sysdeps/unix/sysv/linux/arc/sysdep.h | 14 +++--------- 3 files changed, 3 insertions(+), 47 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/arc/sysdep.c 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/sysdep.c deleted file mode 100644 index fe904d723b..0000000000 --- a/sysdeps/unix/sysv/linux/arc/sysdep.c +++ /dev/null @@ -1,33 +0,0 @@ -/* ARC wrapper for setting errno. - Copyright (C) 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 - -extern long int __syscall_error (long int); -libc_hidden_proto (__syscall_error) - -/* 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) diff --git a/sysdeps/unix/sysv/linux/arc/sysdep.h b/sysdeps/unix/sysv/linux/arc/sysdep.h index 4ab44f6925..9e43399f1e 100644 --- a/sysdeps/unix/sysv/linux/arc/sysdep.h +++ b/sysdeps/unix/sysv/linux/arc/sysdep.h @@ -19,6 +19,8 @@ #ifndef _LINUX_ARC_SYSDEP_H #define _LINUX_ARC_SYSDEP_H 1 +#define SYSCALL_ERROR_FUNC + #include #include @@ -103,22 +105,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 \