nptl threads: Fix bug in using a weak variable.
commita7d538fddb21427681704e027e2fdea2bed686c7
authorChristophe Lyon <christophe.lyon@st.com>
Wed, 4 Jul 2018 15:55:40 +0000 (4 17:55 +0200)
committerWaldemar Brodkorb <wbrodkorb@conet.de>
Fri, 10 Aug 2018 14:02:45 +0000 (10 16:02 +0200)
treec4e52cb4ecd677ad0256da6e2c600dbbb9f030cf
parent0f4ddec32ebf5796c5ea485f8fdae2f1ad429e1d
nptl threads: Fix bug in using a weak variable.

In case __nptl_nthreads is not defined in the final binary then avoid
dereferencing the address since it's null. Anyway this means there is
no other thread and so we must exit.

* libc/misc/internals/__uClibc_main.c (__uClibc_main): Handle case
where &__nptl_nthreads is null.

Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
libc/misc/internals/__uClibc_main.c