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: [PATCH] BFD: Handle copying of absolute section symbols


On Mon, May 07, 2012 at 06:30:02AM +0100, Maciej W. Rozycki wrote:
> On Wed, 18 Apr 2012, Alan Modra wrote:
> > The comment on ignore_section_symbol is no doubt the source of your
> > confusion.  ignore_section_symbol doesn't just drop section symbols
> > from dropped sections, it also drops duplicates.  For example, each
> > .text section in an input file normally has a section symbol.  We only
> > need to keep one.  At least, that is the case for the st_value==0,
> > st_name==0 STB_LOCAL section symbols that gas usually emits.
> 
>  Oh, I see, that's the "sym->section->output_offset == 0" condition.  

Yes.

> > When you have other sorts of section symbols they probably shouldn't
> > be dropped as duplicates.  That's what I was getting at. 
> 
>  Hmm, I think you're right, do you mean something like the change below?  
> It works for my case too and otherwise doesn't cause any regressions for 
> mips64-linux-gnu.
> 
>  Note that I have preserved the current behaviour of producing the special 
> section symbols pointing to the base of each section output regardless of 
> the presence of any global section symbols that might be defined for the 
> same section.  I wonder how this is going to work if such a global symbol 
> is indeed present, but perhaps that's not something we should be concerned 
> about until we actually have a real case.  What do you think?

I don't forsee a problem.  It would be correct to keep all section
symbols.

> 2012-05-07  Maciej W. Rozycki  <macro@linux-mips.org>
> 
> 	bfd/
> 	* elf.c (elf_map_symbols): Never discard global section symbols.

OK.

-- 
Alan Modra
Australia Development Lab, IBM


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