From ccdf0cab1d670a05afff42b02c7583ccd23abde9 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 1 Feb 2002 07:49:47 +0000 Subject: Update. * elf/dl-minimal.c: Define _itoa for 32-bit machines with HP timing. * elf/dl-reloc.c: Pretty printing. * sysdeps/generic/ldsodefs.h: Move _dl_hp_timing_overhead and procinfo-related variables in rtld_global struct. * elf/dl-support.c: Likewise. * elf/rtld.c: Likewise. * sysdeps/i386/i686/Makefile: Likewise. * sysdeps/i386/i686/hp-timing.c: Likewise. * sysdeps/i386/i686/hp-timing.h: Likewise. * sysdeps/ia64/Makefile: Likewise. * sysdeps/ia64/hp-timing.c: Likewise. * sysdeps/sparc/sparc32/sparcv9/Makefile: Likewise. * sysdeps/sparc/sparc32/sparcv9/hp-timing.c: Likewise. * sysdeps/unix/sysv/linux/arm/dl-procinfo.c: Likewise. * sysdeps/unix/sysv/linux/arm/dl-procinfo.h: Likewise. * sysdeps/unix/sysv/linux/i386/Makefile: Likewise. * sysdeps/unix/sysv/linux/i386/dl-procinfo.c: Likewise. * sysdeps/unix/sysv/linux/i386/dl-procinfo.h: Likewise. * sysdeps/x86_64/Makefile: Likewise. --- elf/dl-minimal.c | 23 +++++++++++++++++++++++ elf/dl-reloc.c | 2 +- elf/dl-support.c | 3 +++ elf/rtld.c | 2 ++ 4 files changed, 29 insertions(+), 1 deletion(-) (limited to 'elf') diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c index 12e9d69..001fc6d 100644 --- a/elf/dl-minimal.c +++ b/elf/dl-minimal.c @@ -268,3 +268,26 @@ __strtoul_internal (const char *nptr, char **endptr, int base, int group) *endptr = (char *) nptr; return result * sign; } + + +#if HP_TIMING_AVAIL && ULONG_MAX <= 4294967295UL +/* We need this function to print the cycle count. On 64-bit machines the + _itoa_word function should be used. */ +char * +_itoa (value, buflim, base, upper_case) + unsigned long long int value; + char *buflim; + unsigned int base; + int upper_case; +{ + char *bp = buflim; + + assert (base == 10); + + do + *--bp = '0' + value % 10; + while ((value /= 10) != 0); + + return bp; +} +#endif diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c index a3ee153..8fea3fd 100644 --- a/elf/dl-reloc.c +++ b/elf/dl-reloc.c @@ -138,7 +138,7 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[], (ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \ ? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \ && elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \ - ? (bump_num_cache_relocations (), \ + ? (bump_num_cache_relocations (), \ (*ref) = l->l_lookup_cache.ret, \ l->l_lookup_cache.value) \ : ({ lookup_t _lr; \ diff --git a/elf/dl-support.c b/elf/dl-support.c index b78b79d..9a9436e 100644 --- a/elf/dl-support.c +++ b/elf/dl-support.c @@ -91,6 +91,9 @@ struct r_scope_elem *_dl_main_searchlist = &_dl_initial_searchlist; /* Nonzero during startup. */ int _dl_starting_up = 1; +/* Get architecture specific initializer. */ +#include + /* We expect less than a second for relocation. */ #ifdef HP_SMALL_TIMING_AVAIL # undef HP_TIMING_AVAIL diff --git a/elf/rtld.c b/elf/rtld.c index e4c2c6e..af7b27f 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -74,6 +74,8 @@ int _dl_starting_up; (except those which cannot be added for some reason). */ struct rtld_global _rtld_global = { + /* Get architecture specific initializer. */ +#include ._dl_debug_fd = STDERR_FILENO, #if 1 /* XXX I know about at least one case where we depend on the old -- cgit v1.1