From patchwork Wed Jul 12 09:36:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 1806739 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.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=pTU7M6Ae; dkim-atps=neutral Received: from server2.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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R1CLq2ydXz20bt for ; Wed, 12 Jul 2023 19:37:07 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6D23A3857838 for ; Wed, 12 Jul 2023 09:37:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D23A3857838 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689154625; bh=WE2zN/adam2oHHGADG8Th+IBPCM3ONY05V+7AjtkG30=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=pTU7M6AetyQuV6ewlOVFkbeWfRAceG/RD009yAHQ7AAH3uo7/zSHwpJTQh0C4G/3D 4lJrprrhlmNXCfdKHZcYsumOTsHrKryMdu18nMWbOAzkEEt0KUtqvx9PNL5IQ5BMUM FrYQdmMc1x2aP2CDlgSOGTCWUmKxnyAXhurnNJDA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id AA6A93857B98 for ; Wed, 12 Jul 2023 09:36:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AA6A93857B98 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id BC7402259F for ; Wed, 12 Jul 2023 09:36:05 +0000 (UTC) Received: from hawking.nue2.suse.org (unknown [10.168.4.11]) by relay2.suse.de (Postfix) with ESMTP id AF5482C142 for ; Wed, 12 Jul 2023 09:36:05 +0000 (UTC) Received: by hawking.nue2.suse.org (Postfix, from userid 17005) id 9C8324AAD7A; Wed, 12 Jul 2023 11:36:05 +0200 (CEST) To: libc-alpha@sourceware.org Subject: [PATCH] i386: make debug wrappers compatible with static PIE X-Yow: Let's go to CHURCH! Date: Wed, 12 Jul 2023 11:36:05 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Andreas Schwab via Libc-alpha From: Andreas Schwab Reply-To: Andreas Schwab Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" Static PIE requires the use of PLT relocation. Reviewed-by: Siddhesh Poyarekar --- sysdeps/i386/memcpy_chk.S | 4 ++-- sysdeps/i386/memmove_chk.S | 4 ++-- sysdeps/i386/mempcpy_chk.S | 4 ++-- sysdeps/i386/memset_chk.S | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sysdeps/i386/memcpy_chk.S b/sysdeps/i386/memcpy_chk.S index 7b12c12aba..1676de4fff 100644 --- a/sysdeps/i386/memcpy_chk.S +++ b/sysdeps/i386/memcpy_chk.S @@ -28,8 +28,8 @@ ENTRY (__memcpy_chk) movl 12(%esp), %eax cmpl %eax, 16(%esp) - jb __chk_fail - jmp memcpy + jb HIDDEN_JUMPTARGET (__chk_fail) + jmp JUMPTARGET (memcpy) END (__memcpy_chk) libc_hidden_builtin_def (__memcpy_chk) #endif diff --git a/sysdeps/i386/memmove_chk.S b/sysdeps/i386/memmove_chk.S index 604aea8305..785b27373b 100644 --- a/sysdeps/i386/memmove_chk.S +++ b/sysdeps/i386/memmove_chk.S @@ -27,8 +27,8 @@ ENTRY (__memmove_chk) movl 12(%esp), %eax cmpl %eax, 16(%esp) - jb __chk_fail - jmp memmove + jb HIDDEN_JUMPTARGET (__chk_fail) + jmp JUMPTARGET (memmove) END (__memmove_chk) libc_hidden_builtin_def (MEMMOVE_CHK) #endif diff --git a/sysdeps/i386/mempcpy_chk.S b/sysdeps/i386/mempcpy_chk.S index 276eab1e8a..f58ca96e16 100644 --- a/sysdeps/i386/mempcpy_chk.S +++ b/sysdeps/i386/mempcpy_chk.S @@ -27,8 +27,8 @@ ENTRY (__mempcpy_chk) movl 12(%esp), %eax cmpl %eax, 16(%esp) - jb __chk_fail - jmp __mempcpy + jb HIDDEN_JUMPTARGET (__chk_fail) + jmp HIDDEN_JUMPTARGET (__mempcpy) END (__mempcpy_chk) libc_hidden_builtin_def (__mempcpy_chk) #endif diff --git a/sysdeps/i386/memset_chk.S b/sysdeps/i386/memset_chk.S index a2e9208e1c..9901ca6d52 100644 --- a/sysdeps/i386/memset_chk.S +++ b/sysdeps/i386/memset_chk.S @@ -27,8 +27,8 @@ ENTRY (__memset_chk) movl 12(%esp), %eax cmpl %eax, 16(%esp) - jb __chk_fail - jmp memset + jb HIDDEN_JUMPTARGET (__chk_fail) + jmp JUMPTARGET (memset) END (__memset_chk) libc_hidden_builtin_def (__memset_chk) #endif