[PATCH v14 0/9] Add rseq extensible ABI support

Florian Weimer fweimer@redhat.com
Mon Dec 30 09:32:41 GMT 2024


* Mathieu Desnoyers:

>> So it looks like that TLS_DTV_AT_TP part doesn't work, unfortunately.
>> I see many new failures (after the mentioned revert) on powerpc64le,
>> which is one of those targets.  I haven't tried to reproduce them yet
>> on AArch64.  The GCC compile farm has a powerpc64le test machine
>> (gcc120.fsffrance.org).
>
> I recall that Michael did test on at least one architecture
> with TLS_DTV_AT_TP (aarch64), and one with TLS_TCB_AT_TP (x86-64).
>
> The issue may be specific to powerpc.

Maybe it's caused by a non-zero TLS_TP_OFFSET.  We use a shifted thread
pointer on POWER, presumably to increase the reach of signed
displacements in TLS-accessing instructions.

This is alluded to in this comment:

#ifdef RSEQ_SIG
    /* This should be a compile-time constant, but the current
       infrastructure makes it difficult to determine its value.  Not
       all targets support __thread_pointer, so set __rseq_offset only
       if the rseq registration may have happened because RSEQ_SIG is
       defined.  */
    _rseq_offset = (char *) &pd->rseq_area - (char *) __thread_pointer ();
#endif

If this is indeed the cause, we should define TLS_TP_OFFSET on all
architectures and use it to initialize __rseq_offset.  Similar to what I
started here:

  [PATCH 1/4] elf: Introduce generic <dl-tls.h>
  <https://inbox.sourceware.org/libc-alpha/1b470b147d0bfe51af6256b10cd38c14285a61b2.1735313702.git.fweimer@redhat.com/>

Thanks,
Florian



More information about the Libc-alpha mailing list