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]
Other format: [Raw text]

Re: stage one of gas reloc rewrite


On Sun, 1 Sep 2002, Alan Modra wrote:
> On Sat, Aug 31, 2002 at 11:35:10AM -0400, Hans-Peter Nilsson wrote:
> > I'm suspicious.  For most of the tests, you add local unnamed
> > "*ABS*" symbols.  That doesn't seem right; I'd rather expect
> > removal of local "*ABS*" symbols (or more removed than added).

> The symbol being added is the absolute section symbol.  You'll find
> that in these cases it is in fact being used in relocs,

Not in gas/mmix/odd-1.d.

> so it's the
> generally correct thing to do.

By "it" you (seem to) imply using it internally in BFD reloc and
gas fixup handling.  I don't argue against that.

>  Note the comment at the end of
> adjust_reloc_syms about BFD not handling relocs without symbols very
> well.  The comment is right;  bfd_install_relocation will segfault
> without a symbol.

Yeah, there's where the abs section symbol becomes the fx_addsy
of the fixup.  In fixup_segment:2724 the abs section symbol then
gets symbol_mark_used_in_reloc, and that mark takes it to the
output.  Unfortunately there's no tc_ or obj_ hook to undo that
AFAICT (all references to code after your patch) hence that fake
symbol is output.

> That particular issue is really orthogonal to whether the symbol needs
> to appear in the object file, but the comment used to say that COFF
> support in BFD needed a symbol and I was worried that COFF needed a
> symbol to be emitted.  In the case of ELF, I'll agree that the
> absolute section symbol need not be emitted.  We can tidy that up
> later.

I dislike the cleanup to introduce this kind of wart.  I made
the MMIX port prune those abs "section symbol" from the output
because, well, it looked wrong to output it.  (Though it's
arguably wrong to do this port-local).  Besides, it can't really
be called a section symbol in the output since the "*ABS*" name
is internal to bfd.

I hope to look into fixing it.

brgds, H-P


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