This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: x86: Fall back to lazy binding for unrelocated IFUNC symbol [BZ #23240]


On Sat, May 26, 2018 at 2:02 PM, Florian Weimer <fweimer@redhat.com> wrote:
> On 05/26/2018 03:52 PM, H.J. Lu wrote:
>>
>> +             /* NB: The symbol reference is resolved to IFUNC symbol
>> +                from a shared object which hasn't been relocated yet.
>> +                Relocate the GOT entry to enable lazy binding.  */
>> +             value = map->l_addr + *reloc_addr;
>> +             /* Disable RELRO so that the GOT entry can updated by lazy
>> +                binding later.  */
>> +             if (map->l_info[DT_BIND_NOW] != NULL)
>> +               map->l_relro_size = 0;
>
>
> People perceive BIND_NOW as a security feature.  Silently disabling it in
> this way, perhaps due to an implementation change in another shared object,
> looks very wrong to me.

Sounds reasonable/

> Maybe you could share the *concrete* problem you are actually trying to
> solve?

I  am working on the CPU run-time library for C, which is on hjl/cpu-rt/master
branch at

https://github.com/hjl-tools/glibc

The goal is to make the latest x86-64 string/memory functions in glibc
available to the distros with older glibcs.  libcpu-rt-c.so doesn't requre
dynamic relocations and is binary compatible with all x86-64 libc.so.
One can use

# export LD_PRELOAD=..../libcpu-rt-c.so

to use the latest x86-64 string/memory functions.  But I got

[hjl@gnu-cfl-1 cpu-rt-c]$ LD_PRELOAD=./libcpu-rt-c.so ls /
ls: Relink `/lib64/libpthread.so.0' with `./libcpu-rt-c.so' for IFUNC
symbol `strlen'
ls: Relink `/lib64/libpthread.so.0' with `./libcpu-rt-c.so' for IFUNC
symbol `strchr'
ls: Relink `/lib64/libpthread.so.0' with `./libcpu-rt-c.so' for IFUNC
symbol `memset'
ls: Relink `/lib64/libpthread.so.0' with `./libcpu-rt-c.so' for IFUNC
symbol `strcmp'
ls: Relink `/lib64/libpthread.so.0' with `./libcpu-rt-c.so' for IFUNC
symbol `memcpy'
ls: Relink `/lib64/libdl.so.2' with `./libcpu-rt-c.so' for IFUNC symbol `strcpy'
ls: Relink `/lib64/libpcre2-8.so.0' with `./libcpu-rt-c.so' for IFUNC
symbol `strlen'
ls: Relink `/lib64/libpcre2-8.so.0' with `./libcpu-rt-c.so' for IFUNC
symbol `strchr'
ls: Relink `/lib64/libpcre2-8.so.0' with `./libcpu-rt-c.so' for IFUNC
symbol `memset'
ls: Relink `/lib64/libpcre2-8.so.0' with `./libcpu-rt-c.so' for IFUNC
symbol `memchr'
ls: Relink `/lib64/libpcre2-8.so.0' with `./libcpu-rt-c.so' for IFUNC
symbol `memcmp'
ls: Relink `/lib64/libpcre2-8.so.0' with `./libcpu-rt-c.so' for IFUNC
symbol `memcpy'
ls: Relink `/lib64/libpcre2-8.so.0' with `./libcpu-rt-c.so' for IFUNC
symbol `memmove'
ls: Relink `/lib64/libcap.so.2' with `./libcpu-rt-c.so' for IFUNC
symbol `strlen'
ls: Relink `/lib64/libcap.so.2' with `./libcpu-rt-c.so' for IFUNC
symbol `memset'
ls: Relink `/lib64/libcap.so.2' with `./libcpu-rt-c.so' for IFUNC
symbol `memcpy'
ls: Relink `/lib64/libselinux.so.1' with `./libcpu-rt-c.so' for IFUNC
symbol `strncpy'
ls: Relink `/lib64/libselinux.so.1' with `./libcpu-rt-c.so' for IFUNC
symbol `strncmp'
ls: Relink `/lib64/libselinux.so.1' with `./libcpu-rt-c.so' for IFUNC
symbol `strcpy'
ls: Relink `/lib64/libselinux.so.1' with `./libcpu-rt-c.so' for IFUNC
symbol `strlen'
ls: Relink `/lib64/libselinux.so.1' with `./libcpu-rt-c.so' for IFUNC
symbol `strchr'
ls: Relink `/lib64/libselinux.so.1' with `./libcpu-rt-c.so' for IFUNC
symbol `strrchr'
ls: Relink `/lib64/libselinux.so.1' with `./libcpu-rt-c.so' for IFUNC
symbol `memset'
ls: Relink `/lib64/libselinux.so.1' with `./libcpu-rt-c.so' for IFUNC
symbol `memcmp'
ls: Relink `/lib64/libselinux.so.1' with `./libcpu-rt-c.so' for IFUNC
symbol `strcmp'
ls: Relink `/lib64/libselinux.so.1' with `./libcpu-rt-c.so' for IFUNC
symbol `memcpy'
bin   dev  export  lib    libx32      media  mnt  opt   root  sbin  sys  usr
boot  etc  home    lib64  lost+found  misc   net  proc  run   srv   tmp  var
[hjl@gnu-cfl-1 cpu-rt-c]$

I'd like to avoid these messages.

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]