This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: PR 939: Assertion failed in linker


We make those array symbols hidden now. But some broken DSOs references
them. When we reporting error, we get

g++ --export-dynamic -o
/home/janoc/src/VHD/VHDPP_TEST/bin/vhdMetaEngine
vhdMetaEngine/vhdWinApp.o -L/home/janoc/src/VHD/VHDPP_TEST/lib
-L/usr/lib/qt3/lib -L/opt/jtc2.0/lib -L/opt/xerces-1.5.2/lib
-L/usr/X11R6/lib -lDynLib -lvhdMath -lvhdKernel -lvhdQManager -lDynLib
-lvhdOmniORB -lxerces-c -lJTC -ldl -lomniORB4
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/bin/ld: BFD 2.16.90.0.2 20050429 assertion fail elflink.c:6191

since we don't check if a symbol is defined in ABS section. This patch
changes it to

/usr/gcc-4.0/bin/g++ -B./ -o vhdMetaEngine vhdWinApp.o
-Wl,-rpath-link,usr/lib -Llib -lDynLib -lvhdMath -lvhdKernel
-lvhdQManager -lDynLib -lvhdOmniORB -lxerces-c -lJTC -ldl -lomniORB4
./ld: BFD 2.16.90.0.3 20050507 assertion fail
/net/gnu/export/linux/src/binutils/binutils/bfd/elflink.c:6301
./ld: vhdMetaEngine: hidden symbol `__fini_array_end' in vhdMetaEngine
is referenced by DSO
./ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status


H.J.
---
2005-05-07  H.J. Lu  <hongjiu.lu@intel.com>

	PR 939
	* elflink.c (elf_link_output_extsym): Use output_bfd if
	h->root.u.def.section is bfd_abs_section_ptr when reporting
	error.

--- bfd/elflink.c.foo	2005-05-07 10:17:22.000000000 -0700
+++ bfd/elflink.c	2005-05-07 17:06:05.000000000 -0700
@@ -6476,7 +6476,9 @@ elf_link_output_extsym (struct elf_link_
     {
       (*_bfd_error_handler)
 	(_("%B: %s symbol `%s' in %B is referenced by DSO"),
-	 finfo->output_bfd, h->root.u.def.section->owner,
+	 finfo->output_bfd,
+	 h->root.u.def.section == bfd_abs_section_ptr
+	 ? finfo->output_bfd : h->root.u.def.section->owner,
 	 ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
 	 ? "internal"
 	 : ELF_ST_VISIBILITY (h->other) == STV_HIDDEN


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]