[hjl@gnu-6 ifunc-hidden]$ cat bar.c extern int library_func2 (int) __attribute__((visibility ("hidden"))); int library_func (int x) { return library_func2 (x); } [hjl@gnu-6 ifunc-hidden]$ cat bar2.c extern int library_func2 (int) __attribute__((visibility ("hidden"))); int library_func1 (int x) { return library_func2 (x); } [hjl@gnu-6 ifunc-hidden]$ cat foo.c static int zero (void) { return 0; } void * library_func2_ifunc (void) __asm__ ("library_func2") __attribute__((visibility ("hidden"))); void * library_func2_ifunc (void) { return zero ; } __asm__(".type library_func2, %gnu_indirect_function"); [hjl@gnu-6 ifunc-hidden]$ make gcc -fPIC -c -o bar.o bar.c gcc -c -o bar2.o bar2.c gcc -fPIC -c -o foo.o foo.c ./ld --shared -o libfoo.so -z nocombreloc bar.o bar2.o foo.o ./ld: BFD (GNU Binutils) 2.23.51.20121221 internal error, aborting at /export/gnu/import/git/binutils/bfd/elf64-x86-64.c line 3285 in elf_x86_64_relocate_section ./ld: Please report this bug. make: *** [libfoo.so] Error 1 [hjl@gnu-6 ifunc-hidden]$
CVSROOT: /cvs/src Module name: src Changes by: hjl@sourceware.org 2012-12-21 18:15:23 Modified files: ld/testsuite : ChangeLog bfd : ChangeLog elf32-i386.c elf64-x86-64.c Added files: ld/testsuite/ld-ifunc: ifunc-14c.s ifunc-14e-i386.d ifunc-14e-x86-64.d ifunc-14f-i386.d ifunc-14f-x86-64.d Log message: Properly adjust h->plt.refcount bfd/ PR ld/14980 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Properly adjust h->plt.refcount. * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise. ld/testsuite/ PR ld/14980 * ld-ifunc/ifunc-14c.s: New file. * ld-ifunc/ifunc-14e-i386.d: Likewise. * ld-ifunc/ifunc-14e-x86-64.d: Likewise. * ld-ifunc/ifunc-14f-i386.d: Likewise. * ld-ifunc/ifunc-14f-x86-64.d: Likewise. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1652&r2=1.1653 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-ifunc/ifunc-14c.s.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-ifunc/ifunc-14e-i386.d.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-ifunc/ifunc-14e-x86-64.d.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-ifunc/ifunc-14f-i386.d.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-ifunc/ifunc-14f-x86-64.d.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.5890&r2=1.5891 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-i386.c.diff?cvsroot=src&r1=1.292&r2=1.293 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf64-x86-64.c.diff?cvsroot=src&r1=1.281&r2=1.282
CVSROOT: /cvs/src Module name: src Branch: binutils-2_23-branch Changes by: hjl@sourceware.org 2012-12-21 18:21:06 Modified files: bfd : ChangeLog elf32-i386.c elf64-x86-64.c ld/testsuite : ChangeLog Added files: ld/testsuite/ld-ifunc: ifunc-14c.s ifunc-14e-i386.d ifunc-14e-x86-64.d ifunc-14f-i386.d ifunc-14f-x86-64.d Log message: Properly adjust h->plt.refcount bfd/ PR ld/14980 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Properly adjust h->plt.refcount. * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise. ld/testsuite/ PR ld/14980 * ld-ifunc/ifunc-14c.s: New file. * ld-ifunc/ifunc-14e-i386.d: Likewise. * ld-ifunc/ifunc-14e-x86-64.d: Likewise. * ld-ifunc/ifunc-14f-i386.d: Likewise. * ld-ifunc/ifunc-14f-x86-64.d: Likewise. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.5758.2.35&r2=1.5758.2.36 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-i386.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.279.4.2&r2=1.279.4.3 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf64-x86-64.c.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.270.4.2&r2=1.270.4.3 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ChangeLog.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=1.1579.2.14&r2=1.1579.2.15 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-ifunc/ifunc-14c.s.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=NONE&r2=1.1.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-ifunc/ifunc-14e-i386.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=NONE&r2=1.1.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-ifunc/ifunc-14e-x86-64.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=NONE&r2=1.1.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-ifunc/ifunc-14f-i386.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=NONE&r2=1.1.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-ifunc/ifunc-14f-x86-64.d.diff?cvsroot=src&only_with_tag=binutils-2_23-branch&r1=NONE&r2=1.1.2.1
Fixed.