This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Remove unnecessary IFUNC dispatch for __memset_chk.
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Alexander Monakov <amonakov at ispras dot ru>
- Cc: OndÅej BÃlka <neleai at seznam dot cz>, Zack Weinberg <zackw at panix dot com>, Andreas Schwab <schwab at linux-m68k dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 17 Aug 2015 10:59:52 -0700
- Subject: Re: [PATCH] Remove unnecessary IFUNC dispatch for __memset_chk.
- Authentication-results: sourceware.org; auth=none
- References: <55C79AD8 dot 3070301 at panix dot com> <20150810211200 dot GA17734 at domone> <CAKCAbMia4RCA7X0YHYeXC6eAGCxzDqhWrMiGS4NxA-cDxFioVw at mail dot gmail dot com> <20150811080451 dot GA6280 at domone> <CAMe9rOpjYBG9vHPFmJNAPQ02fhq_F_ZqoNprVsAkGCS=ZHEpqQ at mail dot gmail dot com> <20150811190303 dot GA4134 at domone> <CAMe9rOqFYTSxDcDPocD7iMb7+F=mkMXhqgVg+RfjX35+KVw1hg at mail dot gmail dot com> <alpine dot LNX dot 2 dot 20 dot 1508112218480 dot 29573 at monopod dot intra dot ispras dot ru> <CAMe9rOp=zkYotu4DK5wDQpMRUtBiCFV+hwEcapCCYwzjL+SLvw at mail dot gmail dot com> <20150811203001 dot GD4134 at domone> <CAMe9rOos4HTn3VhgK44JnFo+95Ph5xzWQTheP1EpoCM7=8XeoQ at mail dot gmail dot com> <alpine dot LNX dot 2 dot 20 dot 1508171837140 dot 10765 at monopod dot intra dot ispras dot ru> <CAMe9rOqOvjFvstHnCzKs7mShAH=EiftzzdpstiW_i9ou7QMgCA at mail dot gmail dot com> <alpine dot LNX dot 2 dot 20 dot 1508171932010 dot 10765 at monopod dot intra dot ispras dot ru> <CAMe9rOprUnCei8i9X+eLoWCXA_sb5VY9m_x-3uYHpt4Cy+8YjQ at mail dot gmail dot com> <alpine dot LNX dot 2 dot 20 dot 1508171956100 dot 10765 at monopod dot intra dot ispras dot ru> <CAMe9rOr=s41ia=o1Q9bXpw0UvQ5DjW=Wk8r+teuC+05LXxoEpg at mail dot gmail dot com> <alpine dot LNX dot 2 dot 20 dot 1508172051410 dot 21925 at monopod dot intra dot ispras dot ru>
On Mon, Aug 17, 2015 at 10:53 AM, Alexander Monakov <amonakov@ispras.ru> wrote:
>> > Earlier you rejected the idea that a resolver can use an externally visible
>> > symbol. I just don't see why you say it might be non-deterministic. One
>> > can inspect the executable, LD_PRELOAD'ed modules, etc. to see whether they
>> > are going to provide an interposing definition of a symbol or not. What is
>> > non-deterministic in there?
>>
>> Due to the way how IFUNC is implemented, dependency on
>> external relocation may lead to undefined behavior. We tried
>> to support external relocations in IFUNC selector:
>>
>> https://sourceware.org/bugzilla/show_bug.cgi?id=13302
>>
>> But external relocation on function address returned by IFUNC
>> selector isn't supported.
>
> Isn't this an implementation deficiency that can be solved, for example, by
> sorting GLOB_DAT relocation appropriately, rather than a fundamental
> restriction that any reasonable implementation of IFUNC would exhibit?
We have no control over GLOB_DAT, which can be a relocation
against IFUNC symbol and we only know for sure at run-time.
--
H.J.