[PATCH] Cleanup bfd target vectors and ld emulations on Solaris

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Mon Dec 1 13:31:06 GMT 2025


This patch is a major cleanup of the Solaris configurations of both bfd and ld.

The Solaris cases in both bfd/config.bfd and ld/configure.tgt have seen a
major cleanup, making the support for various Solaris versions explicit,
correcting several inconsistencies, and making it easier to remove support
for some versions in the future.

* All 32-bit-only configurations (Solaris < 7 on SPARC, Solaris < 10 on
  x86) only include the 32-bit target vectors and linker emulations.

* For 32-bit-default targets on 64-bit systems (Solaris >= 7 on SPARC,
  Solaris >= 10 on x86), the 32-bit target vectors and linker emulations
  are the default while supporting the 64-bit ones.

* For 64-bit-default targets on 64-bit systems, it's the other way round.
  They default to 64-bit target vectors etc. while also supporting the
  32-bit ones.

* On x86, the iamcu target vectors and linker emulations have been
  removed: Solaris never supported the Intel MCU.

* On x86, the PE and PEI target vectors have been removed: they were only
  supported in binutils proper.  Their only use would be on EFI files
  e.g. in GRUB, which doesn't justify their inclusion.

* With iamcu support gone, a few gas tests had to be disabled as on
  VxWorks.

* The 32-bit Solaris/x86 ld configuration currently includes the
  elf_i386_ldso emulation, which was never a emulation in its own right but
  just an implementation detail of the elf_i386_sol2 emulation.  Instead,
  the settings that are not already provided by sourced .sh files are moved
  into elf_i386_sol2.sh.  Many settings became superfluous by just sourcing
  elf_i386.sh as is already done in elf_x86_64_sol2.sh, massively
  simplifying the emulation.

* Solaris-specific settings in generic emulparams scripts have been moved
  to the *_sol2.sh files.

* NATIVE_LIB_DIRS in ld/configure.tgt now uses the default setting:
  /usr/ccs/lib contains just a bunch of symlinks into /usr/lib at least
  since Solaris 8.

* ld/emulparams/solaris2.sh now sets ELF_INTERPRETER_NAME to
  /usr/lib/amd64/ld.so.1, matching both the native linker and
  elf_i386_sol2.sh.

* The SEARCH_DIR statements in linker scripts on 64-bit targets contained
  both the native (64-bit) and non-default (32-bit) directies.  The latter
  are completely pointless and are omitted using a new
  LIBPATH_SKIP_NONNATIVE setting.

Tested on {amd64,i386}-pc-solaris2.11 and {sparcv9,sparc}-sun-solaris2.11,
and {x86_64,i686}-pc-linux-gnu as well as with gcc trunk bootstraps on the
Solaris targets.  On those, I've compared the gas/ld and gas/gld 2.45.50
testresults with 2.45 ones.

Ok for trunk?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2025-09-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	bfd:
	* config.bfd <i[3-7]86-*-solaris2*>: Split into ...
	<i[3-7]86-*-solaris2.1[01]*> ... this.
	(targ_selvecs): Remove iamcu_elf32_vec, i386_coff_vec, i386_pei_vec.
	(targ64_selvecs): Remove x86_64_pe_vec, x86_64_pei_vec.
	<i[3-7]86-*-solaris2.[0-9]*>: ... and this.
	[BFD64] <x86_64-*-solaris2*>: Change into x86_64-*-solaris2.1[01]*.
	(targ_defvecs): Change to x86_64_elf64_sol2_vec.
	(targ_selvecs): Remove iamcu_elf32_vec, i386_coff_vec,
	i386_pei_vec, x86_64_pe_vec, x86_64_pei_vec.
	<sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*>: Split into	...
	<sparc-*-solaris2.[7-9]* | sparc-*-solaris2.1[01]*>: ... this.
	<sparc-*-solaris2.[0-6]*>: ... this.
	[BFD64] <sparc-*-solaris2* | sparcv9-*-solaris2* |
	sparc64-*-solaris2*>: Omit sparc-*-solaris2*.
	(targ_defvec): Swap with targ_selvecs.

	* testsuite/gas/i386/i386.exp: Disable iamcu tests on Solaris.

	ld:
	* configure.tgt <i[3-7]86-*-solaris2>: Split into ...
	<i[3-7]86-*-solaris2.1[01]*>: .. this.
	(targ_extra_emuls): Remove elf_i386_ldso and elf_iamcu.
	<i[3-7]86-*-solaris2.[0-9]*>: ... and this.
	<sparc64-*-solaris2*, sparcv9-*-solaris2*>: Change into ...
	<sparc64-*-solaris2.[7-9]* | sparc64-*-solaris2.1[01]* |
	sparcv9-*-solaris2.[7-9]* | sparcv9-*-solaris2.1[01]*>: ... this
	(targ_extra_emuls): Reorder.
	(tdir_elf32_sparc): Remove.
	<sparc-*-solaris2.[7-9]* | sparc-*-solaris2.1[01]*>: New case.
	<sparc-*-solaris2.[0-6]*, sparc-*-solaris2.[0-6].*>: Change into ...
	<sparc-*-solaris2.[0-6]*>: ... this.
	<sparc-*-solaris2*>: Remove.
	<x86_64-*-solaris2*>: Change into ...
	<x86_64-*-solaris2.1[01]*>: ... this.
	(targ_extra_emuls): Reorder.  Remove elf_i386_ldso, elf_iamcu.
	(tdir_elf_i386): Remove.
	(NATIVE_LIB_DIRS): Remove Solaris handling.

	* emulparams/elf32_sparc_sol2.sh (ELF_INTERPRETER_NAME): New
	variable.
	* emulparams/elf64_sparc.sh <sparc*-solaris*> (LIBPATH_SUFFIX):
	Move ...
	* emulparams/elf64_sparc_sol2.sh: ... here.
	(LIBPATH_SKIP_NONNATIVE): New variable.
	(ELF_INTERPRETER_NAME): Likewise.
	* emulparams/elf_i386_ldso.sh: Merge into ...
	* emulparams/elf_i386_sol2.sh: ... this.
	Remove duplicate variables.
	Source elf_i386.sh instead of elf_i386_ldso.sh.
	* emulparams/elf_x86_64.sh <*-*-solaris2*> (ELF_INTERPRETER_NAME):
	Move ...
	* emulparams/elf_x86_64_sol2.sh: ... here.
	Use /usr/lib/amd64/ld.so.1.
	(LIBPATH_SKIP_NONNATIVE): New variable.
	* emulparams/solaris2.sh: Fix comment.

	* genscripts.sh: Fix typos.
	Heed LIBPATH_SKIP_NONNATIVE.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sol2-bfd-target_vec-ldemul-cleanup.patch
Type: text/x-patch
Size: 11241 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20251201/86a9de1e/attachment.bin>


More information about the Binutils mailing list