aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--elf/Makefile2
-rw-r--r--elf/dl-load.c8
-rw-r--r--linuxthreads/ChangeLog12
-rw-r--r--linuxthreads/internals.h7
-rw-r--r--linuxthreads/manager.c2
-rw-r--r--linuxthreads/pthread.c16
-rw-r--r--linuxthreads/sysdeps/i386/useldt.h3
-rw-r--r--sysdeps/ia64/Dist2
9 files changed, 42 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 96ba5b8..7ed139d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2000-05-05 Ulrich Drepper <drepper@redhat.com>
+ * elf/Makefile (distribute): Add dl-lookupcfg.h.
+ * sysdeps/ia64/Dist: New file.
+
* elf/dl-load.c (_dl_map_object_from_fd): Little of computation of
parameter to mprotect and for variable assignments.
diff --git a/elf/Makefile b/elf/Makefile
index fc7ce78..da266b8 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -39,7 +39,7 @@ distribute := $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \
dl-cache.h dl-hash.h soinit.c sofini.c ldd.bash.in \
genrtldtbl.awk atomicity.h dl-procinfo.h ldsodefs.h \
dl-librecon.h interp.c sln.c dl-dst.h hp-timing.h \
- do-lookup.h sprof.c gen-trusted-dirs.awk \
+ do-lookup.h dl-lookupcfg.h sprof.c gen-trusted-dirs.awk \
testobj1.c testobj2.c testobj3.c testobj4.c testobj5.c \
testobj6.c testobj1_1.c failobj.c \
ldconfig.h ldconfig.c cache.c readlib.c readelflib.c \
diff --git a/elf/dl-load.c b/elf/dl-load.c
index f5d91ba..10698ce 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -922,17 +922,17 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname,
- MAP_BASE_ADDR (l));
/* Remember which part of the address space this object uses. */
- l->l_map_start = map_segment (mappref, maplength, c->prot, 0,
- c->mapoff);
+ l->l_map_start = (ElfW(Addr)) map_segment (mappref, maplength, c->prot,
+ 0, c->mapoff);
l->l_map_end = l->l_map_start + maplength;
- l->l_addr = (ElfW(Addr)) mapat - c->mapstart;
+ l->l_addr = l->l_map_start - c->mapstart;
/* Change protection on the excess portion to disallow all access;
the portions we do not remap later will be inaccessible as if
unallocated. Then jump into the normal segment-mapping loop to
handle the portion of the segment past the end of the file
mapping. */
- __mprotect ((caddr_t) l->l_map_start,
+ __mprotect ((caddr_t) (l->l_addr + c->mapend),
loadcmds[nloadcmds - 1].allocend - c->mapend,
0);
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 6072abc..b4f3343 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,4 +1,14 @@
-2000-04-29 Bruno Haible <clisp.cons.org>
+2000-05-05 Ulrich Drepper <drepper@redhat.com>
+
+ * internals.h (struct _pthread_descr_struct): Reorganization.
+ Allocate room for 16 pointers at head of the structure for future
+ thread-local data handling. Move p_self member in this area.
+ * manager.c (pthread_handle_create): Adjust use of p_self.
+ * sysdeps/i386/useldt.h (THREAD_SELF): Likewise.
+ * pthread.c (__pthread_initial_thread): Adjust initialization.
+ (__pthread_manager_thread): Likewise.
+
+2000-04-29 Bruno Haible <haible@clisp.cons.org>
* join.c (pthread_exit): Use THREAD_GETMEM_NC instead of THREAD_GETMEM
for eventmask larger than 1 word.
diff --git a/linuxthreads/internals.h b/linuxthreads/internals.h
index 079bf2c..b257be0 100644
--- a/linuxthreads/internals.h
+++ b/linuxthreads/internals.h
@@ -124,6 +124,12 @@ typedef struct _pthread_rwlock_info {
} pthread_readlock_info;
struct _pthread_descr_struct {
+ union {
+ struct {
+ pthread_descr self; /* Pointer to this structure */
+ } data;
+ void *__padding[16];
+ } p_header;
pthread_descr p_nextlive, p_prevlive;
/* Double chaining of active threads */
pthread_descr p_nextwaiting; /* Next element in the queue holding the thr */
@@ -157,7 +163,6 @@ struct _pthread_descr_struct {
int p_userstack; /* nonzero if the user provided the stack */
void *p_guardaddr; /* address of guard area or NULL */
size_t p_guardsize; /* size of guard area */
- pthread_descr p_self; /* Pointer to this structure */
int p_nr; /* Index of descriptor in __pthread_handles */
int p_report_events; /* Nonzero if events must be reported. */
td_eventbuf_t p_eventbuf; /* Data for event. */
diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c
index 33c791c..0c781de 100644
--- a/linuxthreads/manager.c
+++ b/linuxthreads/manager.c
@@ -385,7 +385,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
new_thread->p_resp = &new_thread->p_res;
new_thread->p_guardaddr = guardaddr;
new_thread->p_guardsize = guardsize;
- new_thread->p_self = new_thread;
+ new_thread->p_header.data.self = new_thread;
new_thread->p_nr = sseg;
/* Initialize the thread handle */
__pthread_init_lock(&__pthread_handles[sseg].h_lock);
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index a78e0c9..0e713e7 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -37,6 +37,11 @@
/* Descriptor of the initial thread */
struct _pthread_descr_struct __pthread_initial_thread = {
+ {
+ {
+ &__pthread_initial_thread /* pthread_descr self */
+ }
+ },
&__pthread_initial_thread, /* pthread_descr p_nextlive */
&__pthread_initial_thread, /* pthread_descr p_prevlive */
NULL, /* pthread_descr p_nextwaiting */
@@ -71,7 +76,6 @@ struct _pthread_descr_struct __pthread_initial_thread = {
0, /* int p_userstack */
NULL, /* void * p_guardaddr */
0, /* size_t p_guardsize */
- &__pthread_initial_thread, /* pthread_descr p_self */
0, /* Always index 0 */
0, /* int p_report_events */
{{{0, }}, 0, NULL}, /* td_eventbuf_t p_eventbuf */
@@ -88,6 +92,11 @@ struct _pthread_descr_struct __pthread_initial_thread = {
and the address for identification. */
struct _pthread_descr_struct __pthread_manager_thread = {
+ {
+ {
+ &__pthread_manager_thread /* pthread_descr self */
+ }
+ },
NULL, /* pthread_descr p_nextlive */
NULL, /* pthread_descr p_prevlive */
NULL, /* pthread_descr p_nextwaiting */
@@ -122,7 +131,6 @@ struct _pthread_descr_struct __pthread_manager_thread = {
0, /* int p_userstack */
NULL, /* void * p_guardaddr */
0, /* size_t p_guardsize */
- &__pthread_manager_thread, /* pthread_descr p_self */
1, /* Always index 1 */
0, /* int p_report_events */
{{{0, }}, 0, NULL}, /* td_eventbuf_t p_eventbuf */
@@ -369,12 +377,12 @@ static void pthread_initialize(void)
sa.sa_flags = 0;
__sigaction(__pthread_sig_restart, &sa, NULL);
sa.sa_handler = pthread_handle_sigcancel;
- sa.sa_flags = 0;
+ // sa.sa_flags = 0;
__sigaction(__pthread_sig_cancel, &sa, NULL);
if (__pthread_sig_debug > 0) {
sa.sa_handler = pthread_handle_sigdebug;
sigemptyset(&sa.sa_mask);
- sa.sa_flags = 0;
+ // sa.sa_flags = 0;
__sigaction(__pthread_sig_debug, &sa, NULL);
}
/* Initially, block __pthread_sig_restart. Will be unblocked on demand. */
diff --git a/linuxthreads/sysdeps/i386/useldt.h b/linuxthreads/sysdeps/i386/useldt.h
index e6055e0..bd527a3 100644
--- a/linuxthreads/sysdeps/i386/useldt.h
+++ b/linuxthreads/sysdeps/i386/useldt.h
@@ -54,7 +54,8 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
({ \
register pthread_descr __self; \
__asm__ ("movl %%gs:%c1,%0" : "=r" (__self) \
- : "i" (offsetof (struct _pthread_descr_struct, p_self))); \
+ : "i" (offsetof (struct _pthread_descr_struct, \
+ p_header.data.self))); \
__self; \
})
diff --git a/sysdeps/ia64/Dist b/sysdeps/ia64/Dist
new file mode 100644
index 0000000..9fc1de2
--- /dev/null
+++ b/sysdeps/ia64/Dist
@@ -0,0 +1,2 @@
+dl-symaddr.c
+dl-fptr.c