This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] Add an x86 IFUNC testcase for [BZ #20019]
On Tue, Oct 4, 2016 at 2:27 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Tue, 4 Oct 2016, H.J. Lu wrote:
>
>> If an IFUNC function is called before the providing shared library is
>> unrelocated, ld.so may segfault. Add a testcase to verify that ld.so
>> will issue a diagnostic and won't segfault in this case.
>>
>> Tested on i686 and x86-64. OK for master?
>
> I can't see anything x86-specific about these tests. If they are meant to
> work, they should work on all architectures, and so should be
> architecture-independent. Is the architecture-specific thing the use of
> memmove as a function that uses IFUNCs? If so, the tests should still
> work on other architectures, just maybe be less effective as tests (and
> other architecture maintainers could always add a hook to use another
> function instead of memmove).
The result of this test is IFUNC implementation specific. The older
x86 IFUNC implementation had
# define INIT_ARCH() \
do \
if (__cpu_features.kind == arch_kind_unknown) \
__init_cpu_features (); \
while (0)
The new implementation assumed that relocations in libc.so were
processed first. It is hard for me to tell if other IFUNC implementations
have the similar restriction.
> If you suspect other architectures might have similar bugs requiring fixes
> for these tests to pass but don't want to make such changes yourself, you
> should follow the usual process for changes made only for some
> architectures: post a detailed description of how to tell whether the
> change is needed for your architecture and how to make the change, CC: to
> the relevant architecture maintainers, and add an entry to
> https://sourceware.org/glibc/wiki/PortStatus (once the x86 changes are
> in), listing the possibly affected (i.e. IFUNC-supporting?) architectures
> on that page.
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
--
H.J.