This is the mail archive of the binutils@sourceware.org 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]

Re: MIPS / assertion fail or the build error when using --gc-sections and --export-dynamic option


Hello binutils experts.

It seems that the mips_elf_sort_hash_table() called from the
_bfd_mips_elf_final_link() contain the symbol information which
should be sweeped by --gc-sections ,
only when this optionis used in conjunction with 
--export-dynamic.

Following may be  the patch to fix this, and I checked that
the testcases specified by the previous Emails were successfully 
completed , without any assertion fail output or any errors.

I don't think this patch is the correct, real way to fix this due to 
the following reasons.

First,  I do not check other cases or run any tests like "make check" .
Second, I am not familiar with the design of the MIPS binutils.

This may be only one of the information to help the further investigation
to fix this.

Thanks in advance.

-- Yuji

--- binutils-2.18.50.org/bfd/elfxx-mips.c	2007-08-14
06:16:38.000000000 +0900
+++ binutils-2.18.50/bfd/elfxx-mips.c	2007-08-27 18:10:59.118275200 +0900
@@ -3324,6 +3324,9 @@ mips_elf_resolve_final_got_entry (void *
  	     || h->root.root.type == bfd_link_hash_warning)
 	h = (struct mips_elf_link_hash_entry *) h->root.root.u.i.link;
 
+      if (h->root.root.u.def.section->flags & SEC_EXCLUDE) {
+	h->root.other = STV_HIDDEN | (h->root.other & ~ELF_ST_VISIBILITY
(-1)) ;
+      }
       if (entry->d.h == h)
 	return 1;


> CC: binutils@sourceware.org; Satoru.Ueda@jp.sony.com
> 件名: Re: MIPS / assertion fail or the build error when using 
> --gc-sections and --export-dynamic option
> 
> Yuji Ogihara wrote:
> > Dear binutils experts.
> > 
> > I am using the MIPS cross toolchain as follows.
> > 
> > + binutils 2.18.50.20070819
> >   - configured/builded with
> >     --host=i686-pc-linux-gnu 
> >     --target=mips-xxx-linux 
> >     --build=i686-pc-linux-gnu
> > 
> > (Is this the latest version in main CVS repository ?)
> > 
> > + gcc 4.1.1
> >   - configured/builded with
> >      --host=mips-xxx-linux 
> >      --build=i686-pc-linux-gnu 
> >      --with-arch=mips2
> > 
> > I found the several cases that the linker may outputs the 
> "assertion fail"
> > messages,
> 
> That is not good.
> 
> > or cause the build error when using the --gc-sections and 
> > --export-dynamic option at the same time.
> > 
> > Would you please give me the information that this is the 
> known issue, 
> > or limitation, or the something wrong with me.
> > 
> 
> It does not surprise me that this happens.  I spent quite a 
> bit of effort getting --gc-sections working on mipsel-linux, 
> but I never tried it in conjunction with --export-dynamic.
> 
> Unfortunately I don't know of any alternative to running ld 
> under a debugger and figuring out what is going wrong, and 
> then fixing it.
> 
> David Daney


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