aboutsummaryrefslogtreecommitdiff
path: root/gdb/munch
diff options
context:
space:
mode:
authorgdb-3.3 <gdb@fsf.org>1989-09-30 00:00:00 +0000
committerPedro Alves <palves@redhat.com>2012-06-03 15:36:32 +0100
commit4187119d59afd156703cfcbc6be287c5085f1867 (patch)
tree8ea0d77175611df1eeec928858f629d410dd6e05 /gdb/munch
parente91b87a36830d061ef87d67be5f309e4d4ed918f (diff)
downloadgdb-4187119d59afd156703cfcbc6be287c5085f1867.zip
gdb-4187119d59afd156703cfcbc6be287c5085f1867.tar.gz
gdb-4187119d59afd156703cfcbc6be287c5085f1867.tar.bz2
gdb-3.3
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 '}'