diff options
author | Elliott Hughes <enh@google.com> | 2014-05-09 16:13:52 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-05-09 16:13:52 +0000 |
commit | 55b4c8a4a15723f7c5f68b9ab167fbdea0c4e610 (patch) | |
tree | 404cd2ba25e81a2ee12d120db137e9c277ebc709 | |
parent | adfc007dbf936bd021d79ba2d2c360a3cfc77be9 (diff) | |
parent | 954cf0d4e2669f91194b45f484152e47efa4f6c7 (diff) | |
download | bionic-55b4c8a4a15723f7c5f68b9ab167fbdea0c4e610.zip bionic-55b4c8a4a15723f7c5f68b9ab167fbdea0c4e610.tar.gz bionic-55b4c8a4a15723f7c5f68b9ab167fbdea0c4e610.tar.bz2 |
Merge "Hide the __bionic_clone and __bionic_clone_entry implementation details."
-rw-r--r-- | libc/arch-arm/bionic/__bionic_clone.S | 1 | ||||
-rw-r--r-- | libc/arch-arm64/bionic/__bionic_clone.S | 1 | ||||
-rw-r--r-- | libc/arch-mips/bionic/__bionic_clone.S | 1 | ||||
-rw-r--r-- | libc/arch-mips64/bionic/__bionic_clone.S | 1 | ||||
-rw-r--r-- | libc/arch-x86/bionic/__bionic_clone.S | 1 | ||||
-rw-r--r-- | libc/arch-x86_64/bionic/__bionic_clone.S | 1 | ||||
-rw-r--r-- | libc/bionic/clone.cpp | 2 | ||||
-rw-r--r-- | tests/pthread_test.cpp | 16 | ||||
-rw-r--r-- | tests/sched_test.cpp | 8 |
9 files changed, 15 insertions, 17 deletions
diff --git a/libc/arch-arm/bionic/__bionic_clone.S b/libc/arch-arm/bionic/__bionic_clone.S index 7b76f5e..7cc4db5 100644 --- a/libc/arch-arm/bionic/__bionic_clone.S +++ b/libc/arch-arm/bionic/__bionic_clone.S @@ -71,3 +71,4 @@ ENTRY(__bionic_clone) ldr r1, [sp, #-8] b __bionic_clone_entry END(__bionic_clone) +.hidden __bionic_clone diff --git a/libc/arch-arm64/bionic/__bionic_clone.S b/libc/arch-arm64/bionic/__bionic_clone.S index 9790291..af91320 100644 --- a/libc/arch-arm64/bionic/__bionic_clone.S +++ b/libc/arch-arm64/bionic/__bionic_clone.S @@ -61,3 +61,4 @@ ENTRY(__bionic_clone) ldp x0, x1, [sp, #-16] b __bionic_clone_entry END(__bionic_clone) +.hidden __bionic_clone diff --git a/libc/arch-mips/bionic/__bionic_clone.S b/libc/arch-mips/bionic/__bionic_clone.S index 9273134..11d596b 100644 --- a/libc/arch-mips/bionic/__bionic_clone.S +++ b/libc/arch-mips/bionic/__bionic_clone.S @@ -66,3 +66,4 @@ ENTRY(__bionic_clone) la t9,__set_errno j t9 END(__bionic_clone) +.hidden __bionic_clone diff --git a/libc/arch-mips64/bionic/__bionic_clone.S b/libc/arch-mips64/bionic/__bionic_clone.S index e1ade30..754861b 100644 --- a/libc/arch-mips64/bionic/__bionic_clone.S +++ b/libc/arch-mips64/bionic/__bionic_clone.S @@ -95,3 +95,4 @@ LEAF(__bionic_clone, FRAMESZ) PTR_ADDU sp,FRAMESZ j t9 END(__bionic_clone) +.hidden __bionic_clone diff --git a/libc/arch-x86/bionic/__bionic_clone.S b/libc/arch-x86/bionic/__bionic_clone.S index e6ddaaa..bc7f71d 100644 --- a/libc/arch-x86/bionic/__bionic_clone.S +++ b/libc/arch-x86/bionic/__bionic_clone.S @@ -51,3 +51,4 @@ bc_return: popl %ebx ret END(__bionic_clone) +.hidden __bionic_clone diff --git a/libc/arch-x86_64/bionic/__bionic_clone.S b/libc/arch-x86_64/bionic/__bionic_clone.S index cf98d76..c2ebebd 100644 --- a/libc/arch-x86_64/bionic/__bionic_clone.S +++ b/libc/arch-x86_64/bionic/__bionic_clone.S @@ -70,3 +70,4 @@ ENTRY(__bionic_clone) 2: ret END(__bionic_clone) +.hidden __bionic_clone diff --git a/libc/bionic/clone.cpp b/libc/bionic/clone.cpp index 1d997fe..4ea3c70 100644 --- a/libc/bionic/clone.cpp +++ b/libc/bionic/clone.cpp @@ -35,7 +35,7 @@ extern "C" pid_t __bionic_clone(uint32_t flags, void* child_stack, int* parent_t extern "C" void __exit(int status); // Called from the __bionic_clone assembler to call the thread function then exit. -extern "C" void __bionic_clone_entry(int (*fn)(void*), void* arg) { +extern "C" __LIBC_HIDDEN__ void __bionic_clone_entry(int (*fn)(void*), void* arg) { int status = (*fn)(arg); __exit(status); } diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp index 9e7a9bc..6a5e4a6 100644 --- a/tests/pthread_test.cpp +++ b/tests/pthread_test.cpp @@ -256,22 +256,6 @@ TEST(pthread, pthread_sigmask) { ASSERT_EQ(0, pthread_sigmask(SIG_SETMASK, &original_set, NULL)); } -#if defined(__BIONIC__) -extern "C" pid_t __bionic_clone(int flags, void* child_stack, pid_t* parent_tid, void* tls, pid_t* child_tid, int (*fn)(void*), void* arg); -#endif // __BIONIC__ - -TEST(pthread, __bionic_clone) { -#if defined(__BIONIC__) - // Check that our hand-written clone assembler sets errno correctly on failure. - uintptr_t fake_child_stack[16]; - errno = 0; - ASSERT_EQ(-1, __bionic_clone(CLONE_THREAD, &fake_child_stack[16], NULL, NULL, NULL, NULL, NULL)); - ASSERT_EQ(EINVAL, errno); -#else // __BIONIC__ - GTEST_LOG_(INFO) << "This test does nothing.\n"; -#endif // __BIONIC__ -} - TEST(pthread, pthread_setname_np__too_long) { #if defined(__BIONIC__) // Not all build servers have a new enough glibc? TODO: remove when they're on gprecise. ASSERT_EQ(ERANGE, pthread_setname_np(pthread_self(), "this name is far too long for linux")); diff --git a/tests/sched_test.cpp b/tests/sched_test.cpp index 8dba948..7c19962 100644 --- a/tests/sched_test.cpp +++ b/tests/sched_test.cpp @@ -51,6 +51,14 @@ TEST(sched, clone) { } #endif +TEST(sched, clone_errno) { + // Check that our hand-written clone assembler sets errno correctly on failure. + uintptr_t fake_child_stack[16]; + errno = 0; + ASSERT_EQ(-1, clone(NULL, &fake_child_stack[16], CLONE_THREAD, NULL)); + ASSERT_EQ(EINVAL, errno); +} + TEST(sched, cpu_set) { cpu_set_t set; |