unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <Szabolcs.Nagy@arm.com>
To: Florian Weimer <fweimer@redhat.com>, "H.J. Lu" <hjl.tools@gmail.com>
Cc: nd <nd@arm.com>, GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] elf: Add tests with a local IFUNC resolver [BZ #23937]
Date: Wed, 20 Feb 2019 14:01:10 +0000	[thread overview]
Message-ID: <73e309e8-6ec4-01fb-7cc1-f4af4df56693@arm.com> (raw)
In-Reply-To: <87imxeeggo.fsf@oldenburg2.str.redhat.com>

On 20/02/2019 13:29, Florian Weimer wrote:
> * H. J. Lu:
> 
>> On Wed, Feb 20, 2019 at 4:53 AM Florian Weimer <fweimer@redhat.com> 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  <fweimer@redhat.com>
>>>
>>>         [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.

gcc rejects __attribute__((ifunc( ))) if the compiler
was not configured with --enable-gnu-indirect-function
(which i think is not default on some targets e.g. arm)

(i think gcc should just handle the attribute and
emit the gas directive if there is gas support anyway,
and the configure flag should only affect target libs
in gcc that use ifunc like libatomic)


  reply	other threads:[~2019-02-20 14:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-20 12:53 [PATCH] elf: Add tests with a local IFUNC resolver [BZ #23937] Florian Weimer
2019-02-20 13:16 ` H.J. Lu
2019-02-20 13:29   ` Florian Weimer
2019-02-20 14:01     ` Szabolcs Nagy [this message]
2019-02-27 10:27 ` Florian Weimer
2019-03-01  0:50   ` Rafal Luzynski
2019-03-01  1:52     ` H.J. Lu
2019-03-01  8:25       ` Rafal Luzynski
2019-03-01  8:41         ` Florian Weimer
2019-03-01 11:03           ` Rafal Luzynski
2019-03-01 12:37             ` H.J. Lu
2019-03-02  0:34               ` Rafal Luzynski
2019-03-02 16:54                 ` H.J. Lu
2019-03-04  9:47                   ` Rafal Luzynski
2019-03-11 11:16                     ` Rafal Luzynski
2019-03-11 13:55                       ` Florian Weimer
2019-03-11 21:56                         ` Rafal Luzynski
2019-03-12  1:12                           ` H.J. Lu
2019-03-13 21:10                           ` Florian Weimer
2019-03-13 11:47                         ` Rafal Luzynski
2019-03-13 21:15                           ` Florian Weimer
2019-02-27 21:23 ` H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73e309e8-6ec4-01fb-7cc1-f4af4df56693@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=nd@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).