This is the mail archive of the 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: [PATCH] elf: Add tests with a local IFUNC resolver [BZ #23937]

* H. J. Lu:

> On Wed, Feb 20, 2019 at 4:53 AM Florian Weimer <> wrote:
>> The existing tests all use global symbols (but with different
>> visibility).  Local symbols could be treated differently by the
>> compiler and linker (as was the case on POWER ELFv2, causing
>> bug 23937), and we did not have test coverage for this.
>> Tested on x86-64 and POWER ELFv2 little-endian, with and without
>> --disable-multi-arch.  On POWER, the test cases elf/ifuncmain9,
>> elf/ifuncmain9pic, elf/ifuncmain9pie reproduce bug 23937 with older
>> binutils.
>> 2019-02-20  Florian Weimer  <>
>>         [BZ #23937]
>>         elf: Add test with a local IFUNC resolver.
>>         * elf/ifuncmain9.c: New file.
>>         * elf/ifuncmain9pic.c: Likewise.
>>         * elf/ifuncmain9picstatic.c: Likewise.
>>         * elf/ifuncmain9pie.c: Likewise.
>>         * elf/ifuncmain9static.c: Likewise.
>>         * elf/Makefile [multi-arch] (tests-ifuncstatic): Add
>>         ifuncmain9static, ifuncmain9picstatic.
>>         * elf/Makefile [multi-arch && build-shared] (tests-internal):
>>         Add ifuncmain9, ifuncmain9pic.
>>         * elf/Makefile [multi-arch && build-shared && have-fpie]
>>         (ifunc-pie-tests): Add ifuncmain9pie.
>>         (CFLAGS-ifuncmain9pic.c): Add $(pic-ccflag).
>>         (CFLAGS-ifuncmain9picstatic.c): Likewise.
>>         (CFLAGS-ifuncmain9pie.c): Add $(pie-ccflag).
> It isn't caused by your patch.  I am wondering why we don't run IFUNC
> tests with --disable-multi-arch.  Multi-arch requires IFUNC.  Does IFUNC
> require multi-arch?

Hah.  I wondered the same thing.  Yes, we can run IFUNC tests with
--disable-multi-arch if the toolchain supports IFUNCs.  For correctness,
--disable-multi-arch must not remove IFUNC support from the loader.

I do not know what the exact rules for IFUNC support in the loader are.
Logically, support cannot depend on whether the toolchain supports
IFUNCs because it's a property of the ABI.  Calling IFUNCs in the loader
should not require toolchain support, only internal use in glibc and
tests need it.


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