This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] elf: Add tests with a local IFUNC resolver [BZ #23937]
- From: Rafal Luzynski <digitalfreak at lingonborough dot com>
- To: Florian Weimer <fweimer at redhat dot com>, libc-alpha at sourceware dot org
- Date: Fri, 1 Mar 2019 01:50:20 +0100 (CET)
- Subject: Re: [PATCH] elf: Add tests with a local IFUNC resolver [BZ #23937]
- References: <87mumqei4h.fsf@oldenburg2.str.redhat.com> <87a7ihv84x.fsf@oldenburg2.str.redhat.com>
Florian,
27.02.2019 11:27 Florian Weimer <fweimer@redhat.com> wrote:
>
> * Florian Weimer:
>
> > 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).
All those tests fail at my test machine:
FAIL: elf/ifuncmain9
FAIL: elf/ifuncmain9pic
FAIL: elf/ifuncmain9picstatic
FAIL: elf/ifuncmain9pie
FAIL: elf/ifuncmain9static
$ cat elf/ifuncmain9.out
info: initial value of resolver_called: 0
error: invalid magic value: 0x400630
info: resolver_called value: 1
info: implementation_called value: 0
error: invalid implementation_called value (must be 1)
$ cat elf/ifuncmain9pic.out
info: initial value of resolver_called: 0
error: invalid magic value: 0x400640
info: resolver_called value: 1
info: implementation_called value: 0
error: invalid implementation_called value (must be 1)
$ cat elf/ifuncmain9picstatic.out
info: initial value of resolver_called: 0
error: invalid magic value: 0x400c70
info: resolver_called value: 1
info: implementation_called value: 0
error: invalid implementation_called value (must be 1)
$ cat elf/ifuncmain9pie.out
info: initial value of resolver_called: 0
error: invalid magic value: 0x5ef358e0
info: resolver_called value: 1
info: implementation_called value: 0
error: invalid implementation_called value (must be 1)
$ cat elf/ifuncmain9static.out
info: initial value of resolver_called: 0
error: invalid magic value: 0x400c60
info: resolver_called value: 1
info: implementation_called value: 0
error: invalid implementation_called value (must be 1)
I hope it helps. Feel free to ask more questions.
Regards,
Rafal