summary refs log tree commit diff
path: root/elf/dl-reloc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-01-29 23:20:28 +0000
committerUlrich Drepper <drepper@redhat.com>2002-01-29 23:20:28 +0000
commitbe4b5a955552a633de592a04420f4cdf8476339e (patch)
tree9050cb0d763ff0acc5b88c56d60ee02af4816a85 /elf/dl-reloc.c
parente66d0a4c940c8643299de621a951f2dfa44d998b (diff)
downloadglibc-be4b5a955552a633de592a04420f4cdf8476339e.tar.gz
glibc-be4b5a955552a633de592a04420f4cdf8476339e.tar.xz
glibc-be4b5a955552a633de592a04420f4cdf8476339e.zip
Update.
	* elf/dl-lookup.c: Only define or handle _dl_num_relocations for the
	SHARED version.
	* elf/dl-reloc.c: Likewise for _dl_num_cache_relocations.
Diffstat (limited to 'elf/dl-reloc.c')
-rw-r--r--elf/dl-reloc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index 4d4ca149ea..748aa3b8e2 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -1,5 +1,5 @@
 /* Relocate a shared object and resolve its references to other loaded objects.
-   Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+   Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -27,8 +27,13 @@
 #include <sys/types.h>
 #include "dynamic-link.h"
 
+#ifdef SHARED
 /* Statistics function.  */
 unsigned long int _dl_num_cache_relocations;
+# define bump_num_cache_relocations() ++_dl_num_cache_relocations
+#else
+# define bump_num_cache_relocations() 0
+#endif
 
 
 void
@@ -113,7 +118,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)  \
-	? (++_dl_num_cache_relocations,					      \
+	? (bump_num_cache_relocations,					      \
 	   (*ref) = l->l_lookup_cache.ret,				      \
 	   l->l_lookup_cache.value)					      \
 	: ({ lookup_t _lr;						      \
@@ -133,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)  \
-	? (++_dl_num_cache_relocations,					      \
+	? (bump_num_cache_relocations,					      \
 	   (*ref) = l->l_lookup_cache.ret,				      \
 	   l->l_lookup_cache.value)					      \
 	: ({ lookup_t _lr;						      \