From patchwork Mon Nov 9 20:18:10 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: 40986 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 4CD3B397280B; Mon, 9 Nov 2020 20:18:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4CD3B397280B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1604953128; bh=N28nCWgD7hZNuYhY9dw+EmsJ9hSktJ3CliMvRNs2LMw=; 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=pwC5sesVey1bPwkOYhW4FS+qul5uL0jImYTRXy8Ajd5rZphWLGMtlBSId6QNs5t8o i/p64f9+4AkT7YicvIcZRSwEzGmd2wlAMstALagPtv1sUHjPBpO8hmedKU+zB3npfi myZjcTVLsWbHeZnXG/Qfu8L4VVdatC2CX9Mh31bs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by sourceware.org (Postfix) with ESMTPS id B3AB739724AB for ; Mon, 9 Nov 2020 20:18:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B3AB739724AB Received: by mail-qt1-x841.google.com with SMTP id j31so6951811qtb.8 for ; Mon, 09 Nov 2020 12:18:45 -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=N28nCWgD7hZNuYhY9dw+EmsJ9hSktJ3CliMvRNs2LMw=; b=ZEXJd6B97m5ayss0HimuZkqpkpPez3jD+w3JhHTXUQ3cNnWrdhQ39uaJsr3LrOLT4S R6MGe1lkaHcLM5VbcFp+a9tGp4j9RwVr6EyLovA/GDc3pSAoEaMmidXv0CBme7g+CtBP eBd3WSJAXSSN8ps/2zgARc/CLCvcKxPvdU/JmRb/HUjSoEr46CZfyi4He6NbThxBj8gl QR0AzARADeQMQvNX40nwgGAVR2xOUNMNNpX5jSGYFo137etb99EUXKWTSFBosceg1hGM 7Zw7iLvsjWqYD4Y3hEXCjjfhwHuK+aXB0plP52H/9YuT/pR8CGw9yLoLCWwAa1j1K0J+ 5d9A== X-Gm-Message-State: AOAM533KVX+ZmtL9q9FnB2Xqz6kxm8JwoxtIKqBXV5x04myA/7VkdoPH BVjXzebQd3sHCq1Zj2iM1Igl7VFntTJNvA== X-Google-Smtp-Source: ABdhPJyV+eA8krKvtwADjNF2APX4VqQQciV/s1eof9/7LamjE4SITTuTPOSPZs0UDDPhEg+eJni0Kg== X-Received: by 2002:ac8:5653:: with SMTP id 19mr10876460qtt.136.1604953125058; Mon, 09 Nov 2020 12:18:45 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id z2sm6843407qkl.22.2020.11.09.12.18.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 12:18:44 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 07/23] linux: Use generic __syscall_error for i386 Date: Mon, 9 Nov 2020 17:18:10 -0300 Message-Id: <20201109201826.120534-8-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 auto-generated syscalls calls the __syscall_error, and for i686 it results in much less compat code: --- sizes-i686-linux-gnu.outline +++ sizes-i686-linux-gnu.inline text data bss dec hex filename -1933727 11324 10172 1955223 1dd597 libc.so - 175366 4768 184 180318 2c05e elf/ld.so - 109851 832 8408 119091 1d133 nptl/libpthread.so - 27983 628 184 28795 707b rt/librt.so +1937875 11324 10172 1959371 1de5cb libc.so + 175790 4768 184 180742 2c206 elf/ld.so + 110179 832 8408 119419 1d27b nptl/libpthread.so + 28139 628 184 28951 7117 rt/librt.so This patch enabled SYSCALL_ERROR_FUNC with the expected abi by also defining SYSCALL_ERROR_FUNC_ATTR. Checked on i686-linux-gnu. --- sysdeps/unix/sysv/linux/i386/Makefile | 13 ------------ sysdeps/unix/sysv/linux/i386/sysdep.c | 29 --------------------------- sysdeps/unix/sysv/linux/i386/sysdep.h | 3 +++ 3 files changed, 3 insertions(+), 42 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/i386/sysdep.c diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile index da716e2c1b..983b02e081 100644 --- a/sysdeps/unix/sysv/linux/i386/Makefile +++ b/sysdeps/unix/sysv/linux/i386/Makefile @@ -28,22 +28,9 @@ gen-as-const-headers += ucontext_i.sym endif ifeq ($(subdir),csu) -sysdep-dl-routines += sysdep ifeq (yes,$(build-shared)) sysdep_routines += divdi3 shared-only-routines += divdi3 CPPFLAGS-divdi3.c = -Din_divdi3_c endif endif - -ifeq ($(subdir),nptl) -# pull in __syscall_error routine -libpthread-routines += sysdep -libpthread-shared-only-routines += sysdep -endif - -ifeq ($(subdir),rt) -# pull in __syscall_error routine -librt-routines += sysdep -librt-shared-only-routines += sysdep -endif diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.c b/sysdeps/unix/sysv/linux/i386/sysdep.c deleted file mode 100644 index e6228406dd..0000000000 --- a/sysdeps/unix/sysv/linux/i386/sysdep.c +++ /dev/null @@ -1,29 +0,0 @@ -/* 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 - -/* This routine is jumped to by all the syscall handlers, to stash - an error number into errno. ERROR is the negative error number - returned from the x86 kernel. */ -int -__attribute__ ((__regparm__ (1))) -__syscall_error (int error) -{ - __set_errno (-error); - return -1; -} diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index 4680013de4..977dc1ab42 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -19,6 +19,9 @@ #ifndef _LINUX_I386_SYSDEP_H #define _LINUX_I386_SYSDEP_H 1 +#define SYSCALL_ERROR_FUNC +#define SYSCALL_ERROR_FUNC_ATTR __attribute__ ((__regparm__ (1))) + /* There is some commonality. */ #include #include