[PATCH] s390: Do not use canonical PLT if pointer equality is not needed
Andreas Krebbel
krebbel@linux.ibm.com
Fri Mar 13 11:24:57 GMT 2026
Thank you Jens. I only found minor nits. Feel free to push with these
things addressed.
Andreas
On 3/4/26 3:41 PM, Jens Remus wrote:
> ...
> + /* GCC 12-14 unconditionally suffix non-local symbols
> + with @PLT, regardless of whether they are used in
> + function call instructions (i.e. brasl) or address
> + taking instructions (i.e. larl). Treat PLT32DBL
> + relocation for "larl rX,<sym>@PLT" instruction as
> + address taking and and require pointer equality. */
typo 2x and
> ...
> }
> @@ -3730,6 +3775,9 @@ elf_s390_finish_dynamic_symbol (bfd *output_bfd,
> }
> else
> {
> + if (!h->pointer_equality_needed)
> + abort ();
Perhaps?
BFD_ASSERT (h->pointer_equality_needed)
> ...
> diff --git a/ld/testsuite/ld-elf/pr29655b.c b/ld/testsuite/ld-elf/pr29655b.c
> new file mode 100644
> index 000000000000..ea1c38fb29c8
> --- /dev/null
> +++ b/ld/testsuite/ld-elf/pr29655b.c
> @@ -0,0 +1,14 @@
> +#ifndef __PIC__
> +#error "this file must be compiled with -fPIC"
> +#endif
> +
> +typedef void Fn();
> +void fun_public(void);
> +void call_callback(Fn *callback);
> +
> +int
> +main ()
> +{
> + fun_public ();
> + call_callback (fun_public);
> +}
return 0;
More information about the Binutils
mailing list