testsuite: Handle composed R_MIPS_NONE relocations
authorYunQiang Su <yunqiang.su@cipunited.com>
Fri, 28 Jul 2023 05:00:36 +0000 (06:00 +0100)
committerMaciej W. Rozycki <macro@orcam.me.uk>
Fri, 28 Jul 2023 05:00:36 +0000 (06:00 +0100)
commited4dca900c0dbc1317917cb289255d2f8d03f732
tree2ab6dd4cf81b476ac020a3ad795ef3af49701c5f
parentec76a6172f7b6d61f7d76c2bcf766122132116b8
testsuite: Handle composed R_MIPS_NONE relocations

MIPS n64 ABI has a peculiarity where all relocations are composed of
three, with subsequent relocation types set to R_MIPS_NONE if further
calculation is not required.  Example output produced by `readelf' and
`objdump' for such relocations is:

  Offset          Info           Type           Sym. Value    Sym. Name + Addend
000000000000  000800000002 R_MIPS_32         0000000000000000 foo + 0
                    Type2: R_MIPS_NONE
                    Type3: R_MIPS_NONE

and:

OFFSET           TYPE              VALUE
0000000000000000 R_MIPS_32         foo
0000000000000000 R_MIPS_NONE       *ABS*
0000000000000000 R_MIPS_NONE       *ABS*

respectively.  The presence of these extra R_MIPS_NONE entries is not
relevant for generic or even some MIPS tests, so optionally match them
with the respective dump patterns, also discarding `xfail' annotation
for MIPS/OpenBSD targets from gas/elf/missing-build-notes.d, removing
these regressions:

mips64-openbsd  -FAIL: readelf -r bintest
mips64-openbsd  -FAIL: forward expression
mips64-openbsd  -FAIL: assignment tests
mips64-openbsd  -FAIL: gas/all/none
mips64-openbsd  -XFAIL: gas/elf/missing-build-notes
mips64-openbsd  -FAIL: macro test 2
mips64-openbsd  -FAIL: macro irp
mips64-openbsd  -FAIL: macro rept
mips64-openbsd  -FAIL: nested irp/irpc/rept
mips64-openbsd  -FAIL: macro vararg
mips64-openbsd  -FAIL: mips jalx
mips64-openbsd  -FAIL: ST Microelectronics Loongson-2F workarounds of Jump Instruction issue
mips64el-openbsd  -FAIL: readelf -r bintest
mips64el-openbsd  -FAIL: forward expression
mips64el-openbsd  -FAIL: assignment tests
mips64el-openbsd  -FAIL: gas/all/none
mips64el-openbsd  -XFAIL: gas/elf/missing-build-notes
mips64el-openbsd  -FAIL: macro test 2
mips64el-openbsd  -FAIL: macro irp
mips64el-openbsd  -FAIL: macro rept
mips64el-openbsd  -FAIL: nested irp/irpc/rept
mips64el-openbsd  -FAIL: macro vararg
mips64el-openbsd  -FAIL: mips jalx
mips64el-openbsd  -FAIL: ST Microelectronics Loongson-2F workarounds of Jump Instruction issue

Co-Authored-By: Maciej W. Rozycki <macro@orcam.me.uk>
binutils/
* testsuite/binutils-all/readelf.r-64: Optionally match extra
R_MIPS_NONE pairs.

gas/
* testsuite/gas/all/assign.d: Optionally match extra
R_MIPS_NONE pairs.
* testsuite/gas/all/fwdexp.d: Likewise.
* testsuite/gas/all/none.d: Likewise.
* testsuite/gas/macros/irp.d: Likewise.
* testsuite/gas/macros/repeat.d: Likewise.
* testsuite/gas/macros/rept.d: Likewise.
* testsuite/gas/macros/test2.d: Likewise.
* testsuite/gas/macros/vararg.d: Likewise.
* testsuite/gas/mips/compact-eh-eb-1.d: Likewise.
* testsuite/gas/mips/compact-eh-eb-2.d: Likewise.
* testsuite/gas/mips/compact-eh-eb-3.d: Likewise.
* testsuite/gas/mips/compact-eh-eb-4.d: Likewise.
* testsuite/gas/mips/compact-eh-eb-5.d: Likewise.
* testsuite/gas/mips/compact-eh-eb-6.d: Likewise.
* testsuite/gas/mips/compact-eh-el-1.d: Likewise.
* testsuite/gas/mips/compact-eh-el-2.d: Likewise.
* testsuite/gas/mips/compact-eh-el-3.d: Likewise.
* testsuite/gas/mips/compact-eh-el-4.d: Likewise.
* testsuite/gas/mips/compact-eh-el-5.d: Likewise.
* testsuite/gas/mips/compact-eh-el-6.d: Likewise.
* testsuite/gas/mips/loongson-2f-3.d: Likewise.
* testsuite/gas/mips/mips-jalx.d: Likewise.
* testsuite/gas/elf/missing-build-notes.d: Likewise.  Remove
the `xfail' tag.

ld/
* testsuite/ld-mips-elf/reloc-estimate-1.d: Optionally match
extra R_MIPS_NONE pairs.
25 files changed:
binutils/testsuite/binutils-all/readelf.r-64
gas/testsuite/gas/all/assign.d
gas/testsuite/gas/all/fwdexp.d
gas/testsuite/gas/all/none.d
gas/testsuite/gas/elf/missing-build-notes.d
gas/testsuite/gas/macros/irp.d
gas/testsuite/gas/macros/repeat.d
gas/testsuite/gas/macros/rept.d
gas/testsuite/gas/macros/test2.d
gas/testsuite/gas/macros/vararg.d
gas/testsuite/gas/mips/compact-eh-eb-1.d
gas/testsuite/gas/mips/compact-eh-eb-2.d
gas/testsuite/gas/mips/compact-eh-eb-3.d
gas/testsuite/gas/mips/compact-eh-eb-4.d
gas/testsuite/gas/mips/compact-eh-eb-5.d
gas/testsuite/gas/mips/compact-eh-eb-6.d
gas/testsuite/gas/mips/compact-eh-el-1.d
gas/testsuite/gas/mips/compact-eh-el-2.d
gas/testsuite/gas/mips/compact-eh-el-3.d
gas/testsuite/gas/mips/compact-eh-el-4.d
gas/testsuite/gas/mips/compact-eh-el-5.d
gas/testsuite/gas/mips/compact-eh-el-6.d
gas/testsuite/gas/mips/loongson-2f-3.d
gas/testsuite/gas/mips/mips-jalx.d
ld/testsuite/ld-mips-elf/reloc-estimate-1.d