From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91540 invoked by alias); 17 Sep 2019 02:43:16 -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 91530 invoked by uid 89); 17 Sep 2019 02:43:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=sorts, kim, HX-Languages-Length:733, our X-HELO: mx1.redhat.com From: Florian Weimer To: Juchan Kim Cc: "libc-alpha\@sourceware.org" Subject: Re: [Question] ifunc odering in ELF References: <1568314984.28076.65.camel@blackberry.com> Date: Tue, 17 Sep 2019 02:43:00 -0000 In-Reply-To: <1568314984.28076.65.camel@blackberry.com> (Juchan Kim's message of "Thu, 12 Sep 2019 19:03:04 +0000") Message-ID: <87pnjzy75u.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2019-09/txt/msg00233.txt.bz2 * Juchan Kim: > We have two ifuncs foo1 and foo2 in our library > > foo1 has foo1_resolver()=C2=A0 > foo2 has foo2_resolver() > > > foo1_resolver() { > ... > } > > foo2_resolver() { > foo1() > ... > } IFUNC resolvers must not depend on run-time relocations. If you follow that rule, this cannot happen. binutils ld sorts IFUNC relocations last, which helps, but to cover more cases (but not all of them), run-time reordering of relocations is needed. We have some patches for that, but my impression is that the glibc project does not want them. Instead, we're probably going to remove all IFUNC resolvers with relocation dependencies from glibc, and tell others to do so as well. Thanks, Florian