This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold patch committed] Use dc to convert from hex to decimal
- From: Ian Lance Taylor <iant at google dot com>
- To: binutils at sourceware dot org
- Date: Mon, 02 Aug 2010 00:42:00 -0700
- Subject: [gold patch committed] Use dc to convert from hex to decimal
The final_layout.sh test uses a hex conversion feature that is not
supported by all /bin/sh programs. I committed this patch to use dc to
convert from hex to decimal instead.
Ian
Index: testsuite/final_layout.sh
===================================================================
RCS file: /cvs/src/src/gold/testsuite/final_layout.sh,v
retrieving revision 1.1
diff -u -r1.1 final_layout.sh
--- testsuite/final_layout.sh 1 Jun 2010 23:37:58 -0000 1.1
+++ testsuite/final_layout.sh 2 Aug 2010 07:40:29 -0000
@@ -27,8 +27,10 @@
check()
{
- func_addr_1=$((16#`grep $2 $1 | awk '{print $1}'`))
- func_addr_2=$((16#`grep $3 $1 | awk '{print $1}'`))
+ func_addr_1=`grep $2 $1 | awk '{print $1}' | tr 'abcdef' 'ABCDEF'`
+ func_addr_1=`echo 16i${func_addr_1}p | dc`
+ func_addr_2=`grep $3 $1 | awk '{print $1}' | tr 'abcdef' 'ABCDEF'`
+ func_addr_2=`echo 16i${func_addr_2}p | dc`
if [ $func_addr_1 -gt $func_addr_2 ]
then
echo "final layout of" $2 "and" $3 "is not right."