Imported Upstream version 0.160
[platform/upstream/elfutils.git] / tests / run-strip-reloc.sh
index 603fb7c..a3245fd 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2011 Red Hat, Inc.
+# Copyright (C) 2011, 2013 Red Hat, Inc.
 # This file is part of elfutils.
 #
 # This file is free software; you can redistribute it and/or modify
 
 . $srcdir/test-subr.sh
 
-testfiles hello_i386.ko hello_x86_64.ko hello_ppc64.ko hello_s390.ko
+testfiles hello_i386.ko hello_x86_64.ko hello_ppc64.ko hello_s390.ko \
+       hello_aarch64.ko
+
+tempfiles readelf.out readelf.out1 readelf.out2
+tempfiles out.stripped1 out.debug1 out.stripped2 out.debug2
 
 status=0
 runtest() {
@@ -28,18 +32,18 @@ runtest() {
   outfile2=out.stripped2
   debugfile2=out.debug2
 
-  testrun ../src/strip -o $outfile1 -f $debugfile1 $infile ||
+  testrun ${abs_top_builddir}/src/strip -o $outfile1 -f $debugfile1 $infile ||
   { echo "*** failure strip $infile"; status=1; }
 
-  testrun ../src/strip --reloc-debug-sections -o $outfile2 \
+  testrun ${abs_top_builddir}/src/strip --reloc-debug-sections -o $outfile2 \
        -f $debugfile2 $infile ||
   { echo "*** failure strip --reloc-debug-sections $infile"; status=1; }
 
   # shouldn't make any difference for stripped files.
-  testrun ../src/readelf -a $outfile1 > readelf.out ||
+  testrun ${abs_top_builddir}/src/readelf -a $outfile1 > readelf.out ||
   { echo "*** failure readelf -a outfile1 $infile"; status=1; }
 
-  testrun_compare ../src/readelf -a $outfile2 < readelf.out ||
+  testrun_compare ${abs_top_builddir}/src/readelf -a $outfile2 < readelf.out ||
   { echo "*** failure compare stripped files $infile"; status=1; }
 
   # debug files however should be smaller, when ET_REL.
@@ -51,18 +55,16 @@ runtest() {
 
   # Strip of DWARF section lines, offset will not match.
   # Everything else should match.
-  testrun ../src/readelf -w $debugfile1 \
+  testrun ${abs_top_builddir}/src/readelf -w $debugfile1 \
        | grep -v ^DWARF\ section > readelf.out1 ||
   { echo "*** failure readelf -w debugfile1 $infile"; status=1; }
 
-  testrun ../src/readelf -w $debugfile2 \
+  testrun ${abs_top_builddir}/src/readelf -w $debugfile2 \
        | grep -v ^DWARF\ section > readelf.out2 ||
   { echo "*** failure readelf -w debugfile2 $infile"; status=1; }
 
   testrun_compare cat readelf.out1 < readelf.out2 ||
   { echo "*** failure readelf -w compare $infile"; status=1; }
-
-  rm -f $outfile1 $debugfile1 $outfile2 $debugfile2 readelf.out*
 }
 
 # Most simple hello world kernel module for various architectures.
@@ -99,9 +101,10 @@ runtest hello_i386.ko 1
 runtest hello_x86_64.ko 1
 runtest hello_ppc64.ko 1
 runtest hello_s390.ko 1
+runtest hello_aarch64.ko 1
 
 # self test, shouldn't impact non-ET_REL files at all.
-runtest ../src/strip 0
-runtest ../src/strip.o 1
+runtest ${abs_top_builddir}/src/strip 0
+runtest ${abs_top_builddir}/src/strip.o 1
 
 exit $status