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.
Created attachment 4690 [details] The .d file, to be placed in ld/testsuite/ld-cris.
Created attachment 4691 [details] The assembly input, to be put alongside the .d file.
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
See <http://sourceware.org/ml/binutils/2010-03/msg00433.html>.
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