Patch to improve MIPS %hi/%lo matching

Thiemo Seufer ica2_ts@csv.ica.uni-stuttgart.de
Sat Jul 3 11:25:00 GMT 2004


Richard Sandiford wrote:
[snip]
> 	* config/tc-mips.c (HAVE_IN_PLACE_ADDENDS): New macro.
> 	(reloc_needs_lo_p): Only return true if HAVE_IN_PLACE_ADDENDS.
> 	(mips_frob_file): Rework so that only a single pass through the
> 	relocs is needed.  Allow %lo()s to have higher offsets than their
> 	corresponding %hi()s or %got()s.
> 
> testsuite/
> 	* gas/mips/elf{,el}-rel.d: Adjust so that the earliest %hi() matches
> 	the earliest %lo().
> 	* gas/mips/elf-rel9.[sd]: Fix typo in %lo() expression.
> 	* gas/mips/elf-rel11.d: Don't expect the relocs to be reordered.
> 	* gas/mips/elf-rel20.[sd]: New test.
> 	* gas/mips/mips.exp: Run it.

Ok.

> !       /* If we found a match, remove the high-part relocation from its
> ! 	 current position and insert it before the low-part relocation.
> ! 	 Make the offsets match so that fixup_has_matching_lo_p()
> ! 	 will return true.
> ! 
> ! 	 We don't warn about unmatched high-part relocations since some
> ! 	 versions of gcc have been known to emit dead "lui ...%hi(...)"
> ! 	 instructions.  */

Which versions of gcc exactly? Or is the "have been known" part
actually true? :-)


Thiemo



More information about the Binutils mailing list