old-cross-binutils/gdb/munch
2012-06-03 15:36:32 +01:00

17 lines
462 B
Bash
Executable file

#! /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 '}'