]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sun, 7 Feb 1999 21:21:33 +0000 (21:21 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 7 Feb 1999 21:21:33 +0000 (21:21 +0000)
1999-02-07  Ulrich Drepper  <drepper@cygnus.com>

* elf/dl-lookup.c: Increment _dl_num_relocations in the four entry
point functions, not do_lookup since the later can be called more
than once.

ChangeLog
elf/dl-lookup.c
sysdeps/generic/segfault.c

index dad84f5432d50a85f3700fbec0576b45de6accf6..0c8fab08d74704a1b535b9b805f55266913640a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1999-02-07  Ulrich Drepper  <drepper@cygnus.com>
+
+       * elf/dl-lookup.c: Increment _dl_num_relocations in the four entry
+       point functions, not do_lookup since the later can be called more
+       than once.
+
 1999-02-03  Jakub Jelinek  <jj@ultra.linux.cz>
 
        * sysdeps/generic/segfault.c: Add ADVANCE_STACK_FRAME
index 01d71678b403d6d633988b24b90e8695c2fb285d..ef953c54753607c20b91d9dd6d70e7c0893d51cd 100644 (file)
@@ -1,5 +1,5 @@
 /* Look up a symbol in the loaded objects.
-   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999 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
@@ -74,8 +74,6 @@ do_lookup (const char *undef_name, unsigned long int hash,
   size_t n = scope->r_nlist;
   struct link_map *map;
 
-  ++_dl_num_relocations;
-
   for (; i < n; ++i)
     {
       const ElfW(Sym) *symtab;
@@ -189,7 +187,7 @@ do_lookup (const char *undef_name, unsigned long int hash,
          goto found_it;
        }
 
-      /* If we have seem exactly one versioned symbol while we are
+      /* If we have seen exactly one versioned symbol while we are
         looking for an unversioned symbol and the version is not the
         default version we still accept this symbol since there are
         no possible ambiguities.  */
@@ -244,6 +242,8 @@ _dl_lookup_symbol (const char *undef_name, const ElfW(Sym) **ref,
   struct sym_val current_value = { NULL, NULL };
   struct r_scope_elem **scope;
 
+  ++_dl_num_relocations;
+
   /* Search the relevant loaded objects for a definition.  */
   for (scope = symbol_scope; *scope; ++scope)
     if (do_lookup (undef_name, hash, *ref, &current_value,
@@ -293,6 +293,8 @@ _dl_lookup_symbol_skip (const char *undef_name, const ElfW(Sym) **ref,
   struct r_scope_elem **scope;
   size_t i;
 
+  ++_dl_num_relocations;
+
   /* Search the relevant loaded objects for a definition.  */
   scope = symbol_scope;
   for (i = 0; (*scope)->r_duplist[i] != skip_map; ++i)
@@ -342,6 +344,8 @@ _dl_lookup_versioned_symbol (const char *undef_name, const ElfW(Sym) **ref,
   struct sym_val current_value = { NULL, NULL };
   struct r_scope_elem **scope;
 
+  ++_dl_num_relocations;
+
   /* Search the relevant loaded objects for a definition.  */
   for (scope = symbol_scope; *scope; ++scope)
     {
@@ -409,6 +413,8 @@ _dl_lookup_versioned_symbol_skip (const char *undef_name,
   struct r_scope_elem **scope;
   size_t i;
 
+  ++_dl_num_relocations;
+
   /* Search the relevant loaded objects for a definition.  */
   scope = symbol_scope;
   for (i = 0; (*scope)->r_duplist[i] != skip_map; ++i)
index 502b239602b854f6fbc8b28a3229b6d205f828eb..848dae43dc87ccf7565b85e526833d2b1f8b94e1 100644 (file)
@@ -1,5 +1,5 @@
 /* Catch segmentation faults and print backtrace.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -61,9 +61,15 @@ extern void *__libc_stack_end;
 # define INNER_THAN <
 #endif
 
+/* By default assume the `next' pointer in struct layout points to the
+   next struct layout.  */
+#ifndef ADVANCE_STACK_FRAME
+# define ADVANCE_STACK_FRAME(next) ((struct layout *) (next))
+#endif
+
 struct layout
 {
-  struct layout *next;
+  void *next;
   void *return_address;
 };
 
@@ -118,7 +124,7 @@ catch_segfault (int signal, SIGCONTEXT ctx)
     {
       ++cnt;
 
-      current = current->next;
+      current = ADVANCE_STACK_FRAME (current->next);
     }
 
   arr = alloca (cnt * sizeof (void *));
@@ -133,7 +139,7 @@ catch_segfault (int signal, SIGCONTEXT ctx)
     {
       arr[cnt++] = current->return_address;
 
-      current = current->next;
+      current = ADVANCE_STACK_FRAME (current->next);
     }
 
   /* If the last return address was NULL, assume that it doesn't count.  */
@@ -179,7 +185,7 @@ install_handler (void)
            sa.sa_flags |= SA_ONSTACK;
        }
     }
-  
+
   if (sigs == NULL)
     sigaction (SIGSEGV, &sa, NULL);
   else if (sigs[0] == '\0')