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: [PATCH] Deleting discardable stabs


On Tue, Nov 13, 2001 at 12:22:31AM +1030, Alan Modra wrote:
> On Sun, Nov 11, 2001 at 10:03:40PM -0500, Daniel Jacobowitz wrote:
> > +
> > +      if (! rcookie->bad_symtab)
> > +	if (rcookie->rel->r_offset > offset)
> > +	  return false;
> 
> Hmm, I guess it's reasonable to assume the relocs will always be sorted.
> Assemblers other than gas?

My reading is that the relocs will be sorted unless elf_bad_symtab() is
true.  Maybe that's not correct... I could read in the relocations and
then sort them, I suppose.  Should I do that explicitly?

> > +      if (rcookie->rel->r_offset != offset)
> > +	continue;
> > +
> > +      rcookie->rel ++;
> > +
> > +      /* If rcookie->bad_symtab, we should check
> > +	 finfo->sections[r_symndx] == NULL by analogy with
> > +	 elf_link_input_bfd.  That's not available yet,
> > +	 so we might miss some.  */
> 
> You do have the syms available, so could check binding.

Oh, OK.  My glance suggests that finfo->sections[r_symndx] == NULL here
is equivalent to ELF_ST_BIND (isym->st_info) != STB_LOCAL; is that
right?

> > +        {
> > +          bfd_size_type amt = cookie.locsymcount * sizeof (Elf_External_Sym);
> > +          cookie.locsyms = bfd_malloc (amt);
> 
> Need to free this somewhere.

A little further down:
	symtab_hdr->contents = (unsigned char *) cookie.locsyms

I was hoping that would take care of it, but while several things will
use external symbols from symtab_hdr->contents, nothing else will set that
for an input bfd.  My mistake.

> > @@ -1319,6 +1321,27 @@ gld${EMULATION_NAME}_place_orphan (file,
> >    return true;
> >  }
> >  
> > +boolean elf_bfd_discard_stabs (struct bfd_link_info *);
> 
> Wrong prototype.

And meant to delete that.  Thanks.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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