[PATCH] s390: Do not use canonical PLT if pointer equality is not needed

Jens Remus jremus@linux.ibm.com
Mon Mar 16 16:52:00 GMT 2026


On 3/13/2026 12:24 PM, Andreas Krebbel wrote:
> Thank you Jens. I only found minor nits. Feel free to push with these
> things addressed.

Thank you!  Sending a v2, as I would like to get feedback from one of
the global maintainers due to the added common test case.

> 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

Fixed.

>> ...
>>       }
>> @@ -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)

I ported that from x86-64, so I would prefer to keep it the same.

>> 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;

Fixed.

Regards,
Jens
-- 
Jens Remus
Linux on Z Development (D3303)
jremus@de.ibm.com / jremus@linux.ibm.com

IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Ehningen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/



More information about the Binutils mailing list