summaryrefslogtreecommitdiff
path: root/mpeix/nm
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1998-07-14 03:07:30 +0300
committerGurusamy Sarathy <gsar@cpan.org>1998-07-14 05:53:08 +0000
commit1d84e8dfc14d5303f4e9e567bd263f6b4d88e584 (patch)
treec3b41441d1e4461c6a69f523e8e773af19185a57 /mpeix/nm
parentb9d5759e179510f18c95c0d3686ffa808dca661e (diff)
downloadperl-1d84e8dfc14d5303f4e9e567bd263f6b4d88e584.tar.gz
add files and tweaks needed for MPE/iX port (via PM)
Message-Id: <199807132107.AAA20603@alpha.hut.fi> Subject: MPE/iX patches for _73 p4raw-id: //depot/perl@1478
Diffstat (limited to 'mpeix/nm')
-rw-r--r--mpeix/nm33
1 files changed, 33 insertions, 0 deletions
diff --git a/mpeix/nm b/mpeix/nm
new file mode 100644
index 0000000000..b2eb58d9d6
--- /dev/null
+++ b/mpeix/nm
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# MPE doesn't have a native nm, and the gcc nm isn't quite fully functional.
+#
+# If Perl Configure is calling us, then use the native linker to extract the
+# symbol table and reformat it into something nm-like.
+#
+# Else it must be gcc calling us during the final link phase, so call gcc nm.
+
+if [ "$1" != "-configperl" ]; then
+ # Oops, the caller must be expecting gcc nm. Give it to them.
+ /usr/local/bin/nm $@
+ exit $?
+fi
+
+case $2 in
+ *.a) LIST="LISTRL RL=$2;DATA;ENTRYSYM" ;;
+ *.sl) LIST="LISTXL XL=$2;DATA;ENTRYSYM" ;;
+ *) exit 0 ;;
+esac
+
+# I wanted to pipe this into awk, but it fell victim to a known pipe/streams
+# bug on my multiprocessor machine.
+
+callci xeq linkedit.pub.sys \"$LIST\" >/tmp/nm.$$
+
+awk '\
+ / data univ / { printf "%-20s|%10s|%-6s|%-7s|%s\n",$1,$5,"extern","data","?"} \
+ / entry univ / { printf "%-20s|%10s|%-6s|%-7s|%s\n",$1,$7,"extern","entry","?"}' /tmp/nm.$$
+
+rm -f /tmp/nm.$$
+
+exit 0