summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-11-13 18:58:01 +0000
committerUlrich Drepper <drepper@redhat.com>2004-11-13 18:58:01 +0000
commitc120d94d58267b1100eb871fcb27a498da129d59 (patch)
tree17562365fc3bbec6e97f2c2cc49268ed53cd8a28
parent37fa1953d539cc34c33b48bc66a64f5c01dbc1fd (diff)
Update.
2004-11-13 Jakub Jelinek <jakub@redhat.com> * elf/rtld.c (print_statistics): Avoid segfaults if not all namespaces are used. Fix computation of num_relative_relocations on RELA architectures other than IA-64 and Alpha. 2004-11-13 Ulrich Drepper <drepper@redhat.com> * malloc/malloc.c (_int_free): Use munmap_chunk for handling mmaped memory.
-rw-r--r--ChangeLog11
-rw-r--r--elf/rtld.c20
-rw-r--r--malloc/malloc.c8
3 files changed, 27 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 21c8666aa4..8defa6a6a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-11-13 Jakub Jelinek <jakub@redhat.com>
+
+ * elf/rtld.c (print_statistics): Avoid segfaults if not all namespaces
+ are used. Fix computation of num_relative_relocations on RELA
+ architectures other than IA-64 and Alpha.
+
+2004-11-13 Ulrich Drepper <drepper@redhat.com>
+
+ * malloc/malloc.c (_int_free): Use munmap_chunk for handling
+ mmaped memory.
+
2004-11-12 Ulrich Drepper <drepper@redhat.com>
* malloc/malloc.c (_int_free): Remove test for NULL parameter.
diff --git a/elf/rtld.c b/elf/rtld.c
index 29aee2d96d..601fc7d53c 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2336,19 +2336,29 @@ print_statistics (hp_timing_t *rtld_total_timep)
unsigned long int num_relative_relocations = 0;
for (Lmid_t ns = 0; ns < DL_NNS; ++ns)
{
+ if (GL(dl_ns)[ns]._ns_loaded == NULL)
+ continue;
+
struct r_scope_elem *scope = &GL(dl_ns)[ns]._ns_loaded->l_searchlist;
for (unsigned int i = 0; i < scope->r_nlist; i++)
{
struct link_map *l = scope->r_list [i];
- if (!l->l_addr)
- continue;
-
- if (l->l_info[VERSYMIDX (DT_RELCOUNT)])
+ if (l->l_addr != 0 && l->l_info[VERSYMIDX (DT_RELCOUNT)])
num_relative_relocations
+= l->l_info[VERSYMIDX (DT_RELCOUNT)]->d_un.d_val;
- if (l->l_info[VERSYMIDX (DT_RELACOUNT)])
+#ifndef ELF_MACHINE_REL_RELATIVE
+ /* Relative relocations are processed on these architectures if
+ library is loaded to different address than p_vaddr or
+ if not prelinked. */
+ if ((l->l_addr != 0 || !l->l_info[VALIDX(DT_GNU_PRELINKED)])
+ && l->l_info[VERSYMIDX (DT_RELACOUNT)])
+#else
+ /* On e.g. IA-64 or Alpha, relative relocations are processed
+ only if library is loaded to different address than p_vaddr. */
+ if (l->l_addr != 0 && l->l_info[VERSYMIDX (DT_RELACOUNT)])
+#endif
num_relative_relocations
+= l->l_info[VERSYMIDX (DT_RELACOUNT)]->d_un.d_val;
}
diff --git a/malloc/malloc.c b/malloc/malloc.c
index d2112b159a..85a9f45861 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -4370,13 +4370,7 @@ _int_free(mstate av, Void_t* mem)
else {
#if HAVE_MMAP
- int ret;
- INTERNAL_SIZE_T offset = p->prev_size;
- mp_.n_mmaps--;
- mp_.mmapped_mem -= (size + offset);
- ret = munmap((char*)p - offset, size + offset);
- /* munmap returns non-zero on failure */
- assert(ret == 0);
+ munmap_chunk (p);
#endif
}
}