This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Need to do some sort of die/warn to get the "global destruction"
[perl5.git] / mpeix / nm
CommitLineData
1d84e8df
JH
1#!/bin/sh
2
3# MPE doesn't have a native nm, and the gcc nm isn't quite fully functional.
4#
5# If Perl Configure is calling us, then use the native linker to extract the
6# symbol table and reformat it into something nm-like.
7#
8# Else it must be gcc calling us during the final link phase, so call gcc nm.
9
10if [ "$1" != "-configperl" ]; then
11 # Oops, the caller must be expecting gcc nm. Give it to them.
12 /usr/local/bin/nm $@
13 exit $?
14fi
15
16case $2 in
17 *.a) LIST="LISTRL RL=$2;DATA;ENTRYSYM" ;;
18 *.sl) LIST="LISTXL XL=$2;DATA;ENTRYSYM" ;;
19 *) exit 0 ;;
20esac
21
22# I wanted to pipe this into awk, but it fell victim to a known pipe/streams
23# bug on my multiprocessor machine.
24
2359510d 25callci xeq linkedit.pub.sys \"$LIST\" >nm.$$
1d84e8df 26
6b7580e5 27/bin/awk '\
1d84e8df 28 / data univ / { printf "%-20s|%10s|%-6s|%-7s|%s\n",$1,$5,"extern","data","?"} \
2359510d 29 / entry univ / { printf "%-20s|%10s|%-6s|%-7s|%s\n",$1,$7,"extern","entry","?"}' nm.$$
1d84e8df 30
2359510d 31rm -f nm.$$
1d84e8df
JH
32
33exit 0