aboutsummaryrefslogtreecommitdiff
path: root/gdb/munch
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/munch')
-rwxr-xr-xgdb/munch15
1 files changed, 9 insertions, 6 deletions
diff --git a/gdb/munch b/gdb/munch
index daecee4..eef3927 100755
--- a/gdb/munch
+++ b/gdb/munch
@@ -1,14 +1,17 @@
#! /bin/sh
# create an initialization procedure from a list of .o files
-# Look in object files, find symbols including the string _initialize_,
-# and call each one as a function.
echo '/* Do not modify this file. It is created automatically by "munch". */'
-echo 'void init_all_files () {'
+echo 'void initialize_all_files () {'
-nm $* | egrep '_initialize_' | \
- sed -e 's/^.*\(initialize_[a-zA-Z_0-9]*\).*$/ _\1 ();/' | \
- sort -u
+if test "$1" = "-DSYSV" ; then
+ shift;
+ nm $* | egrep '^(.*[^a-zA-Z_]_|_)initialize_' | \
+ sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\)[^a-zA-Z0-9_].*$/ \1 ();/'
+else
+ nm -p $* | egrep 'T *__initialize_' | \
+ sed -e 's/^.*T *_*\(.*\)/ _\1 ();/'
+fi
echo '}'