This is the mail archive of the 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 Tue, Apr 17, 2012 at 11:40:06AM +0100, Maciej W. Rozycki wrote:
> On Mon, 16 Apr 2012, Alan Modra wrote:
> > >  Excuse me, but I fail to see where we exclude global section syms -- 
> > > there's nothing in ignore_section_sym or elf_map_symbols that looks to me 
> > > like eliminating them.  For the avoidance of doubt -- does your your 
> > > answer count as approval for my change?
> > 
> > You had this:
> > 
> >     63: 0000000000000001     0 SECTION GLOBAL DEFAULT  ABS _DYNAMIC_LINKING
> >                                        ^^^^^^
> > and found it was being dropped.
> > 
> > Your solution was to keep ABS symbols.  An alternative solution for
> > your particular problem is to ensure global symbols are kept.  I'm
> > saying we should do both.
>  Hmm, you can't mean we should keep global symbols from dropped sections 
> (be it section or ordinary symbols), can you?
>  We're dropping this symbol because it does not belong to any section 
> being output, not because it's global or not.  If it wasn't absolute, but 
> its section was dropped, it would be (correctly) dropped as well.  
> Likewise if it was local and absolute, it would be (incorrectly) dropped 
> too -- this is fixed by my change just as for global absolute symbols.
>  I'm confused, sorry.

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.

When you have other sorts of section symbols they probably shouldn't
be dropped as duplicates.  That's what I was getting at. 

Please go ahead and apply your patch, but use sym->section rather
than bfd_get_section(sym) to keep the style consistent.

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]