MIPS HI16 and LO16 reloc howtos

Maciej W. Rozycki macro@orcam.me.uk
Tue Apr 2 11:19:50 GMT 2024


On Tue, 2 Apr 2024, Alan Modra wrote:

> 	PR 19977
> 	* elf32-mips.c: Correct rightshift for HI16, HIGHER and HIGHEST
> 	reloc howtos.  Correct complain_on_overflow for LO16 relocs.
> 	* elf64-mips.c: Likewise.
> 	* elfn32-mips.c: Likewise.
> 
> OK?  This is a prerequisite to fixing PR19977.

 It does seem to me like a correct change to make, so OK.  Thank you for 
working on this issue.

 NB I pushed this through regression testing for additional safety and 
noticed numerous:

FAIL: gas/all/none

regressions.  As it happened there was one:

FAIL: Output file must be distinct from input

failure too and gas/testsuite/gas/all/none.s got replaced with ELF output:

$ file gas/testsuite/gas/all/none.s
gas/testsuite/gas/all/none.s: ELF 32-bit MSB relocatable, MIPS, MIPS-I version 1 (SYSV), not stripped

This comes from gas/testsuite/gas/all/gas.exp, where we have:

if { ![ishost "*-*-mingw*"] } then {
    gas_test_error "none.s" "-o $srcdir/$subdir/none.s" "Output file must be distinct from input"
}

which I think is an ill way to run a test, as it risks source corruption 
in the case of a failure, which is exactly what happened here.  I think a copy of the 
source file has to be made in the testsuite object directory and operated 
on instead.

 Why the failure happened is another matter; it seems intermittent and 
happened exactly once for a single varying target in all my test runs 
starting from Jul 29th, 2023, hmm...

  Maciej


More information about the Binutils mailing list