public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: PR 939: Assertion failed in linker
@ 2005-05-08  1:13 H. J. Lu
  2005-05-08 14:17 ` Alan Modra
  2005-05-09 22:35 ` H. J. Lu
  0 siblings, 2 replies; 4+ messages in thread
From: H. J. Lu @ 2005-05-08  1:13 UTC (permalink / raw)
  To: binutils

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: PR 939: Assertion failed in linker
  2005-05-08  1:13 PATCH: PR 939: Assertion failed in linker H. J. Lu
@ 2005-05-08 14:17 ` Alan Modra
  2005-05-09 22:35 ` H. J. Lu
  1 sibling, 0 replies; 4+ messages in thread
From: Alan Modra @ 2005-05-08 14:17 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Sat, May 07, 2005 at 05:13:12PM -0700, H. J. Lu wrote:
> 	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.

OK (if you haven't already applied as obvious).

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: PR 939: Assertion failed in linker
  2005-05-08  1:13 PATCH: PR 939: Assertion failed in linker H. J. Lu
  2005-05-08 14:17 ` Alan Modra
@ 2005-05-09 22:35 ` H. J. Lu
  2005-05-10  0:31   ` Alan Modra
  1 sibling, 1 reply; 4+ messages in thread
From: H. J. Lu @ 2005-05-09 22:35 UTC (permalink / raw)
  To: binutils

On Sat, May 07, 2005 at 05:13:12PM -0700, H. J. Lu wrote:
> 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.
> 

This patch fixes the similar issue in ld.


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

	* ldmain.c (reloc_overflow): Use output_bfd if the symbol
	is defined in the ABS section.

--- ld/ldmain.c.abs	2005-05-09 15:06:19.000000000 -0700
+++ ld/ldmain.c	2005-05-09 15:04:03.000000000 -0700
@@ -1452,7 +1452,9 @@ reloc_overflow (struct bfd_link_info *in
 	case bfd_link_hash_defweak:
 	  einfo (_(" relocation truncated to fit: %s against symbol `%T' defined in %A section in %B"),
 		 reloc_name, entry->root.string,
-		 entry->u.def.section, entry->u.def.section->owner);
+		 entry->u.def.section,
+		 entry->u.def.section == bfd_abs_section_ptr
+		 ? output_bfd : entry->u.def.section->owner);
 	  break;
 	default:
 	  abort ();

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: PR 939: Assertion failed in linker
  2005-05-09 22:35 ` H. J. Lu
@ 2005-05-10  0:31   ` Alan Modra
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Modra @ 2005-05-10  0:31 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Mon, May 09, 2005 at 03:09:17PM -0700, H. J. Lu wrote:
> 	* ldmain.c (reloc_overflow): Use output_bfd if the symbol
> 	is defined in the ABS section.

OK.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-05-10  0:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-08  1:13 PATCH: PR 939: Assertion failed in linker H. J. Lu
2005-05-08 14:17 ` Alan Modra
2005-05-09 22:35 ` H. J. Lu
2005-05-10  0:31   ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).