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

--- Comment #1 from Harshit Kumar <harshit7kr at gmail dot com> ---
The description lost its line breaks and the underscores of __attribute__
when pasted.  The attachment (17263) is correct.  Readable version:

  static int impl(void){return 1;}
  static int (*resolve(void))(void){return impl;}
  static int f(void) __attribute__((ifunc("resolve")));
  __attribute__((noinline))
  static int call(int (*p)(void), int x){ return x; }
  int g(int x){ return call(f, x); }

  $ gcc -g -O2 -fPIC -shared local-ifunc-callsite.c -o libt.so
  /usr/bin/ld: BFD (GNU Binutils) 2.47 internal error, aborting at
  .../bfd/elf64-x86-64.c:3271 in elf_x86_64_relocate_section
  Please report this bug.
  collect2: error: ld returned 1 exit status

  $ gcc -g -O2 -c local-ifunc-callsite.c -o t.o
  $ readelf -rW t.o | grep ' f()'
  0000000000000079  0000000500000001 R_X86_64_64  f() f + 0
  0000000000000116  0000000500000001 R_X86_64_64  f() f + 0
  (both in .rela.debug_info; nothing in .rela.text)
  $ readelf -sW t.o | grep ' f$'
       5: 0000000000000010     8 IFUNC   LOCAL  DEFAULT    1 f

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to