* Makeconfig: Add missing comment.
authorGreg McGary <greg@mcgary.org>
Tue, 27 Jun 2000 01:20:02 +0000 (01:20 +0000)
committerGreg McGary <greg@mcgary.org>
Tue, 27 Jun 2000 01:20:02 +0000 (01:20 +0000)
* csu/Makefile (extra-objs, omit-deps, install-lib): Add
BP-flavored startup object.
($(objpfx)b$(start-installed-name)): New rule.
* include/libc-symbols.h (symbol_set_declare): Change type
of `__start_##set' and `__stop_##set' to pointer-to-function.
(symbol_set_declare): Change type of `set' to array of
pointer-to-function.
* include/set-hooks.h (RUN_HOOK): Change type of `ptr' to
pointer-to-function.
* Makeconfig: Add missing comment.
* csu/Makefile (extra-objs, omit-deps, install-lib): Add
BP-flavored startup object.
($(objpfx)b$(start-installed-name)): New rule.
* include/libc-symbols.h (symbol_set_declare): Change type
of `__start_##set' and `__stop_##set' to pointer-to-function.
(symbol_set_declare): Change type of `set' to array of
pointer-to-function.
* include/set-hooks.h (RUN_HOOK): Change type of `ptr' to
pointer-to-function.

ChangeLog
Makeconfig
csu/Makefile
include/libc-symbols.h
include/set-hooks.h

index 80f9768..0ce877f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2000-06-26  Greg McGary  <greg@mcgary.org>
 
+       * Makeconfig: Add missing comment.
+       * csu/Makefile (extra-objs, omit-deps, install-lib): Add
+       BP-flavored startup object.
+       ($(objpfx)b$(start-installed-name)): New rule.
+       * include/libc-symbols.h (symbol_set_declare): Change type
+       of `__start_##set' and `__stop_##set' to pointer-to-function.
+       (symbol_set_declare): Change type of `set' to array of
+       pointer-to-function.
+       * include/set-hooks.h (RUN_HOOK): Change type of `ptr' to
+       pointer-to-function.
+
        * string/bits/string2.h: Inhibit inlines if __BOUNDED_POINTERS__.
 
        * sysdeps/unix/sysv/linux/syscalls.list: Add missing signatures.
index f087137..0395bee 100644 (file)
@@ -634,6 +634,8 @@ bppfx = BP-
 ifeq (yes,$(build-bounded))
 # Under --enable-bounded, we build the library with `-fbounded-pointers -g'
 # to runtime bounds checking.  The bounded-pointer objects are named foo.ob.
+# We disable sibling-call optimizations so that stack traces will be complete
+# and thus aid debugging, since after all, BPs are a debugging tool.
 object-suffixes += .ob
 CPPFLAGS-.ob = -fbounded-pointers $(pic-default)
 CFLAGS-.ob = -g -O2 -fno-optimize-sibling-calls
index 01a44cf..a50a44f 100644 (file)
@@ -30,11 +30,11 @@ subdir := csu
 routines = init-first libc-start $(libc-init) sysdep version check_fds
 csu-dummies = $(filter-out $(start-installed-name),crt1.o Mcrt1.o)
 extra-objs = start.o gmon-start.o \
-            $(start-installed-name) g$(start-installed-name) \
+            $(start-installed-name) g$(start-installed-name) b$(start-installed-name) \
             $(csu-dummies)
 omit-deps = $(patsubst %.o,%,$(start-installed-name) g$(start-installed-name) \
-                            $(csu-dummies))
-install-lib = $(start-installed-name) g$(start-installed-name) \
+                             b$(start-installed-name) $(csu-dummies))
+install-lib = $(start-installed-name) g$(start-installed-name) b$(start-installed-name) \
              $(csu-dummies)
 distribute = initfini.c gmon-start.c start.c defs.awk munch.awk \
             abi-note.S init.c munch-tmpl.c
@@ -130,6 +130,9 @@ ifeq (yes,$(elf))
 $(objpfx)$(start-installed-name): $(objpfx)start.o $(objpfx)abi-note.o \
                                  $(objpfx)init.o
        $(link-relocatable)
+$(objpfx)b$(start-installed-name): $(objpfx)start.ob $(objpfx)abi-note.ob \
+                                 $(objpfx)init.ob
+       $(link-relocatable)
 else
 # The startfile is installed under different names, so we just call our
 # source file `start.c' and copy to the installed name after compiling.
index 1a3e1c8..10232bf 100644 (file)
 
 /* Declare SET for use in this module, if defined in another module.  */
 #  define symbol_set_declare(set) \
-  extern void *const __start_##set __attribute__ ((__weak__));         \
-  extern void *const __stop_##set __attribute__ ((__weak__));          \
+  extern void (*const __start_##set) (void) __attribute__ ((__weak__));        \
+  extern void (*const __stop_##set) (void) __attribute__ ((__weak__)); \
   weak_extern (__start_##set) weak_extern (__stop_##set)
 
 /* Return a pointer (void *const *) to the first element of SET.  */
   asm(".stabs \"" __SYMBOL_PREFIX #set "\",25,0,0," __SYMBOL_PREFIX #symbol)
 #  define bss_set_element(set, symbol) ?error Must use initialized data.
 #  define symbol_set_define(set)       void *const (set)[1];
-#  define symbol_set_declare(set)      extern void *const (set)[1];
+#  define symbol_set_declare(set)      extern void (*const (set)[1]) (void);
 
 #  define symbol_set_first_element(set)        &(set)[1]
 #  define symbol_set_end_p(set, ptr)   (*(ptr) == 0)
index 1666485..f4d7246 100644 (file)
@@ -42,7 +42,7 @@
 
 # define RUN_HOOK(NAME, ARGS) \
 do {                                                                      \
-  void *const *ptr;                                                       \
+  void (*const *ptr) (void);                                              \
   for (ptr = symbol_set_first_element (NAME);                             \
        ! symbol_set_end_p (NAME, ptr); ++ptr)                             \
     (*(__##NAME##_hook_function_t *) *ptr) ARGS;                          \