binutils-gdb/ld/testsuite/ld-mips-elf/mips16-local-stubs-1.s
YunQiang Su 3c8ed624ca MIPS/LD/testsuite: Fix MIPS16 interlinking test n64 regressions
The MIPS16 interlinking test for local functions expects to be assembled
with 32-bit addressing, otherwise causing assembly warnings:

.../ld/testsuite/ld-mips-elf/mips16-local-stubs-1.s: Assembler messages:
.../ld/testsuite/ld-mips-elf/mips16-local-stubs-1.s:16: Warning: la used to load 64-bit address; recommend using dla instead

Use the per-ABI framework then to run the test explicitly for o32 and
n32 ABIs only, replacing the `-mips4' option from the `as' tag with
`.module mips4' pseudo-op within the source itself so as to avoid
assembly errors:

Assembler messages:
Error: -mips4 conflicts with the other architecture options, which imply -mips3

with n32 testing for some targets, and ultimately removing these
regressions:

mips64-openbsd  -FAIL: MIPS16 interlinking for local functions 1
mips64el-openbsd  -FAIL: MIPS16 interlinking for local functions 1

Co-Authored-By: Maciej W. Rozycki <macro@orcam.me.uk>

	ld/
	* testsuite/ld-mips-elf/mips16-local-stubs-1.d: Remove `-mips4'
	from the `as' tag.
	* testsuite/ld-mips-elf/mips16-local-stubs-1.s: Add `.module
	mips4'.
	* testsuite/ld-mips-elf/mips-elf.exp: Run `mips16-local-stubs-1'
	for o32 and n32 ABIs only.
2023-07-28 06:00:36 +01:00

51 lines
742 B
ArmAsm

.module mips4
.macro makestub,type,func,section
.text
.set \type
.type \func,@function
.ent \func
\func:
jr $31
.end \func
.section \section,"ax",@progbits
.set nomips16
.type stub_for_\func,@function
.ent stub_for_\func
stub_for_\func:
.set noat
la $1,\func
jr $1
.set at
.end stub_for_\func
.endm
.macro makestubs,id
makestub nomips16,f\id,.mips16.call.F\id
makestub nomips16,g\id,.mips16.call.fp.G\id
makestub mips16,h\id,.mips16.fn.H\id
.endm
.macro makecaller,type,func
.text
.set \type
.globl \func
.type \func,@function
.ent \func
\func:
jal f1
jal f2
jal g1
jal g2
jal h1
jal h2
.end \func
.endm
makestubs 1
makestubs 2
makestubs 3
makecaller nomips16,caller1
makecaller mips16,caller2