On Fri, May 20, 2016 at 12:26 AM, Jason Young
<
red.wolf....@gmail.com> wrote:
>
> I got confused about the %fs:0xfffffffffffffff8, %rax. What does $fs point
> to ? and why 0xfffffffffffffff8 here.
%fs is an x86 segment register. It's used on ELF based systems as a
pointer to a thread local memory area. On x86 Go stores the current
goroutine pointer in the thread local memory area, so that it is
always easily available. The offset of -8 is simply the offset into
the thread local area where the goroutine pointer is stored. The
instructions you are looking at are generated by the get_tls macro in
the source; tls in this case is an abbreviation for thread local
storage.
Ian