This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

__libc_stack_end cleanup


Fixes all the places that locally declare __libc_stack_end.

Ok?


r~


2004-01-15  Richard Henderson  <rth@redhat.com>

	* elf/dl-load.c: Don't declare __libc_stack_end.
	* sysdeps/generic/libc-start.c: Likewise.
	* sysdeps/unix/sysv/linux/dl-execstack.c: Likewise.
	* sysdeps/generic/segfault.c: Likewise.  Include ldsodefs.h.
	* sysdeps/generic/backtrace.c: Likewise.

linuxthreads/
	* attr.c: Include ldsodefs.h.
	(pthread_getattr_np): Don't declare __libc_stack_end.

nptl/
	* allocatestack.c: Don't declare __libc_stack_end.
	* init.c (__pthread_initialize_minimal_internal): Likewise.
	* pthread_getattr_np.c (pthread_getattr_np): Likewise.

Index: elf/dl-load.c
===================================================================
RCS file: /cvs/glibc/libc/elf/dl-load.c,v
retrieving revision 1.232
diff -c -p -d -u -r1.232 dl-load.c
--- elf/dl-load.c	15 Jan 2004 06:29:54 -0000	1.232
+++ elf/dl-load.c	16 Jan 2004 05:56:05 -0000
@@ -1949,7 +1949,6 @@ cannot create shared object descriptor")
 				  N_("cannot open shared object file"));
     }
 
-  extern void *__libc_stack_end;
   void *stack_end = __libc_stack_end;
   return _dl_map_object_from_fd (name, fd, &fb, realname, loader, type, mode,
 				 &stack_end);
Index: linuxthreads/attr.c
===================================================================
RCS file: /cvs/glibc/libc/linuxthreads/attr.c,v
retrieving revision 1.35
diff -c -p -d -u -r1.35 attr.c
--- linuxthreads/attr.c	31 Dec 2003 22:24:58 -0000	1.35
+++ linuxthreads/attr.c	16 Jan 2004 05:56:09 -0000
@@ -26,6 +26,8 @@
 #include "pthread.h"
 #include "internals.h"
 #include <shlib-compat.h>
+#include <ldsodefs.h>
+
 
 int __pthread_attr_init_2_1(pthread_attr_t *attr)
 {
@@ -415,9 +417,6 @@ int pthread_getattr_np (pthread_t thread
   if (descr == &__pthread_initial_thread)
 #endif
     {
-      /* Defined in ld.so.  */
-      extern void *__libc_stack_end;
-
       /* Stack size limit.  */
       struct rlimit rl;
 
Index: nptl/allocatestack.c
===================================================================
RCS file: /cvs/glibc/libc/nptl/allocatestack.c,v
retrieving revision 1.43
diff -c -p -d -u -r1.43 allocatestack.c
--- nptl/allocatestack.c	13 Jan 2004 15:46:12 -0000	1.43
+++ nptl/allocatestack.c	16 Jan 2004 05:56:12 -0000
@@ -661,8 +661,6 @@ __deallocate_stack (struct pthread *pd)
 }
 
 
-extern void *__libc_stack_end;
-
 int
 internal_function
 __make_stacks_executable (void **stack_endp)
Index: nptl/init.c
===================================================================
RCS file: /cvs/glibc/libc/nptl/init.c,v
retrieving revision 1.44
diff -c -p -d -u -r1.44 init.c
--- nptl/init.c	14 Jan 2004 08:50:55 -0000	1.44
+++ nptl/init.c	16 Jan 2004 05:56:12 -0000
@@ -217,9 +217,6 @@ __pthread_initialize_minimal_internal (v
   THREAD_SETMEM (pd, cpuclock_offset, GL(dl_cpuclock_offset));
 #endif
 
-  /* Defined in ld.so.  */
-  extern void *__libc_stack_end;
-
   /* Set initial thread's stack block from 0 up to __libc_stack_end.
      It will be bigger than it actually is, but for unwind.c/pt-longjmp.c
      purposes this is good enough.  */
Index: nptl/pthread_getattr_np.c
===================================================================
RCS file: /cvs/glibc/libc/nptl/pthread_getattr_np.c,v
retrieving revision 1.6
diff -c -p -d -u -r1.6 pthread_getattr_np.c
--- nptl/pthread_getattr_np.c	31 Dec 2003 23:41:06 -0000	1.6
+++ nptl/pthread_getattr_np.c	16 Jan 2004 05:56:12 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -71,9 +71,6 @@ pthread_getattr_np (thread_id, attr)
       /* No stack information available.  This must be for the initial
 	 thread.  Get the info in some magical way.  */
       assert (abs (thread->pid) == thread->tid);
-
-      /* Defined in ld.so.  */
-      extern void *__libc_stack_end;
 
       /* Stack size limit.  */
       struct rlimit rl;
Index: sysdeps/generic/backtrace.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/generic/backtrace.c,v
retrieving revision 1.8
diff -c -p -d -u -r1.8 backtrace.c
--- sysdeps/generic/backtrace.c	15 Jul 2002 02:09:00 -0000	1.8
+++ sysdeps/generic/backtrace.c	16 Jan 2004 05:56:15 -0000
@@ -1,5 +1,5 @@
 /* Return backtrace of current program state.  Generic version.
-   Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -23,11 +23,7 @@
 #include <frame.h>
 #include <sigcontextinfo.h>
 #include <bp-checks.h>
-
-/* This is a global variable set at program start time.  It marks the
-   highest used stack address.  */
-extern void *__libc_stack_end;
-
+#include <ldsodefs.h>
 
 /* This implementation assumes a stack layout that matches the defaults
    used by gcc's `__builtin_frame_address' and `__builtin_return_address'
Index: sysdeps/generic/libc-start.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/generic/libc-start.c,v
retrieving revision 1.47
diff -c -p -d -u -r1.47 libc-start.c
--- sysdeps/generic/libc-start.c	14 Jan 2004 00:23:09 -0000	1.47
+++ sysdeps/generic/libc-start.c	16 Jan 2004 05:56:16 -0000
@@ -26,7 +26,6 @@
 extern void __libc_init_first (int argc, char **argv, char **envp);
 
 extern int __libc_multiple_libcs;
-extern void *__libc_stack_end;
 
 #include <tls.h>
 #ifndef SHARED
Index: sysdeps/generic/segfault.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/generic/segfault.c,v
retrieving revision 1.18
diff -c -p -d -u -r1.18 segfault.c
--- sysdeps/generic/segfault.c	3 Nov 2002 08:42:11 -0000	1.18
+++ sysdeps/generic/segfault.c	16 Jan 2004 05:56:17 -0000
@@ -1,5 +1,6 @@
 /* Catch segmentation faults and print backtrace.
-   Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -28,6 +29,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <stdio-common/_itoa.h>
+#include <ldsodefs.h>
 
 #include <bp-checks.h>
 
@@ -40,11 +42,6 @@
 
 /* Get code to possibly dump the content of all registers.  */
 #include <register-dump.h>
-
-/* This is a global variable set at program start time.  It marks the
-   highest used stack address.  */
-extern void *__libc_stack_end;
-
 
 /* This implementation assumes a stack layout that matches the defaults
    used by gcc's `__builtin_frame_address' and `__builtin_return_address'
Index: sysdeps/unix/sysv/linux/dl-execstack.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/dl-execstack.c,v
retrieving revision 1.7
diff -c -p -d -u -r1.7 dl-execstack.c
--- sysdeps/unix/sysv/linux/dl-execstack.c	13 Jan 2004 20:18:20 -0000	1.7
+++ sysdeps/unix/sysv/linux/dl-execstack.c	16 Jan 2004 05:56:21 -0000
@@ -26,8 +26,6 @@
 #include "kernel-features.h"
 
 
-extern void *__libc_stack_end attribute_hidden;
-
 int
 internal_function
 _dl_make_stack_executable (void **stack_endp)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]