[patch, rft] scripts/makelst: replace gawk with shell, update

Oleg Verych
2007-01-24T23:21:40Z

scripts/makelst: replace gawk with shell, update

Signed-off-by: Oleg Verych <olecom@flower.upol.cz>
---
-o--=O`C
#oo'L O
<___=E M

--- linux~2.6.20-rc5/scripts/makelst~ 2007-01-12 19:54:26.000000000 +0100
+++ linux~2.6.20-rc5/scripts/makelst 2007-01-24 23:21:33.273657000 +0100
@@ -1,19 +1,22 @@
-#!/bin/bash
+#!/bin/sh
# A script to dump mixed source code & assembly
# with correct relocations from System.map
-# Requires the following lines in Rules.make.
-# Author(s): DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
-# William Stearns <wstearns@pobox.com>
+# Requires the following lines in makefile:
#%.lst: %.c
# $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -g -c -o $*.o $<
-# $(TOPDIR)/scripts/makelst $*.o $(TOPDIR)/System.map $(OBJDUMP)
+# $(srctree)/scripts/makelst $*.o $(srctree)/System.map $(OBJDUMP)
#
-# Copyright (C) 2000 IBM Corporation
-# Author(s): DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
+# Copyright (C) 2000 IBM Corporation
+# Author(s): DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
+# William Stearns <wstearns@pobox.com>
#

+pos_param() {
+ shift $1 ; echo $1
+}
+
t1=`$3 --syms $1 | grep .text | grep " F " | head -n 1`
if [ -n "$t1" ]; then
- t2=`echo $t1 | gawk '{ print $6 }'`
+ t2=`pos_param 6 $t1`
if [ ! -r $2 ]; then
echo "No System.map" >&2
@@ -21,6 +24,6 @@
else
t3=`grep $t2 $2`
- t4=`echo $t3 | gawk '{ print $1 }'`
- t5=`echo $t1 | gawk '{ print $1 }'`
+ t4=`pos_param 1 $t3`
+ t5=`pos_param 1 $t1`
t6=`echo $t4 - $t5 | tr a-f A-F`
t7=`( echo ibase=16 ; echo $t6 ) | bc`