From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id D03703858C53 for ; Sat, 4 May 2024 12:26:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D03703858C53 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D03703858C53 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714825584; cv=none; b=VDW0ALXK3qBHzx6kN5Ue+o9DgfR5+nopwKymMT3i9uZxXKGqi8WO+SPMYBt3h6ilCP6/OGdM8w2NNqNv5wlRPJMa52nfb3AxiwbyxpcVvrSGlKpR3MOrFCLBwe4jO21AnNMKAC2aQTSJ9Dzzn+B2ot75GiEEwGtYn81c9i70M0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714825584; c=relaxed/simple; bh=TuN2jOyUB/z+xkc3sREdTUtNcJuUiuJ/lnlaM4xD4Ac=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=kkv206DrIkgJ1E9/YamqJ2RXN9OLDOvGS+2GG66fdQmtwDJOoBcm8yRA6RyAv1GIFbfpYjX0k1hVZo3MOqByDsT/KuRszdZnASJkvClO22PDexbW9nAUlj4oFPdIzt2co0Zaya28TJ1nVRwlJDJlmtwxPK2GPVW3fBVojGYaRVo= ARC-Authentication-Results: i=1; server2.sourceware.org From: Sam James To: libc-stable@sourceware.org Cc: Gabi Falk , Florian Weimer , "H . J . Lu" , "Dmitry V . Levin" Subject: [COMMITTED 2.39 1/3] i586: Fix multiple definitions of __memcpy_chk and __mempcpy_chk Date: Sat, 4 May 2024 13:26:04 +0100 Message-ID: <20240504122607.2559911-1-sam@gentoo.org> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Gabi Falk /home/bmg/install/compilers/x86_64-linux-gnu/lib/gcc/x86_64-glibc-linux-gnu/13.2.1/../../../../x86_64-glibc-linux-gnu/bin/ld: /home/bmg/build/glibcs/i586-linux-gnu/glibc/libc.a(memcpy_chk.o): in function `__memcpy_chk': /home/bmg/src/glibc/debug/../sysdeps/i386/memcpy_chk.S:29: multiple definition of `__memcpy_chk';/home/bmg/build/glibcs/i586-linux-gnu/glibc/libc.a(memcpy.o):/home/bmg/src/glibc/string/../sysdeps/i386/i586/memcpy.S:31: first defined here /home/bmg/install/compilers/x86_64-linux-gnu/lib/gcc/x86_64-glibc-linux-gnu/13.2.1/../../../../x86_64-glibc-linux-gnu/bin/ld: /home/bmg/build/glibcs/i586-linux-gnu/glibc/libc.a(mempcpy_chk.o): in function `__mempcpy_chk': /home/bmg/src/glibc/debug/../sysdeps/i386/mempcpy_chk.S:28: multiple definition of `__mempcpy_chk'; /home/bmg/build/glibcs/i586-linux-gnu/glibc/libc.a(mempcpy.o):/home/bmg/src/glibc/string/../sysdeps/i386/i586/memcpy.S:31: first defined here After this change, the static library built for i586, regardless of PIC options, contains implementations of these functions respectively from sysdeps/i386/memcpy_chk.S and sysdeps/i386/mempcpy_chk.S. This ensures that memcpy and mempcpy won't pull in __chk_fail and the routines it calls. Reported-by: Florian Weimer Signed-off-by: Gabi Falk Reviewed-by: H.J. Lu Reviewed-by: Dmitry V. Levin (cherry picked from commit 789894a2f554d4503ecb2f13b2b4e93e43414f33) --- sysdeps/i386/i586/memcpy.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/i386/i586/memcpy.S b/sysdeps/i386/i586/memcpy.S index 3e26f112d6..79856d498a 100644 --- a/sysdeps/i386/i586/memcpy.S +++ b/sysdeps/i386/i586/memcpy.S @@ -26,7 +26,7 @@ #define LEN SRC+4 .text -#if defined PIC && IS_IN (libc) +#if defined SHARED && IS_IN (libc) ENTRY (__memcpy_chk) movl 12(%esp), %eax cmpl %eax, 16(%esp) -- 2.45.0