1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

nptl: Add tests for internal pthread_rwlock_t offsets

This patch new build tests to check for internal fields offsets for
internal pthread_rwlock_t definition.  Althoug the '__data.__flags'
field layout should be preserved due static initializators, the patch
also adds tests for the futexes that may be used in a shared memory
(although using different libc version in such scenario is not really
supported).

Checked with a build against all affected ABIs.

Change-Id: Iccc103d557de13d17e4a3f59a0cad2f4a640c148
This commit is contained in:
Adhemerval Zanella
2019-11-04 13:36:05 +00:00
parent 71d260c107
commit 48dbce60cf
18 changed files with 78 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#include "pthreadP.h"
#include <string.h>
#include <pthread-offsets.h>
static const struct pthread_rwlockattr default_rwlockattr =
@ -34,6 +35,13 @@ __pthread_rwlock_init (pthread_rwlock_t *rwlock,
{
ASSERT_TYPE_SIZE (pthread_rwlock_t, __SIZEOF_PTHREAD_RWLOCK_T);
/* The __flags is the only field where its offset should be checked to
avoid ABI breakage with static initializers. */
ASSERT_PTHREAD_INTERNAL_OFFSET (pthread_rwlock_t, __data.__flags,
__PTHREAD_RWLOCK_FLAGS_OFFSET);
ASSERT_PTHREAD_INTERNAL_MEMBER_SIZE (pthread_rwlock_t, __data.__flags,
int);
const struct pthread_rwlockattr *iattr;
iattr = ((const struct pthread_rwlockattr *) attr) ?: &default_rwlockattr;