diff options
author | Joseph Myers <joseph@codesourcery.com> | 2015-06-17 20:11:58 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2015-06-17 20:11:58 +0000 |
commit | d051b143f73189311faf9cd311cc53c6f6a145db (patch) | |
tree | ecb8deb80e164864cf069e12657de78ed1933b94 /misc/tsearch.c | |
parent | be7dc2b77e368daad6f81e272fc41f1b86166240 (diff) | |
download | glibc-d051b143f73189311faf9cd311cc53c6f6a145db.tar.gz |
Fix sem_* tdelete, tfind, tsearch, twalk namespace (bug 18536).
The sem_* functions bring in references to tdelete, tfind, tsearch and
twalk. But the t* functions are XSI-shaded, while sem_* aren't. This
patch fixes this by using __t* instead, exporting those functions from
libc at version GLIBC_PRIVATE (since sem_* are in libpthread) and
using libc_hidden_* for the benefit of calls within libc.
Tested for x86_64 and x86 (testsuite, and comparison of disassembly of
installed stripped shared libraries). libpthread gets changes from
PLT reordering; addresses in libc change because of PLT / dynamic
symbol table changes.
[BZ #18536]
* misc/tsearch.c (__tsearch): Use libc_hidden_def.
(__tfind): Likewise.
(__tdelete): Likewise.
(__twalk): Likewise.
* misc/Versions (libc): Add __tdelete, __tfind, __tsearch and
__twalk to GLIBC_PRIVATE.
* include/search.h (__tsearch): Use libc_hidden_proto.
(__tfind): Likewise.
(__tdelete): Likewise.
(__twalk): Likewise.
* nptl/sem_close.c (sem_close): Call __twalk instead of twalk.
Call __tdelete instead of tdelete.
* nptl/sem_open.c (check_add_mapping): Call __tfind instead of
tfind. Call __tsearch instead of tsearch.
* sysdeps/sparc/sparc32/sem_open.c (check_add_mapping): Likewise.
* conform/Makefile (test-xfail-POSIX/semaphore.h/linknamespace):
Remove variable.
(test-xfail-POSIX2008/semaphore.h/linknamespace): Likewise.
Diffstat (limited to 'misc/tsearch.c')
-rw-r--r-- | misc/tsearch.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/misc/tsearch.c b/misc/tsearch.c index d4052e8397..869dc9bec7 100644 --- a/misc/tsearch.c +++ b/misc/tsearch.c @@ -293,6 +293,7 @@ __tsearch (const void *key, void **vrootp, __compar_fn_t compar) return q; } +libc_hidden_def (__tsearch) weak_alias (__tsearch, tsearch) @@ -325,6 +326,7 @@ __tfind (key, vrootp, compar) } return NULL; } +libc_hidden_def (__tfind) weak_alias (__tfind, tfind) @@ -585,6 +587,7 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar) free (unchained); return retval; } +libc_hidden_def (__tdelete) weak_alias (__tdelete, tdelete) @@ -625,6 +628,7 @@ __twalk (const void *vroot, __action_fn_t action) if (root != NULL && action != NULL) trecurse (root, action, 0); } +libc_hidden_def (__twalk) weak_alias (__twalk, twalk) |