svn commit: r296732 - in stable/10/lib: libc/gen libc/include libc/sys libthr libthr/thread
Konstantin Belousov
kib at FreeBSD.org
Sat Mar 12 17:33:43 UTC 2016
Author: kib
Date: Sat Mar 12 17:33:40 2016
New Revision: 296732
URL: https://svnweb.freebsd.org/changeset/base/296732
Log:
MFC r295407:
Make libc __pthread_map_stacks_exec() interposed.
Modified:
stable/10/lib/libc/gen/elf_utils.c
stable/10/lib/libc/include/libc_private.h
stable/10/lib/libc/sys/interposing_table.c
stable/10/lib/libthr/pthread.map
stable/10/lib/libthr/thread/thr_private.h
stable/10/lib/libthr/thread/thr_stack.c
stable/10/lib/libthr/thread/thr_syscalls.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/lib/libc/gen/elf_utils.c
==============================================================================
--- stable/10/lib/libc/gen/elf_utils.c Sat Mar 12 17:28:30 2016 (r296731)
+++ stable/10/lib/libc/gen/elf_utils.c Sat Mar 12 17:33:40 2016 (r296732)
@@ -32,6 +32,7 @@
#include <sys/sysctl.h>
#include <link.h>
#include <stddef.h>
+#include "libc_private.h"
int
__elf_phdr_match_addr(struct dl_phdr_info *phdr_info, void *addr)
@@ -51,9 +52,8 @@ __elf_phdr_match_addr(struct dl_phdr_inf
return (i != phdr_info->dlpi_phnum);
}
-#pragma weak __pthread_map_stacks_exec
void
-__pthread_map_stacks_exec(void)
+__libc_map_stacks_exec(void)
{
int mib[2];
struct rlimit rlim;
@@ -72,3 +72,10 @@ __pthread_map_stacks_exec(void)
rlim.rlim_cur, _rtld_get_stack_prot());
}
+#pragma weak __pthread_map_stacks_exec
+void
+__pthread_map_stacks_exec(void)
+{
+
+ ((void (*)(void))__libc_interposing[INTERPOS_map_stacks_exec])();
+}
Modified: stable/10/lib/libc/include/libc_private.h
==============================================================================
--- stable/10/lib/libc/include/libc_private.h Sat Mar 12 17:28:30 2016 (r296731)
+++ stable/10/lib/libc/include/libc_private.h Sat Mar 12 17:33:40 2016 (r296732)
@@ -224,6 +224,7 @@ enum {
INTERPOS_kevent,
INTERPOS_wait6,
INTERPOS_ppoll,
+ INTERPOS_map_stacks_exec,
INTERPOS_MAX
};
@@ -390,6 +391,7 @@ int _elf_aux_info(int aux, void *buf, in
struct dl_phdr_info;
int __elf_phdr_match_addr(struct dl_phdr_info *, void *);
void __init_elf_aux_vector(void);
+void __libc_map_stacks_exec();
void _pthread_cancel_enter(int);
void _pthread_cancel_leave(int);
Modified: stable/10/lib/libc/sys/interposing_table.c
==============================================================================
--- stable/10/lib/libc/sys/interposing_table.c Sat Mar 12 17:28:30 2016 (r296731)
+++ stable/10/lib/libc/sys/interposing_table.c Sat Mar 12 17:33:40 2016 (r296732)
@@ -78,6 +78,7 @@ interpos_func_t __libc_interposing[INTER
SLOT(kevent, __sys_kevent),
SLOT(wait6, __sys_wait6),
SLOT(ppoll, __sys_ppoll),
+ SLOT(map_stacks_exec, __libc_map_stacks_exec),
};
#undef SLOT
Modified: stable/10/lib/libthr/pthread.map
==============================================================================
--- stable/10/lib/libthr/pthread.map Sat Mar 12 17:28:30 2016 (r296731)
+++ stable/10/lib/libthr/pthread.map Sat Mar 12 17:33:40 2016 (r296732)
@@ -295,8 +295,6 @@ FBSDprivate_1.0 {
_thread_size_key;
_thread_state_running;
_thread_state_zoombie;
-
- __pthread_map_stacks_exec;
};
FBSD_1.1 {
Modified: stable/10/lib/libthr/thread/thr_private.h
==============================================================================
--- stable/10/lib/libthr/thread/thr_private.h Sat Mar 12 17:28:30 2016 (r296731)
+++ stable/10/lib/libthr/thread/thr_private.h Sat Mar 12 17:33:40 2016 (r296732)
@@ -928,6 +928,8 @@ int __thr_sigwait(const sigset_t *set, i
int __thr_sigwaitinfo(const sigset_t *set, siginfo_t *info);
int __thr_swapcontext(ucontext_t *oucp, const ucontext_t *ucp);
+void __thr_map_stacks_exec(void);
+
struct _spinlock;
void __thr_spinunlock(struct _spinlock *lck);
void __thr_spinlock(struct _spinlock *lck);
Modified: stable/10/lib/libthr/thread/thr_stack.c
==============================================================================
--- stable/10/lib/libthr/thread/thr_stack.c Sat Mar 12 17:28:30 2016 (r296731)
+++ stable/10/lib/libthr/thread/thr_stack.c Sat Mar 12 17:33:40 2016 (r296732)
@@ -161,9 +161,8 @@ singlethread_map_stacks_exec(void)
rlim.rlim_cur, _rtld_get_stack_prot());
}
-void __pthread_map_stacks_exec(void);
void
-__pthread_map_stacks_exec(void)
+__thr_map_stacks_exec(void)
{
struct pthread *curthread, *thrd;
struct stack *st;
Modified: stable/10/lib/libthr/thread/thr_syscalls.c
==============================================================================
--- stable/10/lib/libthr/thread/thr_syscalls.c Sat Mar 12 17:28:30 2016 (r296731)
+++ stable/10/lib/libthr/thread/thr_syscalls.c Sat Mar 12 17:33:40 2016 (r296732)
@@ -664,6 +664,7 @@ __thr_interpose_libc(void)
SLOT(kevent);
SLOT(wait6);
SLOT(ppoll);
+ SLOT(map_stacks_exec);
#undef SLOT
*(__libc_interposing_slot(
INTERPOS__pthread_mutex_init_calloc_cb)) =
More information about the svn-src-stable
mailing list