This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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."

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]