This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: .reloc improvement
On Sat, Aug 20, 2011 at 07:37:40PM +0100, Richard Sandiford wrote:
> Alan Modra <amodra@gmail.com> writes:
> > This patch makes some improvements to relocations emitted by the
> > .reloc directive:
> > 1) A symbol on these relocs is converted to section symbol plus offset
> > if the symbol satisifes S_IS_LOCAL and some section related
> > conditions. For example, forward/backward labels like "1f", and
> > ELF locals like .L123 will be converted. This helps keep the
> > symbol table tidy.
>
> Thanks for doing this. The relaxation might need to be conditional
> for some REL targets though.
Yes, it was this sort of consideration that led me to choose to only
substitute the section symbol for symbols that satisfy S_IS_LOCAL,
rather than the larger set handled by adjust_reloc_symbols. I know it
potentially breaks existing code, but hopefully I won't be hit by too
many brickbats..
[snip]
> Maybe one way would be to create a fake, temporary fixup and pass
> that to tc_fix_adjustable.
This might not be such a bad idea. If resolve_reloc_expr_symbols
found the frags and inserted a fake fixup in the section fixup chain,
then the rest of the fixup handling machinery might even work for
.reloc.
--
Alan Modra
Australia Development Lab, IBM