This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: RFC: Add DT_FLAGS_2 and DF_2_GNU_IFUNC


On 05/26/2018 12:09 AM, H.J. Lu wrote:

This is just the old known issue related to symbol interposition and IFUNC
resolvers, where even complete DT_NEEDED information is not sufficient to
perform the relocations in the correct order.

A single bit will not solve this.  In your reproducer, add an IFUNC resolver
to libbar.so, and I'm sure the bug will resurface again.

Can you add a complete testcase to

https://sourceware.org/bugzilla/show_bug.cgi?id=23240

Let's not clutter Bugzilla unnecessarily.

Try this with your patched toolchain:


void
bar (char *dst, const char *src, unsigned int size)
{
  __builtin_memmove (dst, src, size);
}

void unused_func (void) __attribute__ ((ifunc ("resolve_unused_func")));

static void *
resolve_unused_func (void)
{
  return 0;
}


It should result in libbar.so having the DF_2_GNU_IFUNC flag (please verify with readelf). I expect that with your ld.so patch, we again relocate libbar.so first, leading to exactly the same crash.

I hope this makes it clearer what I'm worried about.

Thanks,
Florian


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