This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] BFD: Handle copying of absolute section symbols
- From: Alan Modra <amodra at gmail dot com>
- To: "Maciej W. Rozycki" <macro at linux-mips dot org>
- Cc: binutils at sourceware dot org, Richard Sandiford <rdsandiford at googlemail dot com>
- Date: Mon, 7 May 2012 16:51:41 +0930
- Subject: Re: [PATCH] BFD: Handle copying of absolute section symbols
- References: <alpine.LFD.email@example.com> <20120410233400.GA24704@bubble.grove.modra.org> <alpine.LFD.firstname.lastname@example.org> <20120416124817.GD3218@bubble.grove.modra.org> <alpine.LFD.email@example.com> <20120417144802.GE3218@bubble.grove.modra.org> <alpine.LFD.firstname.lastname@example.org>
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.
> > 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
> 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
> 2012-05-07 Maciej W. Rozycki <email@example.com>
> * elf.c (elf_map_symbols): Never discard global section symbols.
Australia Development Lab, IBM