[PATCH v2] ld: testsuite: Simplify emulation check in libgot tests
Maciej W. Rozycki
macro@orcam.me.uk
Sat Jan 24 22:38:35 GMT 2026
On Sat, 24 Jan 2026, Rainer Orth wrote:
> while I still like this approach because it allows to extend test
> coverage to i386 ELF targets without -melf_i386, I primarily would like
> to go this way to enable removing the non-*_sol2 emulations from native
> Solaris gld. They are never used outside of the ld testsuite, and I'd
> rather test the native elf_i386_sol2 etc. emulations that *are* actually
> used.
>
> I guess I'll try this in ld-sparc first, where hardcoded
> -melf32_sparc/elf64_sparc are only used 54 times, rather than
> -melf_i386/elf_x86_64 (869 times).
>
> I guess I'll try setting emul32/emul64 once in ld-lib.exp, then replace
> all hardcoded instances of -m<emul> by $emul32/$emul64.
You might consider the MIPS approach where we also used to have an issue
with various targets using different emulations while still wanting to
verify non-default ones (legitimate for several MIPS targets) and came up
with an arrangement where the emulations selected are derived from the
target triplet. Yes, it's a zoo, but so is the MIPS target collection.
See the `abi_ldflags' setting in ld/testsuite/ld-mips-elf/mips-elf.exp
for details.
Maciej
More information about the Binutils
mailing list