[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-13 Thread nsz at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 nsz at gcc dot gnu.org changed: What|Removed |Added CC||nsz at gcc dot gnu.org ---

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #39 from Richard Biener --- (In reply to H.J. Lu from comment #32) > (In reply to Michael Matz from comment #31) > > (In reply to H.J. Lu from comment #30) > > > (In reply to Michael Matz from comment #29) > > > > It not only can

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #38 from H.J. Lu --- The new glibc patch set covers both i386 and x86-64: https://patchwork.sourceware.org/project/glibc/list/?series=30854

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread schwab--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #37 from Andreas Schwab --- No, it uses whatever __rtld_malloc points at, which will be the normal malloc after bootstrap.

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #36 from H.J. Lu --- (In reply to Andreas Schwab from comment #35) > ld.so use its internal malloc only during bootstrapping. ___tls_get_addr always uses the internal malloc.

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread schwab--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #35 from Andreas Schwab --- ld.so use its internal malloc only during bootstrapping.

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #34 from H.J. Lu --- (In reply to H.J. Lu from comment #33) > (In reply to H.J. Lu from comment #32) > > (In reply to Michael Matz from comment #31) > > > (In reply to H.J. Lu from comment #30) > > > > (In reply to Michael Matz from

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #33 from H.J. Lu --- (In reply to H.J. Lu from comment #32) > (In reply to Michael Matz from comment #31) > > (In reply to H.J. Lu from comment #30) > > > (In reply to Michael Matz from comment #29) > > > > It not only can call

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #32 from H.J. Lu --- (In reply to Michael Matz from comment #31) > (In reply to H.J. Lu from comment #30) > > (In reply to Michael Matz from comment #29) > > > It not only can call malloc. As the backtrace of H.J. shows, it quite >

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread matz at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #31 from Michael Matz --- (In reply to H.J. Lu from comment #30) > (In reply to Michael Matz from comment #29) > > It not only can call malloc. As the backtrace of H.J. shows, it quite > > clearly _does_ so :-) > > ld.so can only

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #30 from H.J. Lu --- (In reply to Michael Matz from comment #29) > It not only can call malloc. As the backtrace of H.J. shows, it quite > clearly _does_ so :-) > ld.so can only call the malloc implementation internal to ld.so.

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread matz at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #29 from Michael Matz --- It not only can call malloc. As the backtrace of H.J. shows, it quite clearly _does_ so :-) That's why there is talk earlier in this report about potentially not using malloc as one-time allocator for

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #28 from H.J. Lu --- (In reply to Jakub Jelinek from comment #27) > (In reply to H.J. Lu from comment #26) > > Even if I compile ia32 glibc with -march=skylake, the _dl_tlsdesc_dynamic > > slow > > path doesn't touch XMM registers

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #27 from Jakub Jelinek --- (In reply to H.J. Lu from comment #26) > Even if I compile ia32 glibc with -march=skylake, the _dl_tlsdesc_dynamic > slow > path doesn't touch XMM registers at all. I thought Florian said it can call

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #26 from H.J. Lu --- (In reply to Jakub Jelinek from comment #25) > (In reply to H.J. Lu from comment #23) > > > And i386/dl-tlsdesc.S needs to save/restore 387 and SSE regs? > > > > i386 doesn't preserve them in

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #25 from Jakub Jelinek --- (In reply to H.J. Lu from comment #23) > > And i386/dl-tlsdesc.S needs to save/restore 387 and SSE regs? > > i386 doesn't preserve them in _dl_runtime_resolve nor _dl_tlsdesc_dynamic. That is different.

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 H.J. Lu changed: What|Removed |Added Resolution|--- |MOVED Status|NEW

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #23 from H.J. Lu --- (In reply to Jakub Jelinek from comment #22) > BTW, does aarch64 dl-tlsdesc.S save SVE/SME register state (I only see fixed > offsets in there), or are those call-saved? > What about floating point registers in

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #22 from Jakub Jelinek --- BTW, does aarch64 dl-tlsdesc.S save SVE/SME register state (I only see fixed offsets in there), or are those call-saved? What about floating point registers in x86_64/dl-tlsdesc.S? And i386/dl-tlsdesc.S

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #21 from H.J. Lu --- (In reply to Florian Weimer from comment #20) > (In reply to H.J. Lu from comment #19) > > (In reply to Florian Weimer from comment #9) > > > (In reply to H.J. Lu from comment #7) > > > > > The __tls_get_addr

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread fw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #20 from Florian Weimer --- (In reply to H.J. Lu from comment #19) > (In reply to Florian Weimer from comment #9) > > (In reply to H.J. Lu from comment #7) > > > > The __tls_get_addr call with the default approach potentially needs

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #19 from H.J. Lu --- (In reply to Florian Weimer from comment #9) > (In reply to H.J. Lu from comment #7) > > > The __tls_get_addr call with the default approach potentially needs to > > > solve > > > the same problem, doesn't it?

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread fw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #18 from Florian Weimer --- (In reply to Richard Biener from comment #16) > I do wonder why __tls_get_addr would have to call the overloaded malloc, can > we just not force-bind it to the glibc local malloc (and make sure that's >

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #17 from Richard Biener --- (In reply to Richard Biener from comment #16) > I do wonder why __tls_get_addr would have to call the overloaded malloc, can > we just not force-bind it to the glibc local malloc (and make sure that's >

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #16 from Richard Biener --- I do wonder why __tls_get_addr would have to call the overloaded malloc, can we just not force-bind it to the glibc local malloc (and make sure that's compiled with -mgeneral-regs-only)?

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #15 from Jakub Jelinek --- Because right now it also means it needs to save/restore the APX registers because malloc could be -mapxf compiled even when glibc isn't.

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 Richard Biener changed: What|Removed |Added CC||matz at gcc dot gnu.org --- Comment

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #12 from Jakub Jelinek --- (In reply to Florian Weimer from comment #11) > (In reply to Richard Biener from comment #10) > > I think a glibc fix would be very much preferred. > > It's a bit of a maintenance nightmare because we

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #13 from Jakub Jelinek --- BTW, isn't _mcount similar in this regard?

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread fw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #11 from Florian Weimer --- (In reply to Richard Biener from comment #10) > I think a glibc fix would be very much preferred. It's a bit of a maintenance nightmare because we have to update the code slightly each time new registers

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 Richard Biener changed: What|Removed |Added CC||rguenth at gcc dot gnu.org ---

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-11 Thread fw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #9 from Florian Weimer --- (In reply to H.J. Lu from comment #7) > > The __tls_get_addr call with the default approach potentially needs to solve > > the same problem, doesn't it? > > Isn't __tls_get_addr called via the PLT entry?

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-11 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #8 from Jakub Jelinek --- E.g. https://sourceware.org/legacy-ml/binutils/2005-09/msg00184.html says The functions defined above use custom calling conventions that require them to preserve any registers they modify. This penalizes

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-11 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #7 from H.J. Lu --- (In reply to Florian Weimer from comment #6) > > (In reply to H.J. Lu from comment #4) > > > (In reply to H.J. Lu from comment #3) > > > > Created attachment 57385 [details] > > > > A patch > > > > > > > > Try

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-11 Thread fw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #6 from Florian Weimer --- > (In reply to H.J. Lu from comment #4) > > (In reply to H.J. Lu from comment #3) > > > Created attachment 57385 [details] > > > A patch > > > > > > Try this. > > > > This doesn't work properly. To work

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-11 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #5 from Jakub Jelinek --- (In reply to H.J. Lu from comment #4) > (In reply to H.J. Lu from comment #3) > > Created attachment 57385 [details] > > A patch > > > > Try this. > > This doesn't work properly. To work around in ld.so,

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-11 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 H.J. Lu changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever confirmed|0

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-11 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #3 from H.J. Lu --- Created attachment 57385 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57385=edit A patch Try this.

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-11 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 Jakub Jelinek changed: What|Removed |Added CC||aoliva at gcc dot gnu.org,

[Bug target/113874] GNU2 TLS descriptor calls do not follow psABI on x86_64-linux-gnu

2024-02-11 Thread fw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113874 --- Comment #1 from Florian Weimer --- Brought to the x86-64 ABI list: GCC and the GNU2 TLS descriptor call ABI