Bug 14980 - internal error in elf_x86_64_relocate_section
Summary: internal error in elf_x86_64_relocate_section
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-21 17:59 UTC by H.J. Lu
Modified: 2012-12-21 19:10 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2012-12-21 17:59:26 UTC
[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]$
Comment 1 Sourceware Commits 2012-12-21 18:15:27 UTC
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
Comment 2 Sourceware Commits 2012-12-21 18:21:15 UTC
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
Comment 3 H.J. Lu 2012-12-21 19:10:36 UTC
Fixed.