This is the mail archive of the libc-alpha@sourceware.org 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] configure: fix STT_GNU_IFUNC support detection with PIE toolchains [BZ #25506]


On 2020-02-05 07:15, Aurelien Jarno wrote:
> On 2020-02-04 20:13, Fangrui Song wrote:
> > On 2020-02-04, Aurelien Jarno wrote:
> > > When GCC defaults to PIE, compiling the conftest.S that is used to
> > > detect for assembler and linker STT_GNU_IFUNC support emits a
> > > relocation. This causes a false positive in the detection.
> > > 
> > > Example on riscv64 with a toolchain defaulting to PIE:
> > > 
> > > | configure:4009: checking for assembler and linker STT_GNU_IFUNC support
> > > |
> > > | Relocation section '.rela.dyn'@offset 0x268 contains 1 entry:
> > > |    Offset          Info           Type           Sym. Value    Sym. Name + Addend
> > > | 000000002000  000000000003 R_RISCV_RELATIVE                     280
> > > | configure:4040: result: yes
> > 
> > This patch is incorrect.
> > 
> >   .type foo,%gnu_indirect_function
> >   foo:
> >   .globl _start
> >   _start:
> >   .globl __start
> >   __start:
> >   .data
> >   .quad foo
> > 
> > The conftest tests a non-GOT-non-PLT relocation referencing a non-preemptible symbol causes the creation of R_*_IRELATIVE.
> > 
> > A better test is to check R_*_IRELATIVE, instead of expecting "no relocations".
> 
> This is not something possible for two reasons:
> - when building with PIE, the output is actually "no relocations".
> - this test is not RISC-V specific

Oh I have seen your patch now. It makes sense now, sorry about the
confusion.

I have tested it quickly on x86-64, MIPS, aarch64, it seems to work as
expected.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net


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