]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas: Default to -mrelax-relocations=no on Solaris/x86 [PR19520]
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Thu, 6 Nov 2025 16:18:16 +0000 (17:18 +0100)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Thu, 6 Nov 2025 16:18:16 +0000 (17:18 +0100)
commit70abf8984bdea3b67cf64bdceb94c2055bb8f4d7
tree28b386c9e35128e5aec25de86a10f8e058dea346
parent51b48a997d68537b2f8129d86b34fd84bae4082a
gas: Default to -mrelax-relocations=no on Solaris/x86 [PR19520]

I recently noticed a complex case statement in gas/configure.ac controlling
the setting of ac_default_x86_relax_relocations on Solaris/x86.  Since it
included all versions of Solaris, it could be massively simplified.

Looking closer however, I found that it was introduced in

commit 0cb4071ef9e10f703220f5e731141bf438aca16e
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Feb 3 08:25:15 2016 -0800

    Add -mrelax-relocations= to x86 assembler

based on PR gas/19520.  This PR reported that the new R_386_GOT32X
etc. relocations weren't supported on older versions of Solaris,
breaking gcc bootstrap.  In response, they were disabled on all Solaris
versions except Solaris 12, where they had been implemented in the
native toolchain based on my findings.

However, Solaris 12 has been rechristened to 11.4 before release,
effectively disabling DEFAULT_GENERATE_X86_RELAX_RELOCATIONS on all
versions of Solaris/x86.

Since Solaris 11.4 cannot be distinguished from earlier versions in
cross configurations, this patch fixes this by removing
--enable-x86-relax-relocations completely, instead disabling
DEFAULT_GENERATE_X86_RELAX_RELOCATIONS in tc-i386.c on Solaris.  It also
adds testcases to verify the -mrelax-relocations default.

Tested on {i386,amd64}-pc-solaris2.11 and {i686,x86_64}-pc-linux-gnu.

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

gas:
PR gas/19520
* configure.ac (ac_default_x86_relax_relocations): Remove.
<i386-*-solaris2* | x86_64-*-solaris2>: Likewise.
* configure: Regenerate.
* config.in: Regenerate.
* config/tc-i386.c (DEFAULT_GENERATE_X86_RELAX_RELOCATIONS): Define.
* doc/c-i386.texi (i386-Options, -mrelax-relocations): Remove
--enable-x86-relax-relocations reference.
* testsuite/gas/i386/gotx.s: New source.
* testsuite/gas/i386/gotx-default.d: New test.
* testsuite/gas/i386/no-gotx-default.d: Likewise.
* testsuite/gas/i386/i386.exp: Run them.
gas/config.in
gas/config/tc-i386.c
gas/configure
gas/configure.ac
gas/doc/c-i386.texi
gas/testsuite/gas/i386/gotx-default.d [new file with mode: 0644]
gas/testsuite/gas/i386/gotx.s [new file with mode: 0644]
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/no-gotx-default.d [new file with mode: 0644]