Disable R_X86_64_PLT32 generation as branch marker on Solaris/x86

H.J. Lu hjl.tools@gmail.com
Wed Apr 3 12:43:00 GMT 2019


On Wed, Mar 27, 2019 at 9:51 AM Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>
> The fix H.J. implemented for PR gas/22791 in the thread starting at
>
>         [PATCH] x86-64: Treat PC32 relocation with branch as PLT32
>         https://sourceware.org/ml/binutils/2018-02/msg00065.html
>
> is causing problems on Solaris/x86.  The native linker is strongly
> preferred there, and there's no intention of implementing the linker
> optimization he plans there.  Besides, the kernel runtime linker,
> otherwise has no need to deal with that reloc at all, and instead of
> adding (possibly even more) workarounds with no benefit, it seems
> appropriate to disable the R_X86_64_PLT32 generation as branch marker on
> Solaris/x86 in the first place.
>
> The patch itself is trivial, the only complication is adapting the
> testsuite.  Since I've found no way to have conditional sections in the
> .d files, I've instead used the solution already found elsewhere of
> having separate .d files for the affected tests on Solaris and selecting
> the right one in i386/i386.exp.
>
> Tested on amd64-pc-solaris2.11 and x86_64-pc-linux-gnu without
> regressions.  Ok for master (and perhaps the 2.32 branch)?
>
> Thanks.
>         Rainer
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
>
>
> 2019-03-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>
>         * config/tc-i386.c (need_plt32_p) [TE_SOLARIS]: Return FALSE.
>         * testsuite/gas/i386/reloc64-solaris.d,
>         testsuite/gas/i386/x86-64-jump-solaris.d,
>         testsuite/gas/i386/x86-64-mpx-branch-1-solaris.d,
>         testsuite/gas/i386/x86-64-mpx-branch-2-solaris.d,
>         testsuite/gas/i386/x86-64-nop-3-solaris.d,
>         testsuite/gas/i386/x86-64-nop-4-solaris.d,
>         testsuite/gas/i386/x86-64-nop-5-solaris.d,
>         testsuite/gas/i386/x86-64-relax-2-solaris.d,
>         testsuite/gas/i386/x86-64-relax-3-solaris.d: New tests.
>         * testsuite/gas/i386/i386.exp: Use non-R_X86_64_PLT32 variants on
>         Solaris.
>

This may not be the first case where Solaris wants to be different.
Please create a subdirectory, solaris, with copies of those tests and
skip original tests for Solaris targets so that the original tests can be
updated without affecting Solaris targets.

Thanks.

-- 
H.J.



More information about the Binutils mailing list