This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: PR 939: Assertion failed in linker
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Mon, 9 May 2005 15:09:17 -0700
- Subject: Re: PATCH: PR 939: Assertion failed in linker
- References: <20050508001312.GA14292@lucon.org>
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 ();