From patchwork Fri Nov 13 16:58:35 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: 1399996 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=sourceware.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=SA6eyuMq; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CXl8r3rsXz9sSn for ; Sat, 14 Nov 2020 04:00:44 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D3C5D3947C05; Fri, 13 Nov 2020 16:59:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D3C5D3947C05 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605286759; 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=SA6eyuMqEaTzGyrVwsuFdW7YrTNswkUHkKkcsULqJulwb3XGEiUjO2Q00t0urDu4z x6+M8ojPtZiiJk7SOQIlVKa+EDzKWJwSgO0P5RxQeCbw4lntVXS8PnPEL/aY7KDdfH L8RvfKy4HCqUIj+oTjMefniBCDZDD8kogOUpJHLc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by sourceware.org (Postfix) with ESMTPS id AF4A139450F2 for ; Fri, 13 Nov 2020 16:59:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AF4A139450F2 Received: by mail-qv1-xf42.google.com with SMTP id g19so4919625qvy.2 for ; Fri, 13 Nov 2020 08:59:17 -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=MBiuo48jWUivtT72IMgi6y2CYtew2oGeFquskjxcitcwMTRjWZFTXB1IRSre5Ss+g3 61bB+hjr4pPxv0iPtDH52oVbci/jsIotr1CU+aX3FxkqwvJbLr/SlCOCsR4QwXGPWwke T6GBpASC/Q5rVnpWr+ek8urOYmRZTgQ0h0KMqut6edLBfXuB0qZ5SAnrpexskpRFDkAL mWzsGV0bzNCf0sCtUwhEzVEJYuN74WnZa3LpLP/WyltVECT/o14TIThLOQ92oS1Sw8KO GOb7V8bjP/sxBynhl4+yQg04kukuXqbvgbBj0qB2hZw/T/gAy/4t41cCM1EY750u6MHy ikww== X-Gm-Message-State: AOAM530PqglXFwxfpqNDMkUERe/qOUSFzHPlEz106lk8gw7KRi/0iRao yvUYNEE4Q673ag3By5L1bhkkby8hoJhTmw== X-Google-Smtp-Source: ABdhPJwjO0kYTEPQIa+iBaT64+mbADSb3OS7k5Lk7ZBL/1/a+pte5li7Wq6g/KTUDQyhYITAexUDOg== X-Received: by 2002:a05:6214:12ed:: with SMTP id w13mr3231466qvv.23.1605286752167; Fri, 13 Nov 2020 08:59:12 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id s16sm7363931qkg.5.2020.11.13.08.59.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 08:59:11 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 21/23] linux: Use generic __syscall_error for alpha Date: Fri, 13 Nov 2020 13:58:35 -0300 Message-Id: <20201113165837.121629-22-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.9 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 */