This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] do not require dc in gold testsuite
- From: Allan McRae <allan at archlinux dot org>
- To: binutils at sourceware dot org
- Date: Fri, 10 Dec 2010 02:13:33 +1000
- Subject: [PATCH] do not require dc in gold testsuite
Hi,
This is a partial reversion of the changes made in
http://sourceware.org/ml/binutils-cvs/2010-08/msg00004.html which appear
to have been made to improve portability of the hex to decimal
conversion. However, I find the requirement of needing "dc" installed
for the test suite to succeed to be excessive. Instead, implement the
conversion in a third way using printf, which should provide the
portability without requiring additional software.
Allan
----
2010-12-10 Allan McRae <allan@archlinux.org>
* final_layout.sh: use printf instead of dc to convert
from hex to decimal
Index: gold/testsuite/final_layout.sh
===================================================================
RCS file: /cvs/src/src/gold/testsuite/final_layout.sh,v
retrieving revision 1.2
diff -u -r1.2 final_layout.sh
--- gold/testsuite/final_layout.sh 2 Aug 2010 07:41:04 -0000 1.2
+++ gold/testsuite/final_layout.sh 9 Dec 2010 15:54:57 -0000
@@ -27,10 +27,10 @@
check()
{
- 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`
+ func_addr_1=`grep $2 $1 | awk '{print $1}'`
+ func_addr_1=`printf '%d\n' 0x${func_addr_1}`
+ func_addr_2=`grep $3 $1 | awk '{print $1}'`
+ func_addr_2=`printf '%d\n' 0x${func_addr_2}`
if [ $func_addr_1 -gt $func_addr_2 ]
then
echo "final layout of" $2 "and" $3 "is not right."