Age | Commit message (Collapse) | Author |
|
This reverts commit 6b6ede3d15f04fe825cfa9f697507457e3640344.
|
|
|
|
This drops __signed, __volatile, and __const. Only the latter was
used in the code base, and for uClibc, not consistently. Much of
the code used plain "const" which meant "__const" was useless.
Really, the point of this is to stay in sync with what glibc did.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
This attribute is not defined anywhere. Removed its use to make the file
compile.
Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
|
|
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Use __UCLIBC_HAS_TLS__ instead of USE___THREADS (although this LT implementation
will never support TLS).
Disable unused/unneeded members of the pthread_functions structure.
No redirect/forward for _pthread_cleanup_push/pop, it would have not worked anyway
due to the fact, that the structure member was not initialized. Disable it's possible
internal use in libc-lock.h.
Avoid using internals.h in libc_pthread_init.c (moving a prototype to pthread-functions.h).
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Rename PAGE_SIZE to __PAGE_SIZE to be sure that we do not get the
definition from uClibc_page.h.
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Reported-by: Tony Wu <tung7970@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
These stubs get used in libc as forwarding funcs, so we don't want them
labeled as hidden. Otherwise, attempting to use them in other libraries
(like libdl) will result in references to symbols that only libpthread
provides. Such as:
/usr/bin/python2.6: can't resolve symbol '__pthread_mutex_lock' in lib '/lib/libdl.so.0'.
This also brings the old code in line with the newer linuxthreads.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Because the nommu address space is flat, and the application stack can
literally be located anywhere, we cannot rely on the assumptions that the
mmu port gets away with. Namely, that the first thread's stack lives at
the top of memory and nothing will be created above it.
Currently, the code rounds the current stack up a page and sets that as
the "top" of the stack, and then marks the "bottom" of the stack as "1".
Then as new threads are created, this assumption is further refined by
slowly backing off the "bottom" when a new stack is created within the
range of the initial stack.
Simple ascii example (tid0 is the initial thread):
1 thread:
[bos tid0 stack tos]
2 threads:
[ tid0 stack ]
[tid1 stack]
3 threads:
[ tid0 stack ]
[tid1 stack]
[tid2 stack]
As you can kind of see, this algorithm operates on one basic assumption:
the initial top of stack calculation is the absolute top of the stack.
While this assumption was fairly safe in the original nommu days of yore
where the only file format was FLAT (which defaults to a 4KiB stack --
exactly 1 page), and memory was fairly tight, we can see that this falls
apart pretty quickly as soon as the initial stack is larger than a page.
The issue that crops up now is simple to hit: start an application with
an 8KiB stack, execute some functions that put pressure on the stack so
that it exceeds 4KiB, then start up some threads. The initial tos will
be rounded up by a page, but this is actually the middle of the stack.
Now when the initial thread returns from its functions (thus unwinding
the stack) and tries to call something which calls back into libpthread,
the thread_self() func fails to detect itself as the initial thread as
the current stack is now above the tos. The __pthread_find_self() func
kicks in, walks all the thread arrays, fails to find a hit, and then
walks into uninitialized memory for the thread descriptor. Use of this
garbage memory has obvious results -- things fall down & go boom.
To address this, I extend the current algorithm to automatically scale
back both the bottom and the top stack limits of the initial thread.
We use the current stack pointer at "thread boot time" only as a single
known point. The initial thread stack bottom is set to the bottom of
memory and the initial thread stack top is set to the top of memory.
Then as we create new stack threads, we figure out whether the new stack
is above or below the single known good address, and then scale back
either the tos or the bos accordingly.
Reviewed-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
__libc_accept __libc_close __libc_connect __libc_creat __libc_creat64
__libc_fsync __libc_lseek __libc_lseek64 __libc_msync __libc_nanosleep
__libc_open __libc_open64 __libc_pause __libc_read __libc_readv
__libc_recv __libc_recvfrom __libc_recvmsg
__libc_send __libc_sendmsg __libc_sendto
__libc_tcdrain __libc_wait __libc_waitpid __libc_write __libc_writev
They were removed from glibc 1 May 2004:
http://sources.redhat.com/ml/libc-hacker/2004-05/msg00001.html
|
|
Remove all other duplicated definitions.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
|
|
|
|
|
|
2001-04-10 Ulrich Drepper <drepper@redhat.com>
* join.c (pthread_exit): Move code to new function __pthread_do_exit
which takes an extra parameter with the current frame pointer.
Call new function with CURRENT_STACK_FRAME.
(__pthread_do_exit): New function. Call __pthread_perform_cleanup
with the new parameter.
(pthread_join): Call __pthread_do_exit instead of pthread_exit.
* cancel.c (__pthread_perform_cleanup): Takes extra parameter. Use
this parameter as the initial value the cleanup handler records are
compared against. No active cleanup handler record must have an
address lower than the previous one and the initial record must be
above (below on PA) the frame address passed in.
(pthread_setcancelstate): Call __pthread_do_exit instead of
pthread_exit.
(pthread_setcanceltype): Likewise.
(pthread_testcancel): Likewise.
(_pthread_cleanup_pop_restore): Likewise.
* condvar.c (pthread_cond_wait): Likewise.
(pthread_cond_timedwait_relative): Likewise.
* manager.c (pthread_start_thread): Likewise.
* oldsemaphore.c (__old_sem_wait): Likewise.
* pthread.c (pthread_handle_sigcancel): Likewise.
* semaphore.c (__new_sem_wait): Likewise.
(sem_timedwait): Likewise.
* ptlongjmp.c (pthread_cleanup_upto): Also use current stack frame
to limit the cleanup handlers which get run.
* internals.h: Add prototype for __pthread_do_exit. Adjust prototype
for __pthread_perform_cleanup.
|
|
2001-04-11 Ulrich Drepper <drepper@redhat.com>
* cancel.c (_pthread_cleanup_push): Catch invalid __prev buffer
and remove it.
(_pthread_cleanup_push_defer): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
dont use hidden_strong_alias
|
|
|
|
|
|
|
|
|
|
|
|
|
|
of latest glibc version
|