News for hackers. Stuff that matters.
Re:Glibc getaddrinfo stack-based buffer overflow by AsyncAwait on Tuesday February 16, 2016 @03:07PM (#11112753)
Go 1.5 uses its own pure-Go DNS resolver.
Re:Glibc getaddrinfo stack-based buffer overflow by acln on Tuesday February 16, 2016 @08:06PM (#11114404)
Under certain conditions, it does not.

https://golang.org/pkg/net/#hdr-Name_Resolution

Re:Glibc getaddrinfo stack-based buffer overflow by justincormack on Wednesday February 17, 2016 @03:30AM (#11116251)
When it does not it dynamically links.
Re:Glibc getaddrinfo stack-based buffer overflow by takeda on Wednesday February 17, 2016 @11:56AM (#11119213)
That does not make sense.

Among others the page lists:

> [...] when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the Go resolver does not implement, and when the name being looked up ends in .local or is an mDNS name.

Those things you can't check at compile time.

In any case, you can tell whether the binary is statically linked or not.

Statically linked:

    $ file /usr/bin/consul 
    /usr/bin/consul: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
    $ ldd /usr/bin/consul
            not a dynamic executable
Dynamically linked:

    $ file /bin/echo
    /bin/echo: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
    $ ldd /bin/echo
            linux-vdso.so.1 =>  (0x00007fff01fff000)
            libc.so.6 => /lib64/libc.so.6 (0x0000003bcd800000)
            /lib64/ld-linux-x86-64.so.2 (0x0000003bcd000000)
Notice the libc.so.6