[PATCH 5/5] ix86: restrict use of GOT32X relocs

H.J. Lu hjl.tools@gmail.com
Mon Feb 3 22:41:42 GMT 2025


On Mon, Feb 3, 2025 at 7:42 PM Jan Beulich <jbeulich@suse.com> wrote:
>
> The linker rejects use of this reloc type without a base register for
> PIC code. Suppress its use by gas in such cases.
> ---
> The linker also rejects use of GOT32, but that's an issue the programmer
> has to deal with. In the assembler we need to avoid doing something
> wrong that the programmer has not explicitly asked for.
>
> --- a/gas/config/tc-i386.c
> +++ b/gas/config/tc-i386.c
> @@ -12990,7 +12990,8 @@ output_disp (fragS *insn_start_frag, off
>                         }
>                     }
>                   else if (generate_relax_relocations
> -                          || (i.rm.mode == 0 && i.rm.regmem == 5))
> +                          ? (!shared || i.rm.mode != 0 || i.rm.regmem != 5)
> +                          : (!shared && i.rm.mode == 0 && i.rm.regmem == 5))
>                     fixP->fx_tcbit2 = 1;
>                 }
>             }
>

Please add a testcase to show it makes a difference.

Thanks.

-- 
H.J.


More information about the Binutils mailing list