summaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-11-15 09:47:23 +0000
committerJakub Jelinek <jakub@redhat.com>2004-11-15 09:47:23 +0000
commitb3c20a361d75caf75f670b2fcd64ab8668c16ca5 (patch)
treecac006e13628dcbf5a48cb618417ae708906db89 /elf
parent87ffc9aca119436c8530d6605483a49cfb16668e (diff)
Updated to fedora-glibc-20041115T0915
Diffstat (limited to 'elf')
-rw-r--r--elf/elf.h7
-rw-r--r--elf/rtld.c20
2 files changed, 21 insertions, 6 deletions
diff --git a/elf/elf.h b/elf/elf.h
index db95254f74..0daff76a41 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -2402,8 +2402,13 @@ typedef Elf32_Addr Elf32_Conflict;
#define R_390_TLS_DTPOFF 55 /* Offset in TLS block. */
#define R_390_TLS_TPOFF 56 /* Negated offset in static TLS
block. */
+#define R_390_20 57 /* Direct 20 bit. */
+#define R_390_GOT20 58 /* 20 bit GOT offset. */
+#define R_390_GOTPLT20 59 /* 20 bit offset to jump slot. */
+#define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS
+ block offset. */
/* Keep this the last entry. */
-#define R_390_NUM 57
+#define R_390_NUM 61
/* CRIS relocations. */
diff --git a/elf/rtld.c b/elf/rtld.c
index e53273c2bb..e442aa257f 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2444,19 +2444,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;
}