From patchwork Mon Nov 9 20:18:25 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: 41003 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 ABCC639730BC; Mon, 9 Nov 2020 20:19:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABCC639730BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1604953150; bh=4kfgwFK2CsGX4XwYSIb1SrYpPQBBQTe/aEPPiEsoHmQ=; 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=o9uHDY6XwAXG2aezbnBtazuHD7Mm4U6Cx4gHv4ObAfTzKm2h7pK/A0zaU+o7Aj8Xj BZ/iAXvH4vhhMBUhorn4dK/22fuUV4sv5DVsnO2+C/MIG3ZeKtg09oV2UfGe1o1Ayn becSAhpxp/A+xnCmoG0itER5Uk0MyDh42I3+2X5g= 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 E546039730A2 for ; Mon, 9 Nov 2020 20:19:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E546039730A2 Received: by mail-qt1-x843.google.com with SMTP id 7so2589482qtp.1 for ; Mon, 09 Nov 2020 12:19:06 -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=4kfgwFK2CsGX4XwYSIb1SrYpPQBBQTe/aEPPiEsoHmQ=; b=VQONt3W71mgNZMFrMVDrZkwU7IHuKIdYvxIcVGv8u6Oy0S34q3vc99TLAkBNGzV0GU BnyvMjwAZeZ5aVxiyuamaQ9cWietXii0GTnaqQlEAvoQ1w6VG6cNtWL/IL7LhnhBc3Yh cVvb2e0rxoo9q5a8jN8K/oIiBJjDl+NOH+t/9Lucw1o7697zAPfje8BIRNzJXsbjsgDJ 7NxC3nqVBpaLXmcsdkWH+KNU3ae3E8+b//m50JBQ1gl1ebYXHolqTvS32VXWAl6rBQ7L QPr88JPakfzMPpxE9w73ruBhKi2lT7/p7Qd2QinxIvYZq07opJqO7uzuMJVI46ubGnCD DMtg== X-Gm-Message-State: AOAM531Fnwmt85ynjKetU066snVxF3yPx+PIc2H2f2VVGmdF/cwAyo4M NV4ucVzuBEDelduUmJa32evyUwnhzNLcDg== X-Google-Smtp-Source: ABdhPJzrOrb8xuHukPfoPI9EKI+QbdnzI3GAd5HAwK4YPH8aC90EV7Sx83U7V7JcQNMcs4m6g6FFUg== X-Received: by 2002:ac8:ecb:: with SMTP id w11mr14693156qti.113.1604953146300; Mon, 09 Nov 2020 12:19:06 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id z2sm6843407qkl.22.2020.11.09.12.19.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 12:19:05 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 22/23] linux: Use generic __syscall_error for alpha Date: Mon, 9 Nov 2020 17:18:25 -0300 Message-Id: <20201109201826.120534-23-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=-14.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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" Alpha __syscall_error uses an optimization to avoid load de GP register and assumes small code size (-fpic). Its implementation is moved to arch-specific one (syscall_error_asm.S) to avoid rewritting the inline asm wrapper to call the generic __syscall_error. Checked on alpha-linux-gnu. --- sysdeps/unix/alpha/Makefile | 8 ++++++-- sysdeps/unix/alpha/rt-sysdep.S | 1 - sysdeps/unix/alpha/{sysdep.S => syscall_error_asm.S} | 8 ++++---- sysdeps/unix/sysv/linux/alpha/Makefile | 3 +-- sysdeps/unix/sysv/linux/alpha/sysdep.h | 4 ++-- 5 files changed, 13 insertions(+), 11 deletions(-) delete mode 100644 sysdeps/unix/alpha/rt-sysdep.S rename sysdeps/unix/alpha/{sysdep.S => syscall_error_asm.S} (94%) diff --git a/sysdeps/unix/alpha/Makefile b/sysdeps/unix/alpha/Makefile index 0660847f15..823ff2d90f 100644 --- a/sysdeps/unix/alpha/Makefile +++ b/sysdeps/unix/alpha/Makefile @@ -1,4 +1,8 @@ +ifeq ($(subdir),csu) +sysdep_routines += syscall_error_asm +endif + ifeq ($(subdir),rt) -librt-sysdep_routines += rt-sysdep -librt-shared-only-routines += rt-sysdep +librt-routines += syscall_error_asm +librt-shared-only-routines += syscall_error_asm endif diff --git a/sysdeps/unix/alpha/rt-sysdep.S b/sysdeps/unix/alpha/rt-sysdep.S deleted file mode 100644 index f966bf1e59..0000000000 --- a/sysdeps/unix/alpha/rt-sysdep.S +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/alpha/sysdep.S b/sysdeps/unix/alpha/syscall_error_asm.S similarity index 94% rename from sysdeps/unix/alpha/sysdep.S rename to sysdeps/unix/alpha/syscall_error_asm.S index 67968623ac..ddc86c56d6 100644 --- a/sysdeps/unix/alpha/sysdep.S +++ b/sysdeps/unix/alpha/syscall_error_asm.S @@ -35,9 +35,9 @@ #endif .align 4 - .globl __syscall_error - .ent __syscall_error -__syscall_error: + .globl __syscall_error_asm + .ent __syscall_error_asm +__syscall_error_asm: /* When building a shared library, we branch here without having loaded the GP. Nor, since it was a direct branch, have we loaded PV with our address. @@ -62,4 +62,4 @@ __syscall_error: stl t0, 0(t1) ret - .end __syscall_error + .end __syscall_error_asm diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile index 92484bbe65..20c673b644 100644 --- a/sysdeps/unix/sysv/linux/alpha/Makefile +++ b/sysdeps/unix/sysv/linux/alpha/Makefile @@ -31,8 +31,7 @@ libm-routines += multc3 divtc3 endif # math ifeq ($(subdir),nptl) -# pull in __syscall_error routine, sigaction stubs. -libpthread-routines += sysdep rt_sigaction +libpthread-routines += rt_sigaction libpthread-shared-only-routines += sysdep rt_sigaction endif diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep.h b/sysdeps/unix/sysv/linux/alpha/sysdep.h index 7daf445068..86bab2ed4c 100644 --- a/sysdeps/unix/sysv/linux/alpha/sysdep.h +++ b/sysdeps/unix/sysv/linux/alpha/sysdep.h @@ -102,14 +102,14 @@ $syscall_error: \ ret # define SYSCALL_ERROR_FALLTHRU #elif defined(PIC) -# define SYSCALL_ERROR_LABEL __syscall_error !samegp +# define SYSCALL_ERROR_LABEL __syscall_error_asm !samegp # define SYSCALL_ERROR_HANDLER # define SYSCALL_ERROR_FALLTHRU br SYSCALL_ERROR_LABEL #else # define SYSCALL_ERROR_LABEL $syscall_error # define SYSCALL_ERROR_HANDLER \ $syscall_error: \ - jmp $31, __syscall_error + jmp $31, __syscall_error_asm # define SYSCALL_ERROR_FALLTHRU #endif /* RTLD_PRIVATE_ERRNO */