From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10670 invoked by alias); 27 May 2018 14:36:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 10661 invoked by uid 89); 27 May 2018 14:36:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Florian, older, boot, florian X-HELO: mail-ot0-f170.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cFURyWd7fOVOnVPhzbi/Y+KZmUsUcHl+T+7guJmf860=; b=ReyvbEqQrSFQW/oaGKJg5kQP3ydBlQCjh09pP6PHy14+S+EwBOgimTGyUNINO73hx6 Oo4SxvBPqYzDrUGFhF5oRe0G3ePlZ2zu7C7+uJx/GWtJbO4lx97EdEZ9dAKivbZ9lBLF aASAHIgjkk+M7rSiDaBsPOuFuLMgn2uniL4OmOifQ6BPuBTQOOXFNTcG/sGD8+gVa5JV P8k8WGZ9/qzK1fIJpf9Yfrn0rh+sp1SmBmIZn//+7vDdY5hUJYASJXOBffXBBDXdXkt6 TLN+6CAf1Ks4JLWAccyJy2T+7j3gxSkoEnqJreuh8BhBlAjPNsYA3gOdQOz1mu4jevSL vvDQ== X-Gm-Message-State: ALKqPwepZu9pWk+ZOB4J1Q1kaWKKC0yBqdCHXNrv7gqzOidYWIsWBUVS y39Fd+jm9JPbAzRUbMTQyXkblbbSCFmgbz8Fj24= X-Google-Smtp-Source: ADUXVKI7HytMI0ZTpqssew+hOs3HVfqkboLKQ+HNI3OyiZk31Vbbw2mTsnStKnM7CAg9/aDlUerUDenddvmKq8Sij4g= X-Received: by 2002:a9d:441d:: with SMTP id u29-v6mr6871426ote.70.1527431764081; Sun, 27 May 2018 07:36:04 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20180526135209.GA23818@intel.com> From: "H.J. Lu" Date: Sun, 27 May 2018 14:36:00 -0000 Message-ID: Subject: Re: RFC: x86: Fall back to lazy binding for unrelocated IFUNC symbol [BZ #23240] To: Florian Weimer Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-05/txt/msg00837.txt.bz2 On Sat, May 26, 2018 at 2:02 PM, Florian Weimer 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.