libpthread: pthread_exit in static app. segfaults

Static applications that call pthread_exit on the main thread segfault.
This is because after a thread terminates __uClibc_main decrements
__nptl_nthreads which is only defined in pthread_create.
Therefore the right solution is to add a requirement to pthread_create
from pthread_exit.
This patch has been backported from glibc tree:
http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=e1f0b2cfa14b058ab033431b70428ccda8ec6ed0
For further detail see also glibc bug at:
http://sourceware.org/bugzilla/show_bug.cgi?id=12310

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Cc: Vladimir Nikulichev  <v.nikulichev@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
insque: fix segfault on (prev == NULL)

Since version 2.5 glibc allows prev to be a NULL pointer in insque, whereas
uClibc segfaults in this case. This fixes the issue and makes insque
initialize q_forw and q_back with NULLs if prev == NULL.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc/sysdeps/linux/common/sendfile.c: fix sendfile64 visibility

Commit a83ea57a50 introduces code for falling back on sendfile64
when the sendfile syscall is not available.  However, as written,
that code leads to sendfile64 being globally hidden in situations
where __NR_sendfile and __USE_LARGEFILE64 are defined.  In this case,
the flow executes strong_alias_untyped(sendfile,sendfile64) in
libc/sysdeps/linux/common/sendfile.c and libc_hidden_proto(sendfile64)
in include/sys/sendfile.h, but nowhere does it do libc_hidden_def(sendfile64).
This patch adds the needed libc_hidden_def(sendfile64).

This breaks, for example, xfsprogs on x86_64.  Reported by mardok4
in IRC.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
C6X: Remove DSBT in favour of FDPIC

Sync up with the changes from C6X entering the kernel.

Signed-off-by: Luis Machado <lgustavo@codesourcery.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>