[PATCH] D27406: [LLD][ELF] Ifunc implementation using synthetic sections

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 08:46:23 PST 2016


peter.smith added a comment.

I've been doing some more testing today, I can't get a lld built x86_32 ifunc to work on my machine before or after applying the patch. When I try to run the program I get "Inconsistency detected by ld.so: dl-runtime.c: 87: _dl_fixup: Assertion `((reloc->r_info) & 0xff) == 7' failed!". There aren't any obvious differences from the ld.bfd generated object.

I'll try to get to the bottom of why this is failing. It would be good to know if anyone else has had any success with ifunc on lld for x86_32? It is possible that the multiarch glibc on my machine is too old.

For what it is worth my test program is:

  int val = 1;
  static void func1_x(void)
  {
      val = 0;
  }
  void* func1_ifunc();
  void func1(void) __attribute__ ((ifunc("func1_ifunc")));
  void* func1_ifunc()
  {
      return &func1_x;
  }
  int main(void)
  {
      func1();
      return val;
  }

gcc -m32 t.c -o t.exe # with ld.lld as the linker
./t.exe
Inconsistency detected by ld.so: dl-runtime.c: 87: _dl_fixup: Assertion `((reloc->r_info) & 0xff) == 7' failed!
The assertion is stating that it was expecting a R_386_JUMP_SLOT relocation.


https://reviews.llvm.org/D27406





More information about the llvm-commits mailing list