public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Gabi Falk <gabifalk@gmx.com>
Cc: libc-alpha@sourceware.org, Florian Weimer <fweimer@redhat.com>,
	 "Dmitry V. Levin" <ldv@altlinux.org>, Sam James <sam@gentoo.org>
Subject: Re: [PATCH 1/3] i586: Fix multiple definitions of __memcpy_chk and __mempcpy_chk
Date: Tue, 30 Apr 2024 13:11:35 -0700	[thread overview]
Message-ID: <CAMe9rOrobAKsGFHMLWzPuzBS0arMc_YkvQGPU1yKafsz3S06Lg@mail.gmail.com> (raw)
In-Reply-To: <20240430200506.2717717-2-gabifalk@gmx.com>

On Tue, Apr 30, 2024 at 1:05 PM Gabi Falk <gabifalk@gmx.com> wrote:
>
> /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 <fweimer@redhat.com>
> Signed-off-by: Gabi Falk <gabifalk@gmx.com>
> ---
>  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)
> --
> gabi
>

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.

-- 
H.J.

  reply	other threads:[~2024-04-30 20:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 20:05 [PATCH 0/3] i586/i686: Fix multiple definitions in libc.a Gabi Falk
2024-04-30 20:05 ` [PATCH 1/3] i586: Fix multiple definitions of __memcpy_chk and __mempcpy_chk Gabi Falk
2024-04-30 20:11   ` H.J. Lu [this message]
2024-04-30 20:05 ` [PATCH 2/3] i686: Fix multiple definitions of __memmove_chk and __memset_chk Gabi Falk
2024-04-30 20:12   ` H.J. Lu
2024-04-30 20:05 ` [PATCH 3/3] Add a test to check for duplicate definitions in the static library Gabi Falk
2024-04-30 20:12   ` H.J. Lu
2024-05-01  0:01 ` [PATCH 0/3] i586/i686: Fix multiple definitions in libc.a Dmitry V. Levin
2024-05-02 10:52 ` Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMe9rOrobAKsGFHMLWzPuzBS0arMc_YkvQGPU1yKafsz3S06Lg@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=gabifalk@gmx.com \
    --cc=ldv@altlinux.org \
    --cc=libc-alpha@sourceware.org \
    --cc=sam@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).