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]

Re: Linking libstdc++ with gcc-3.0.2 prerelease fails on IA64


On Mon, Oct 15, 2001 at 06:02:50PM -0700, H . J . Lu wrote:
> On Mon, Oct 15, 2001 at 02:16:38PM -0700, Janis Johnson wrote:
> > On Mon, Oct 15, 2001 at 11:59:13AM -0700, H . J . Lu wrote:
> > > On Mon, Oct 15, 2001 at 01:25:56PM -0500, Krishnakumar B wrote:
> > > > On Monday, 15 October 2001, H . J . Lu wrote:
> > > > > On Mon, Oct 15, 2001 at 10:26:55AM -0700, Janis Johnson wrote:
> > > > > > On Sun, Oct 14, 2001 at 06:38:26PM -0500, Krishnakumar B wrote:
> > > > > > >
> > > > > > > I am trying to bootstrap IA-64. During the link stage of libstdc++, I get
> > > > > > > the following message. I can reproduce the failure at the same stage with
> > > > > > > the snapshots 200011001 and 20011007 also.
> > > > > > > 
> > > > > > > .libs/string-inst.o:/u/kitty/tools/gcc-3.0.2-20011014/ia64-redhat-linux/ia64-redhat-linux/libstdc++-v3/include/bits/basic_string.h:238:
> > > > > > > unsupported reloc
> > > > > > 
> > > > > > I see this with the mainline CVS.  Rather than looking into it I've just
> > > > > > avoided building c++ and java.  Unless someone already knows what the
> > > > > > problem is I can look into it.
> > > > > >  
> > > > > 
> > > > > I believe it is a binutils bug. Please tell me how to reproduce it. I
> > > > > will make sure it is fixed.
> > > > 
> > > > Just try bootstrapping gcc on IA64. Linking libstdc++ fails with this
> > > > error. True for both the mainline or prerelease. I resorted to linking
> > > > using binutils 2.11.90.0.8 though I am sure that it will link with any
> > > > binutils other than 2.11.92.0.5.
> > > > 
> > > 
> > > I need the exact steps in order to duplicate the problem.
> > 
> > OK, here's what I did on an IA-64 system; it's pretty basic.
> > gcc-mainline is a symbolic link to the CVS gcc tree, last updated
> > Wed Oct 10 19:07:42 UTC 2001.
> > 
> > ld -v:
> >    GNU ld version 2.11.92.0.5 20011005.
> > gcc -v (partial):
> >    gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-96).
> > uname -a:
> >    Linux elm3a81 2.4.7-2smp #1 SMP Tue Aug 14 04:31:14 EDT 2001 ia64 unknown
> > 
> > mkdir gcc-obj
> > cd gcc-obj
> > ../gcc-mainline/configure --prefix=/home/janis/gnu/tools \
> >   --enable-languages="c,c++" > configure.log 2>&1
> > make > make.log 2>&1
> > 
> 
> Hi Alan,
> 
> I believe the ia64 linker is broken by
> 
> http://sources.redhat.com/ml/binutils/2001-09/msg00507.html
> http://sources.redhat.com/ml/binutils/2001-10/msg00101.html
> 
> The ia64 linker doesn't like relocations against the symbol table index
> 0, at least not for R_IA64_SEGREL64LSB. Besides, many places in BFD use
> bfd_is_abs_section (sym_sec->output_section) to check if the section
> is removed. With your change, it no longer works. We need a better way
> to handle the relocations against symbols in the removed sections.
> 
> 
> H.J.

Hi Alan,

This patch seems to fix the ia64 linker. Could you please double check
it?

Thanks.


H.J.
---
2001-10-15  H.J. Lu <hjl@gnu.org>

	* elflink.h (elf_link_input_bfd): Set type to BFD_RELOC_NONE
	for relocations against discarded link-once section.

--- elflink.h.weak	Mon Oct 15 16:51:51 2001
+++ elflink.h	Mon Oct 15 17:02:03 2001
@@ -6327,8 +6327,10 @@ elf_link_input_bfd (finfo, input_bfd)
 			    && (sec->flags & SEC_LINK_ONCE) != 0
 			    && bfd_is_abs_section (sec->output_section))
 			  {
-			    long r_type = ELF_R_TYPE (rel->r_info);
-			    rel->r_info = ELF_R_INFO (0, r_type);
+			    reloc_howto_type *howto
+			      =  bfd_reloc_type_lookup (output_bfd,
+							BFD_RELOC_NONE);
+			    rel->r_info = ELF_R_INFO (0, howto->type);
 
 #if BFD_VERSION_DATE > 20021005
 			    (*finfo->info->callbacks->warning)


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