From 2a50b0b43a462c0e3930c9f81bc1e4bb903bbd35 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Sun, 23 Oct 1988 00:08:00 -0800 Subject: [PATCH] date and time created 88/10/22 16:08:00 by bostic SCCS-vsn: usr.bin/lorder/lorder.sh 5.1 --- usr/src/usr.bin/lorder/lorder.sh | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 usr/src/usr.bin/lorder/lorder.sh diff --git a/usr/src/usr.bin/lorder/lorder.sh b/usr/src/usr.bin/lorder/lorder.sh new file mode 100644 index 0000000000..1b806750ed --- /dev/null +++ b/usr/src/usr.bin/lorder/lorder.sh @@ -0,0 +1,43 @@ +#!/bin/sh - +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. The Berkeley software License Agreement +# specifies the terms and conditions for redistribution. +# +# @(#)lorder.sh 5.1 (Berkeley) %G% +# + +trap "rm -f $$sym?ef; exit" 0 1 2 13 15 +case $# in +0) echo usage: lorder file ... + exit ;; +1) case $1 in + *.o) set $1 $1 + esac +esac +nm -g $* | sed ' + /^$/d + /:$/{ + /\.o:/!d + s/:// + h + s/.*/& &/ + p + d + } + /[TD] /{ + s/.* // + G + s/\n/ / + w '$$symdef' + d + } + s/.* // + G + s/\n/ / + w '$$symref' + d +' +sort $$symdef -o $$symdef +sort $$symref -o $$symref +join $$symref $$symdef | sed 's/[^ ]* *//' -- 2.20.1