Commit graph

201 commits

Author SHA1 Message Date
Florian Weimer b9aec0dd9f nptl: Move pthread_barrier_wait into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-06 15:56:37 +02:00
Florian Weimer f1af331c4e nptl: Move pthread_barrier_init into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-06 15:56:37 +02:00
Florian Weimer 43b3746aff nptl: Move pthread_barrier_destroy into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-06 15:56:37 +02:00
Florian Weimer 5633541d3b nptl: Move sem_trywait, sem_wait into libc
The symbols were moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-05 17:19:53 +02:00
Florian Weimer 990c8ffd3a nptl: Move sem_unlink into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

A small adjust to the sem_unlink implementation is necessary to avoid
a check-localplt failure.

A placeholder symbol to keep the GLIBC_2.1.1 version alive in
libpthread is added with this commit.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-05 17:19:50 +02:00
Florian Weimer 018c75dcb1 nptl: Move sem_timedwait into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-05 17:19:48 +02:00
Florian Weimer 793042c63c nptl: Move sem_post into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-05 17:19:47 +02:00
Florian Weimer 1ae60ae74f nptl: Move sem_init into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-05 17:19:45 +02:00
Florian Weimer 61878689c2 nptl: Move sem_getvalue into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-05 17:19:43 +02:00
Florian Weimer 4b729cca87 nptl: Move sem_destroy into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-05 17:19:40 +02:00
Florian Weimer 0b7d48d106 nptl: Move sem_close, sem_open into libc
The symbols were moved using move-symbol-to-libc.py.

Both functions are moved at the same time because they depend
on internal functions in sysdeps/pthread/sem_routines.c, which
are moved in this commit as well.  Additional hidden prototypes
are required to avoid check-localplt failures.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-05 17:19:38 +02:00
Florian Weimer 19cc20ef2e nptl: Move sem_clockwait into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

A new placeholder version is added at version GLIBC_2.30, to
preserve that version in libpthread.so.0.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-05 17:19:35 +02:00
Florian Weimer 0197c1bc60 nptl: Move pthread_testcancel into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

A temporary __pthread_testcancel@@GLIBC_PRIVATE export is created
because it is needed by the semaphore implementation.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-05 17:19:20 +02:00
Alexandra Hájková 19d83270fc linux: Add execveat system call wrapper
It operates similar to execve and it is is already used to implement
fexecve without requiring /proc to be mounted.  However, different
than fexecve, if the syscall is not supported by the kernel an error
is returned instead of trying a fallback.

Checked on x86_64-linux-gnu and powerpc64le-linux-gnu.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-05-03 16:46:06 -03:00
Florian Weimer c2fd60a586 nptl: Move pthread_yield into libc, as a compatibility symbol
And deprecate it in <pthread.h>, redirecting it to sched_yield
for the time being.

The symbol was moved using scripts/move-symbol-to-libc.py.

No GLIBC_2.34 symbol version is added because of the compatibility
symbol status.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:23:44 +02:00
Florian Weimer 0505ae4e3b nptl: Move pthread_rwlockattr_setpshared into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:18:45 +02:00
Florian Weimer b444409479 nptl: Move pthread_rwlockattr_setkind_np into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:18:42 +02:00
Florian Weimer dbfa12e201 nptl: Move pthread_rwlockattr_init into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:18:38 +02:00
Florian Weimer 0af0ccc2d5 nptl: Move pthread_rwlockattr_getpshared into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:18:35 +02:00
Florian Weimer 9f13a95b6f nptl: Move pthread_rwlockattr_getkind_np into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:18:31 +02:00
Florian Weimer a8841e00d6 nptl: Move pthread_rwlockattr_destroy into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:18:25 +02:00
Florian Weimer e8a9597159 nptl: Move pthread_rwlock_trywrlock into libc
And __pthread_rwlock_trywrlock as a compatibility symbol.

Remove the unused __libc_rwlock_trywrlock macro.

The symbols were moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:18:20 +02:00
Florian Weimer c96dddd731 nptl: Move pthread_rwlock_tryrdlock into libc
And __pthread_rwlock_tryrdlock as a compatibility symbol.

Remove the unused __libc_rwlock_tryrdlock macro.

The symbols were moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:18:16 +02:00
Florian Weimer e7d2d48e56 nptl: Move pthread_rwlock_timedwrlock into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:18:12 +02:00
Florian Weimer 2392feb171 nptl: Move pthread_rwlock_timedrdlock into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:18:04 +02:00
Florian Weimer 63627246f3 nptl: Move pthread_rwlock_init into libc
And __pthread_rwlock_init as a compatibility symbol.

__libc_rwlock_init is changed to call __pthread_rwlock_init directly.

The symbols were moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:17:59 +02:00
Florian Weimer 504ac633b0 nptl: Move pthread_rwlock_destroy into libc
And __pthread_rwlock_destroy as a compatibility symbol.

rwlocks do not need finalization, so change __libc_rwlock_fini to do
nothing.

The symbols were moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:17:36 +02:00
Florian Weimer 2cf5b43bcb nptl: Move pthread_rwlock_clockwrlock into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:17:27 +02:00
Florian Weimer 0ace9b197c nptl: Move pthread_rwlock_clockrdlock into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 09:16:49 +02:00
Florian Weimer 2c5c5c87c9 nptl: Move tss_set into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

__pthread_setspecific@@GLIBC_2.34 is no longer needed after the move,
so it is removed with this commit, too.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:18:08 +02:00
Florian Weimer a062ba3836 nptl: Move tss_get into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

__pthread_getspecific@@GLIBC_2.34 is no longer needed after the move,
so it is removed with this commit, too.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:18:01 +02:00
Florian Weimer deb317d510 nptl: Move tss_delete into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

__pthread_key_delete@@GLIBC_PRIVATE is no longer needed after that,
so it is removed as well.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:17:38 +02:00
Florian Weimer e4036b1ce9 nptl: Move tss_create into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

__pthread_key_create@@GLIBC_2.34 is no longer needed by glibc
itself with this change, but __pthread_key_create is used by
libstdc++, so it still has to be exported as a public symbol.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:17:29 +02:00
Florian Weimer 96e61709b4 nptl: Move thrd_exit into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

The __pthread_exit@@GLIBC_PRIVATE symbol is no longer needed
after this change, so remove it.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:17:15 +02:00
Florian Weimer ae4a5ca074 nptl: Move mtx_unlock into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

__pthread_mutex_unlock@GLIBC_2.34 is not removed in this commit
because it is still used from nptl/nptl-init.c.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:16:48 +02:00
Florian Weimer 08970190fc nptl: Move mtx_trylock into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

The __pthread_mutex_trylock@@GLIBC_2.34 symbol version is no longer
needed because the call is now internal to libc, so remove it with
this commit.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:15:58 +02:00
Florian Weimer 032a9e17a7 nptl: Move mtx_timedlock into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

The __pthread_mutex_timedlock@@GLIBC_PRIVATE export is no longer
needed, so it is removed with this commit.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:15:53 +02:00
Florian Weimer b7863c732e nptl: Move mtx_lock into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

__pthread_mutex_lock@GLIBC_2.34 is not removed in this commit
because it is still used from nptl/nptl-init.c.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:15:41 +02:00
Florian Weimer f44c9a24ed nptl: Move mtx_init into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

The calls to __pthread_mutex_init, __pthread_mutexattr_init,
__pthread_mutexattr_settype are now private and no longer need
to be exported.  This allows the removal of the newly added
GLIBC_2.34 symbol versions for those functions.

Also clean up some weak declarations in <libc-lockP.h> for
these functions.  They are not needed and potentially incorrect
for static linking of mtx_init.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:15:22 +02:00
Florian Weimer 17b67416c5 nptl: Move mtx_destroy into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

The __pthread_mutex_destroy@@GLIBC_2.34 symbol is no longer
neded because this commit makes __pthread_mutex_destroy@GLIBC_2.0
a compatibility symbol, so remove the new symbol version.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:15:15 +02:00
Florian Weimer cf3fff1c19 nptl: Move cnd_wait into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

The __pthread_cond_wait@@GLIBC_PRIVATE symbol is no longer
neded, so remove that as well.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:15:10 +02:00
Florian Weimer 08a31ef923 nptl: Move cnd_timedwait into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

The __pthread_cond_timedwait@@GLIBC_PRIVATE symbol is no longer
neded, so remove that as well.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:15:04 +02:00
Florian Weimer eef936eb45 nptl: Move cnd_signal into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

The __pthread_cond_signal@@GLIBC_PRIVATE symbol is no longer
neded, so remove that as well.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:14:49 +02:00
Florian Weimer 3eab466e56 nptl: Move cnd_init into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

The __pthread_cond_init@@GLIBC_PRIVATE symbol is no longer
neded, so remove that as well.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:14:38 +02:00
Florian Weimer f11c293a4c nptl: Move cnd_destroy into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

The __pthread_cond_destroy@@GLIBC_PRIVATE symbol is no longer
neded, so remove that as well.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:14:28 +02:00
Florian Weimer 0431f171da nptl: Move cnd_broadcast into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

The __pthread_cond_broadcast@@GLIBC_PRIVATE symbol is no longer
neded, so remove that as well.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:14:17 +02:00
Florian Weimer 575295fc83 nptl: Move call_once into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

This change also turns __pthread_once into a compatibility symbol
because after the call_once move, an internal call to __pthread_once
can be used.  This an adjustment to __libc_once: Outside libc (e.g.,
in nscd), it has to call pthread_once.  With __pthread_once as a
compatibility symbol, it is no longer to add a new GLIBC_2.34
version after the move from libpthread, and this commit removes
the new __pthread_once@@GLIBC_2.34 version.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-03 08:14:01 +02:00
Florian Weimer 4baf02b332 nptl: Move pthread_spin_trylock into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 17:06:48 +02:00
Florian Weimer da8e3710d8 nptl: Move pthread_spin_lock into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 17:06:46 +02:00
Florian Weimer ce4b3b7bef nptl: Move pthread_spin_init, Move pthread_spin_unlock into libc
For some architectures, the two functions are aliased, so these
symbols need to be moved at the same time.

The symbols were moved using scripts/move-symbol-to-libc.py.
2021-04-23 17:06:44 +02:00
Florian Weimer c7b1cd4ad1 nptl: Move pthread_spin_destroy into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 17:06:42 +02:00
Florian Weimer d9b600c985 nptl: Move pthread_condattr_setpshared into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 11:17:10 +02:00
Florian Weimer 6a75fefc2c nptl: Move pthread_condattr_setclock into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 11:02:54 +02:00
Florian Weimer 2a775a9ea5 nptl: Move pthread_condattr_getpshared into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 11:00:53 +02:00
Florian Weimer ed00dcbbd6 nptl: Move pthread_condattr_getclock into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 10:55:07 +02:00
Florian Weimer b76c066d09 nptl: Move pthread_mutexattr_settype, __pthread_mutexattr_settype into libc
And pthread_mutexattr_setkind_np as a compatibility symbol.

__pthread_mutexattr_settype is used in mtx_init from libpthread,
so this commit adds a GLIBC_2.34 symbol version for it.

The symbols were moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:51:57 +02:00
Florian Weimer 1ec4cd5ab4 nptl: Move pthread_mutexattr_setrobust into libc
And pthread_mutexattr_getrobust_np as a compat symbol.

The symbols were moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:51:57 +02:00
Florian Weimer 8a229ee93c nptl: Move pthread_mutexattr_setpshared into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:51:57 +02:00
Florian Weimer 241ac38c33 nptl: Move pthread_mutexattr_setprotocol into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:51:57 +02:00
Florian Weimer c66772281f nptl: Move pthread_mutexattr_setprioceiling into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:51:57 +02:00
Florian Weimer 506385d30e nptl: Move pthread_mutexattr_init, __pthread_mutexattr_init into libc
__pthread_mutexattr_init cannot be be made a compat symbol because
it is used in mtx_init, which is still in libpthread.

The symbols were moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:51:56 +02:00
Florian Weimer 2a23e899e2 nptl: Move pthread_mutexattr_gettype into libc
And pthread_mutexattr_getkind_np as a compatibility symbol.
(There is no declaration in <pthread.h>, so there is no need
to add an alias or a deprecation warning there.)

The symbols were moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:51:19 +02:00
Florian Weimer 9b7ab14e11 nptl: Move pthread_mutexattr_getrobust into libc
And pthread_mutexattr_getrobust_np as a compat symbol.

The symbols were moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:46:03 +02:00
Florian Weimer 2e825f7d5a nptl: Move pthread_mutexattr_getpshared into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:45:48 +02:00
Florian Weimer 9f2f158b35 nptl: Move pthread_mutexattr_getprotocol into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:45:29 +02:00
Florian Weimer d236322b6f nptl: Move pthread_mutexattr_getprioceiling into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:45:09 +02:00
Florian Weimer fd42022a10 nptl: Move pthread_mutexattr_destroy into libc
And __pthread_mutexattr_destroy as a compat symbol (so no
GLIBC_2.34 symbol version is added for it).

The symbols were moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:44:49 +02:00
Florian Weimer a2b0f2e186 nptl: Move pthread_mutex_trylock, __pthread_mutex_trylock into libc
The symbols were moved using scripts/move-symbol-to-libc.py.

__pthread_mutex_trylock is used to implement mtx_timedlock,
which still resides in libpthread, so add a GLIBC_2.34 version
for it, to match the existing GLIBC_2.0 version.
2021-04-23 09:44:23 +02:00
Florian Weimer 4372dc7eaa nptl: Move pthread_mutex_timedlock, pthread_mutex_clocklock to libc
The symbols were moved using scripts/move-symbol-to-libc.py.
The symbol aliasing follows pthread_cond_timedwait et al.
Missing hidden prototypes had to be added to nptl/pthreadP.h
for consistency.
2021-04-23 09:43:24 +02:00
Florian Weimer a2975191d0 nptl: Move pthread_mutex_setprioceiling into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:43:08 +02:00
Florian Weimer 4b85c6f55f nptl: Move pthread_mutex_getprioceiling into libc
The symbol was moved using scripts/move-symbol-to-libc.py.
2021-04-23 09:42:51 +02:00
Florian Weimer e4f1c0de9c nptl: Move pthread_kill_other_threads_np compatibility symbol into libc
And stop including the function for new architectures.
2021-04-22 19:50:16 +02:00
Florian Weimer 08129b155e nptl: Move core condition variable functions into libc
Onl pthread_cond_clockwait did not have a forwarder, so it needs
a new symbol version.

Some complications arise due to the need to supply hidden aliases,
GLIBC_PRIVATE exports (for the C11 condition variable implementation
that still remains in libpthread) and 64-bit time_t stubs.

pthread_cond_broadcast, pthread_cond_signal,  pthread_cond_timedwait,
pthread_cond_wait, pthread_cond_clockwait have been moved using
scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:51 +02:00
Florian Weimer 27a448223c nptl: Move core mutex functions into libc
This is complicated because of a second compilation of
nptl/pthread_mutex_lock.c via nptl/pthread_mutex_cond_lock.c.
PTHREAD_MUTEX_VERSIONS is introduced to suppress symbol versions
in that case.

The symbols __pthread_mutex_lock, __pthread_mutex_unlock,
__pthread_mutex_init, __pthread_mutex_destroy, pthread_mutex_lock,
pthread_mutex_unlock, pthread_mutex_init, pthread_mutex_destroy
have been moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:51 +02:00
Florian Weimer eb29dcde31 nptl: Move rwlock functions with forwarders into libc
The forwarders were only used internally, so new symbol versions
are needed.  All symbols are moved at once because the forwarders
are no-ops if libpthread is not loaded, leading to inconsistencies
in case of a partial migration.

The symbols __pthread_rwlock_rdlock, __pthread_rwlock_unlock,
__pthread_rwlock_wrlock, pthread_rwlock_rdlock,
pthread_rwlock_unlock, pthread_rwlock_wrlock have been moved using
scripts/move-symbol-to-libc.py.

The __ symbol variants are turned into compat symbols, which is why they
do not receive a GLIBC_2.34 version.
2021-04-21 19:49:51 +02:00
Florian Weimer 9ce44f4675 nptl: Move pthread_key_delete into libc.
The symbol was moved using scripts/move-symbol-to-libc.py.

tss_delete (still in libpthread) uses the __pthread_key_create
alias, so that is now exported under GLIBC_PRIVATE.
2021-04-21 19:49:51 +02:00
Florian Weimer 64a8990bdc nptl: Move pthread_setspecific, __pthread_setspecific into libc
The symbols have been moved using scripts/move-symbol-to-libc.py.
2021-04-21 19:49:51 +02:00
Florian Weimer aae43acfd1 nptl: Move pthread_getspecific, __pthread_getspecific into libc
The symbols have been moved using scripts/move-symbol-to-libc.py.
2021-04-21 19:49:51 +02:00
Florian Weimer 6f009ea984 nptl: Move pthread_key_create, __pthread_key_create into libc
The symbols have been moved using scripts/move-symbol-to-libc.py.
2021-04-21 19:49:51 +02:00
Florian Weimer 1d95b035c7 nptl: Move __pthread_unwind_next into libc
It's necessary to stub out __libc_disable_asynccancel and
__libc_enable_asynccancel via rtld-stubbed-symbols because the new
direct references to the unwinder result in symbol conflicts when the
rtld exception handling from libc is linked in during the construction
of librtld.map.

unwind-forcedunwind.c is merged into unwind-resume.c.  libc now needs
the functions that were previously only used in libpthread.

The GLIBC_PRIVATE exports of __libc_longjmp and __libc_siglongjmp are
no longer needed, so switch them to hidden symbols.

The symbol __pthread_unwind_next has been moved using
scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerva Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Florian Weimer 3fec7f18bf nptl: Move pthread_once and __pthread_once into libc
And also the fork generation counter, __fork_generation.  This
eliminates the need for __fork_generation_pointer.

call_once remains in libpthread and calls the exported __pthread_once
symbol.

pthread_once and __pthread_once have been moved using
scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Florian Weimer 1f2e5bfe48 nptl: Move legacy cancelation handling into libc as compat symbols
This affects _pthread_cleanup_pop, _pthread_cleanup_pop_restore,
_pthread_cleanup_push, _pthread_cleanup_push_defer.  The symbols
have been moved using scripts/move-symbol-to-libc.py.

No new symbol versions are added because the symbols are turned into
compatibility symbols at the same time.

__pthread_cleanup_pop and __pthread_cleanup_push are added as
GLIBC_PRIVATE symbols because they are also used internally, for
glibc's own cancellation handling.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Florian Weimer 5715c29e91 nptl: Move __pthread_cleanup_routine into libc
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Florian Weimer f03b78fae4 nptl: Move pthread_mutex_consistent into libc
And deprecated pthread_mutex_consistent_np, its old name.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-04-21 19:49:50 +02:00
Adhemerval Zanella b76658451c nptl: Move pthread_kill to libc
A new 2.34 version is also provided.

Checked on x86_64-linux-gnu.
2021-03-26 13:37:18 -03:00
Florian Weimer 035c012e32 Reduce the statically linked startup code [BZ #23323]
It turns out the startup code in csu/elf-init.c has a perfect pair of
ROP gadgets (see Marco-Gisbert and Ripoll-Ripoll, "return-to-csu: A
New Method to Bypass 64-bit Linux ASLR").  These functions are not
needed in dynamically-linked binaries because DT_INIT/DT_INIT_ARRAY
are already processed by the dynamic linker.  However, the dynamic
linker skipped the main program for some reason.  For maximum
backwards compatibility, this is not changed, and instead, the main
map is consulted from __libc_start_main if the init function argument
is a NULL pointer.

For statically linked binaries, the old approach based on linker
symbols is still used because there is nothing else available.

A new symbol version __libc_start_main@@GLIBC_2.34 is introduced because
new binaries running on an old libc would not run their ELF
constructors, leading to difficult-to-debug issues.
2021-02-25 12:13:02 +01:00
Adhemerval Zanella 589260cef8 Remove mknod wrapper functions, move them to symbols
This patch removes the mknod and mknodat static wrapper and add the
symbols on the libc with the expected names.

Both the prototypes of the internal symbol linked by the static
wrappers and the inline redirectors are also removed from the installed
sys/stat.h header file.  The wrapper implementation license LGPL
exception is also removed since it is no longer statically linked to
binaries.

Internally the _STAT_VER* definitions are moved to the arch-specific
xstatver.h file.

Checked with a build for all affected ABIs. I also checked on x86_64,
i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
2020-10-09 17:02:06 -03:00
Adhemerval Zanella 8ed005daf0 Remove stat wrapper functions, move them to exported symbols
This patch removes the stat, stat64, lstat, lstat64, fstat, fstat64,
fstatat, and fstatat64 static wrapper and add the symbol on the libc
with the expected names.

Both the prototypes of the internal symbol linked by the static
wrappers and the inline redirectors are also removed from the installed
sys/stat.h header file.  The wrapper implementation license LGPL
exception is also removed since it is no longer statically linked to
binaries.

Internally the _STAT_VER* definitions are moved to a arch-specific
xstatver.h file.  The internal defines that redirects internals
{f}stat{at} to their {f}xstat{at} counterparts are removed for Linux
(!NO_RTLD_HIDDEN).  Hurd still requires them since {f}stat{at} pulls
extra objects that makes the loader build fail otherwise (I haven't
dig into why exactly).

Checked with a build for all affected ABIs. I also checked on x86_64,
i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
2020-10-09 17:02:06 -03:00
DJ Delorie cdf645427d Update mallinfo2 ABI, and test
This patch adds the ABI-related bits to reflect the new mallinfo2
function, and adds a test case to verify basic functionality.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2020-09-17 18:49:30 -04:00
Florian Weimer efedd1ed3d Linux: Remove rseq support
The kernel ABI is not finalized, and there are now various proposals
to change the size of struct rseq, which would make the glibc ABI
dependent on the version of the kernels used for building glibc.
This is of course not acceptable.

This reverts commit 48699da1c4 ("elf:
Support at least 32-byte alignment in static dlopen"), commit
8f4632deb3 ("Linux: rseq registration
tests"), commit 6e29cb3f61 ("Linux: Use
rseq in sched_getcpu if available"), and commit
0c76fc3c2b ("Linux: Perform rseq
registration at C startup and thread creation"), resolving the conflicts
introduced by the ARC port and the TLS static surplus changes.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2020-07-16 17:55:35 +02:00
Adhemerval Zanella 325081b9eb string: Add strerrorname_np and strerrordesc_np
The strerrorname_np returns error number name (e.g. "EINVAL" for EINVAL)
while strerrordesc_np returns string describing error number (e.g
"Invalid argument" for EINVAL).  Different than strerror,
strerrordesc_np does not attempt to translate the return description,
both functions return NULL for an invalid error number.

They should be used instead of sys_errlist and sys_nerr, both are
thread and async-signal safe.  These functions are GNU extensions.

Checked on x86-64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu,
and s390x-linux-gnu.

Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2020-07-07 15:02:57 -03:00
Adhemerval Zanella bfe05aa289 string: Add sigabbrev_np and sigdescr_np
The sigabbrev_np returns the abbreviated signal name (e.g. "HUP" for
SIGHUP) while sigdescr_np returns the string describing the error
number (e.g "Hangup" for SIGHUP).  Different than strsignal,
sigdescr_np does not attempt to translate the return description and
both functions return NULL for an invalid signal number.

They should be used instead of sys_siglist or sys_sigabbrev and they
are both thread and async-signal safe.  They are added as GNU
extensions on string.h header (same as strsignal).

Checked on x86-64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu,
and s390x-linux-gnu.

Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2020-07-07 14:57:14 -03:00
Florian Weimer 706ad1e7af Add the __libc_single_threaded variable
The variable is placed in libc.so, and it can be true only in
an outer libc, not libcs loaded via dlmopen or static dlopen.
Since thread creation from inner namespaces does not work,
pthread_create can update __libc_single_threaded directly.

Using __libc_early_init and its initial flag, implementation of this
variable is very straightforward.  A future version may reset the flag
during fork (but not in an inner namespace), or after joining all
threads except one.

Reviewed-by: DJ Delorie <dj@redhat.com>
2020-07-06 11:15:58 +02:00
Mathieu Desnoyers 0c76fc3c2b Linux: Perform rseq registration at C startup and thread creation
Register rseq TLS for each thread (including main), and unregister for
each thread (excluding main).  "rseq" stands for Restartable Sequences.

See the rseq(2) man page proposed here:
  https://lkml.org/lkml/2018/9/19/647

Those are based on glibc master branch commit 3ee1e0ec5c.
The rseq system call was merged into Linux 4.18.

The TLS_STATIC_SURPLUS define is increased to leave additional room for
dlopen'd initial-exec TLS, which keeps elf/tst-auditmany working.

The increase (76 bytes) is larger than 32 bytes because it has not been
increased in quite a while.  The cost in terms of additional TLS storage
is quite significant, but it will also obscure some initial-exec-related
dlopen failures.
2020-07-06 10:21:16 +02:00
Florian Weimer ec41af45a6 nptl: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2020-06-02 11:59:18 +02:00
Florian Weimer 07a73d5219 nptl: Move pthread_gettattr_np into libc
This is part of the libpthread removal project:

    <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

Use __getline instead of __getdelim to avoid a localplt failure.
Likewise for __getrlimit/getrlimit.

The abilist updates were performed by:

git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \
  | while read x ; do
    echo "GLIBC_2.32 pthread_getattr_np F" >> $x
done
python3 scripts/move-symbol-to-libc.py --only-linux pthread_getattr_np

The private export of __pthread_getaffinity_np is no longer needed, but
the hidden alias still necessary so that the symbol can be exported with
versioned_symbol.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2020-05-20 20:27:49 +02:00
Florian Weimer 52302bc298 nptl: Move pthread_getaffinity_np into libc
This is part of the libpthread removal project:

    <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

The abilist updates were performed by:

git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \
  | while read x ; do
    echo "GLIBC_2.32 pthread_getaffinity_np F" >> $x
done
python3 scripts/move-symbol-to-libc.py pthread_getaffinity_np

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2020-05-20 20:23:20 +02:00
Florian Weimer 1979819d68 nptl: Move pthread_attr_setaffinity_np into libc
This is part of the libpthread removal project:

    <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

The symbol did not previously exist in libc, so a new GLIBC_2.32
symbol is needed, to get correct dependency for binaries which
use the symbol but no longer link against libpthread.

The abilist updates were performed by:

git ls-files 'sysdeps/unix/sysv/linux/**/libc.abilist' \
  | while read x ; do
    echo "GLIBC_2.32 pthread_attr_setaffinity_np F" >> $x
done
python3 scripts/move-symbol-to-libc.py pthread_attr_setaffinity_np

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
2020-05-20 20:22:59 +02:00
Adhemerval Zanella c6663fee43 nptl: Move pthread_sigmask implementation to libc
This is part of the libpthread removal project:

  <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

A new symbol version is added on libc to force loading failure
instead of lazy binding one for newly binaries with old loaders.

Checked with a build against all affected ABIs.
2020-04-21 14:01:58 -03:00
Zack Weinberg 7b5af2d8f2 Finish move of clock_* functions to libc. [BZ #24959]
In glibc 2.17, the functions clock_getcpuclockid, clock_getres,
clock_gettime, clock_nanosleep, and clock_settime were moved from
librt.so to libc.so, leaving compatibility stubs behind.  Now that the
dynamic linker no longer insists on finding versioned symbols in the
same library that originally defined them, we do not need the stubs
anymore, and this means we don't need GLIBC_PRIVATE __-prefix aliases
for most of the functions anymore either.  (clock_gettime still needs
one.)  For ports added before 2.17, libc.so needs to provide two
symbol versions for each, the default at GLIBC_2.17 plus a compat
version matching what librt had.

While I'm at it, move the clock_*.c files and their tests from rt/ to
time/.
2019-09-04 14:39:38 +02:00
Adhemerval Zanella 1673ba87fe arm: Split BE/LE abilist
The fix for BZ#18231 requires new symbols only for armeb.  This patch
adds the required folder and files for both BE and LE abilist.  No
semantic changes are expected.

Checked with check-abi for arm-linux-gnueabihf and armeb-linux-gnueabihf.

	* sysdeps/arm/preconfigure.ac: Set machine based on endianness.
	* sysdeps/arm/preconfigure: Regenerate.
	* sysdeps/arm/be/Implies: New file.
	* sysdeps/arm/be/armv6/Implies: Likewise.
	* sysdeps/arm/be/armv6t2/Implies: Likewise.
	* sysdeps/arm/be/armv7/Implies: Likewise.
	* sysdeps/arm/le/Implies: Likewise.
	* sysdeps/unix/sysv/linux/arm/be/Implies: Likewise.
	* sysdeps/unix/sysv/linux/arm/le/Implies: Likewise.
	* sysdeps/unix/sysv/linux/arm/*.abilist: Move to
	sysdeps/unix/sysv/linux/arm/le/*.abilist.
	* sysdeps/unix/sysv/linux/arm/be/l*.abilist: New files.
2019-08-29 09:58:21 -03:00