static pie: fix building static PDE
commitffd84a0f60f918a48e6e2f24e37e7c53291c0373
authorMax Filippov <jcmvbkbc@gmail.com>
Thu, 15 Sep 2022 19:30:50 +0000 (15 12:30 -0700)
committerWaldemar Brodkorb <wbx@openadk.org>
Wed, 21 Sep 2022 08:35:40 +0000 (21 10:35 +0200)
treea1339946c412c20d948af39be0d85058d8b0b2e4
parent1ac7bf149be1e35343b7f5d830d930bd8bd41fcf
static pie: fix building static PDE

When uclibc is built with static PIE support the _dl_load_base variable
shared between the libc-tls.c and reloc_static_pie.c creates the
dependency that requires linking reloc_static_pie.o into static
position-dependent executables resulting in the following build errors:
  gcc -static test.c -o test
  ...ld:
  ...usr/lib/libc.a(reloc_static_pie.os):(.text+0x0):
undefined reference to `_DYNAMIC'

Move _dl_load_base definition to libc-tls.c to resolve this dependency
and fix static PDE build.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
libc/misc/internals/reloc_static_pie.c
libpthread/nptl/sysdeps/generic/libc-tls.c