[PATCH] gas: Fix -mrelax-relocations detection on Solaris/x86 [PR19520]

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Sun Oct 12 12:42:32 GMT 2025


Hi H.J.,

>> > However, given that the support has effectively been disabled on Solaris
>> > since the release of Solaris 11.4 back in 2018, I wonder if it wouldn't
>> > be better to simplify things massively: rip out the
>> > --enable-x86-relax-relocations configure option together with
>> > -mrelax-relocations (either silently ignoring it or rejecting it), at
>> > the same time disabling the support on Solaris completely as it has been
>> > for the last 7 years.
>>
>> This may be an option, but H.J. - could you please comment here?

> I am OK with it as long as there is no change for Linux/x86.

Unfortunately, you haven't really commented on my suggestion above.
There are several options, I believe:

* Just set ac_default_x86_relax_relocations=0 unconditionally when
  targetting Solaris/x86.  That's the easiest solution and is
  effectively identical the same as the current state, only with less
  code to achive it.  However, it leaves tons of code to handle non-gotx
  targets when Solaris is the only one.

* Rip out gas/configure.ac's --enable-x86-relax-relocations handling and
  set   DEFAULT_GENERATE_X86_RELAX_RELOCATIONS to 0 in tc-i386.h if
  TE_SOLARIS.  That still leaves all the code for handling non-gotx
  around.

* Remove (most of) -mrelax-relocations, either completely so you get an
  error when you try to use it, or silently ignore
  -mrelax-relocations=yes and error out on -mrelax-relocations=no.  If
  that option is used outside the binutils testsuite, that would be an
  incompatible change, so may be unacceptable.  At least in all of the
  gcc testsuite, the option isn't used at all and I don't see why any
  target would wont to use it.

  If going that route, all testcases using -mrelax-relocations=yes would
  need to have that option removed and be skipped on Solaris.  The tests
  with -mrelax-relocations=no would be removed.  That's the most
  intrusive variant, but would allow to remove all the code that isn't
  needed on any non-Solaris target.

  There's one risk, however: it's practically guaranteed that when
  future testcases that use gotx relocs are added, the skipping part is
  forgotten, having to fix them up over and over again.

  As a middle ground, one could deprecate -mrelax-relocations now and
  remove it later.  I have no idea if this is necessary, though.

Your call.

	Rainer

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


More information about the Binutils mailing list