This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] x86-64: Use direct TLS initial-exec access to update errno
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 4 Dec 2017 16:21:39 -0800
- Subject: Re: [PATCH] x86-64: Use direct TLS initial-exec access to update errno
- Authentication-results: sourceware.org; auth=none
- References: <20171204231315.GA17402@intel.com> <755bd730-80d2-018e-f583-ff2b661a046e@redhat.com>
On Mon, Dec 4, 2017 at 3:33 PM, Carlos O'Donell <carlos@redhat.com> wrote:
> On 12/04/2017 05:13 PM, H.J. Lu wrote:
>> Replace __errno_location call with direct TLS initial-exec access to
>> update errno.
>>
>> Any comments?
>
> What are the consequences of this change?
3 function calls are removed.
> Have you tried debugging this code in gdb and does it make it easier or
> harder to debug a single threaded application?
gdb 8 works fine:
(gdb) r
Starting program: /export/build/gnu/glibc/build-x86_64-linux/math/test-float-sin
testing float (without inline functions)
Breakpoint 1, sinf () at ../sysdeps/x86_64/fpu/s_sinf.S:339
339 movq errno@gottpoff(%rip), %rax
(gdb) p errno
$1 = 0
(gdb) next
340 movl $EDOM, %fs:(%rax)
(gdb)
345 movaps %xmm7, %xmm0 /* load x */
(gdb) p errno
$2 = 33
(gdb)
> Why make these changes?
It is motivated by
https://sourceware.org/ml/libc-alpha/2017-12/msg00101.html
--
H.J.