aboutsummaryrefslogtreecommitdiff
path: root/gdb/munch
blob: eef3927fd1e82bf8694ed74a87cc366e0f46fa66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/sh

# create an initialization procedure from a list of .o files

echo '/* Do not modify this file.  It is created automatically by "munch". */'
echo 'void initialize_all_files () {'

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 '}'