Bug 11458 - assertion fail /home/hp/binutils/src/bfd/elf32-cris.c:3109 elf_cris_copy_indirect_symbol
Summary: assertion fail /home/hp/binutils/src/bfd/elf32-cris.c:3109 elf_cris_copy_indi...
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: Hans-Peter Nilsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-30 23:10 UTC by Hans-Peter Nilsson
Modified: 2010-03-31 03:42 UTC (History)
1 user (show)

See Also:
Host:
Target: cris-*-* and crisv32-*-*
Build:
Last reconfirmed:


Attachments
The .d file, to be placed in ld/testsuite/ld-cris. (718 bytes, text/plain)
2010-03-30 23:14 UTC, Hans-Peter Nilsson
Details
The assembly input, to be put alongside the .d file. (309 bytes, text/plain)
2010-03-30 23:15 UTC, Hans-Peter Nilsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Peter Nilsson 2010-03-30 23:10:32 UTC
The attached test-case exposes a BFD_ASSERT "covering" a short-cut: instead of
merging the lists of sections with pc-relative relocs (that have to be copied)
when creating shared libraries, the list was just copied over to the direct
symbol.  Originally this failed when the shared library being created, contained
a non-pic pc-relative reference to abort, which in glibc is versioned, thus
being an indirect symbol to the linker.
Comment 1 Hans-Peter Nilsson 2010-03-30 23:14:15 UTC
Created attachment 4690 [details]
The .d file, to be placed in ld/testsuite/ld-cris.
Comment 2 Hans-Peter Nilsson 2010-03-30 23:15:22 UTC
Created attachment 4691 [details]
The assembly input, to be put alongside the .d file.
Comment 3 Sourceware Commits 2010-03-31 03:38:38 UTC
Subject: Bug 11458

CVSROOT:	/cvs/src
Module name:	src
Changes by:	hp@sourceware.org	2010-03-31 03:38:26

Modified files:
	bfd            : ChangeLog elf32-cris.c 

Log message:
	PR ld/11458
	* elf32-cris.c (elf_cris_copy_indirect_symbol): Remove invalid
	assert of empty pcrel_relocs_copied on the direct symbol.  Instead
	of moving the list from the indirect symbol to the direct symbol,
	merge into any existing list.
	(cris_elf_check_relocs): Store the original section in the
	pcrel_relocs_copied list, not the relocation section.
	(elf_cris_discard_excess_dso_dynamics): Adjust accordingly to find
	the relocation section, for reducing its size.  Change the
	BFD_ASSERT into a check for the section being read-only, and only
	emit warnings and TEXTREL marker when there's an entry for a
	read-only section.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.4970&r2=1.4971
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-cris.c.diff?cvsroot=src&r1=1.107&r2=1.108

Comment 4 Hans-Peter Nilsson 2010-03-31 03:42:09 UTC
See <http://sourceware.org/ml/binutils/2010-03/msg00433.html>.
Comment 5 Sourceware Commits 2010-03-31 13:23:58 UTC
Subject: Bug 11458

CVSROOT:	/cvs/src
Module name:	src
Changes by:	hp@sourceware.org	2010-03-31 13:23:40

Modified files:
	ld/testsuite   : ChangeLog 
Added files:
	ld/testsuite/ld-cris: pcrelcp-1.d pcrelcp-1.s 

Log message:
	PR ld/11458
	* ld-cris/pcrelcp-1.d, ld-cris/pcrelcp-1.s: New test.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1237&r2=1.1238
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-cris/pcrelcp-1.d.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/testsuite/ld-cris/pcrelcp-1.s.diff?cvsroot=src&r1=NONE&r2=1.1