aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2011-03-21 23:11:45 +0000
committerIan Lance Taylor <ian@airs.com>2011-03-21 23:11:45 +0000
commit9312bb0ad305e6f30ca469d23cbd8a6c849b2d2d (patch)
tree2c979ca28634a3e678033e881a4b5edff596df14 /gold
parent6d1eda7d1c3f050b28e16c0e6d0fcb7129549c17 (diff)
downloadbinutils-9312bb0ad305e6f30ca469d23cbd8a6c849b2d2d.zip
binutils-9312bb0ad305e6f30ca469d23cbd8a6c849b2d2d.tar.gz
binutils-9312bb0ad305e6f30ca469d23cbd8a6c849b2d2d.tar.bz2
* testsuite/final_layout.sh: Rewrite to not use dc.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog4
-rwxr-xr-xgold/testsuite/final_layout.sh35
2 files changed, 30 insertions, 9 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index dacc36a..ca1ae8c 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-21 Ian Lance Taylor <iant@google.com>
+
+ * testsuite/final_layout.sh: Rewrite to not use dc.
+
2011-03-21 Sriraman Tallam <tmsriram@google.com>
* testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
diff --git a/gold/testsuite/final_layout.sh b/gold/testsuite/final_layout.sh
index 01b1f1d..83f9361 100755
--- a/gold/testsuite/final_layout.sh
+++ b/gold/testsuite/final_layout.sh
@@ -25,17 +25,34 @@
# The goal of this program is to verify if --section-ordering-file works as
# intended. File final_layout.cc is in this test.
+set -e
+
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`
- if [ $func_addr_1 -gt $func_addr_2 ]
- then
- echo "final layout of" $2 "and" $3 "is not right."
- exit 1
- fi
+ awk "
+BEGIN { saw1 = 0; saw2 = 0; err = 0; }
+/.*$2\$/ { saw1 = 1; }
+/.*$3\$/ {
+ saw2 = 1;
+ if (!saw1)
+ {
+ printf \"layout of $2 and $3 is not right\\n\";
+ err = 1;
+ exit 1;
+ }
+ }
+END {
+ if (!saw1 && !err)
+ {
+ printf \"did not see $2\\n\";
+ exit 1;
+ }
+ if (!saw2 && !err)
+ {
+ printf \"did not see $3\\n\";
+ exit 1;
+ }
+ }" $1
}
check final_layout.stdout "_Z3barv" "_Z3bazv"