https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66631

--- Comment #18 from Stas Sergeev <stsp at users dot sourceforge.net> ---
(In reply to Andy Lutomirski from comment #17)
> I'll chime in, possibly uselessly.
> 
> Before Linux 4.1, only CS was saved.  (Unless you go *way* back.)  In  4.1
> or newer, SS is saved, too.
> 
> In 64-bit code, DS and ES have no effect*, so I don't think it should affect
> code gen.
OK, so the problem is TLS-specific, and is therefore
have less relevance to gcc. Indeed it then will be very
good if the kernel can take care of TLS.
My point was just that for gcc it may not be a big
problem to implement a segreg clobbering, if the kernel
devs don't want to restore TLS.

> Anyway, I tend to agree with Andrew here, I think: if you want to fiddle
> with FS and GS, write a little asm wrapper around the C code.
Yes but what kind of wrapper?
Should it do also the syscall to set the needed fs base?
At one point I may start pestering glibc guys to provide
such a wrapper, if everyone else is unhelpful. :)

Reply via email to