This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] MIPS/binutils: microMIPS linker relaxation fixes
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: "Maciej W. Rozycki" <macro at codesourcery dot com>
- Cc: <binutils at sourceware dot org>, Tristan Gingold <gingold at adacore dot com>
- Date: Tue, 15 Nov 2011 17:00:55 +0000
- Subject: Re: [PATCH] MIPS/binutils: microMIPS linker relaxation fixes
- References: <alpine.DEB.1.10.1110272117590.28657@tp.orcam.me.uk> <87ty68b6al.fsf@firetop.home> <alpine.DEB.1.10.1111151456400.4191@tp.orcam.me.uk>
"Maciej W. Rozycki" <macro@codesourcery.com> writes:
> So I have actually given it some more thought and my understanding of the
> ABI remains that while orphaned R_MIPS_LO16 relocations are indeed
> permitted, they still must be preceded by a corresponding R_MIPS_HI16,
> although that is not required to be adjacent. I believe this is only
> permitted to allow cases like you quoted to avoid unnecessary extra code
> to add missing R_MIPS_HI16 relocations.
There are still potential problems though. We deliberately allow things like:
lui $4,%hi(foo)
lw $6,%lo(foo)($4)
lw $7,%lo(foo+4)($4)
...
.align 8
foo:
.word X, Y
and foo is allowed to be in a text section. Does your patch ensure that
foo remains 8-byte aligned, even if we relax code earlier in the section?
> Do you have a better idea?
TBH, my inclination is to remove it from trunk too. I imagine
GCC's LTO will catch many of the interesting cases (because then
we assemble the output object's text section at once).
Richard