[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Hurd: Enable ifunc by default

From: H.J. Lu
Subject: Re: [PATCH] Hurd: Enable ifunc by default
Date: Mon, 18 Jan 2021 16:17:16 -0800

On Mon, Jan 18, 2021 at 4:04 PM Samuel Thibault via Libc-alpha
<libc-alpha@sourceware.org> wrote:
> (leaving gcc out, it's really out of the story, it just happens to
> expose support for ifunc)
> Joseph Myers, le lun. 18 janv. 2021 20:05:44 +0000, a ecrit:
> > /scratch/jmyers/glibc-bot/install/compilers/i686-gnu/lib/gcc/i686-glibc-gnu/11.0.0/../../../../i686-glibc-gnu/bin/ld:
> >  
> > /scratch/jmyers/glibc-bot/build/compilers/i686-gnu/glibc/i686-gnu/elf/librtld.os:
> >  in function `hurd_file_name_lookup_retry':
> > (.text+0x1e08e): undefined reference to `strncpy'
> The story seems complex and related to the glibc rtld build rules.
> - We need hurd/lookup-retry.c in the rtld
> - It happens to use strncpy since ee11682d4f5 ("hurd: Fix strcpy calls")
> - strncpy happens to have a hidden def in libc
> - hurd/lookup-retry.os thus refers to __GI_strncpy rather than strncpy
> - dl-allobjs.os thus includes strncpy-c.os (that provides __GI_strncpy),
> and not strncpy.os (that provides strncpy)
> - librtld.map thus contains strncpy-c.os only, and not strncpy.os
> - thus no rtld-strncpy.os is getting built
> - thus strncpy is not available in rtld
> - but strncpy doesn't have a hidden def in rtld
> - and thus hurd/rtld-lookup-retry.os refers to strncpy, not __GI_strncpy
> - thus the link failure.
> The base issue I see here is that dl-allobjs is based on libc-built
> objects that might be using hidden defs while rtld-built objects might
> not.
> But we could also say that it's strncpy that should also have a hidden
> def in rtld. The attached patch does this, is this ok?

String function usage in ld.so must be carefully managed.  Why doesn't
hurd ld.so build script mark strncpy as needed?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]