From 99e67928b7433bea3f6ac6c9ef2e2dd147060d2c Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 7 Feb 2014 03:31:43 +0200 Subject: [PATCH] run_exp.sh: take file --- run_exp.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/run_exp.sh b/run_exp.sh index edcc3b0..6b9460f 100755 --- a/run_exp.sh +++ b/run_exp.sh @@ -1,15 +1,20 @@ #!/bin/sh -grep '@' $1 | awk '{print $1}' > $2_explist +outf=$3 -echo ".text" > $2 -echo ".align 4" >> $2 +grep '@' $1 | awk '{print $1}' > ${outf}_explist -cat $2_explist | while read i; do +echo ".text" > $outf +echo ".align 4" >> $outf + +cat ${outf}_explist | while read i; do sym=`echo $i | awk -F@ '{print $1}'` + if grep -q "$sym" $2; then + continue + fi - echo ".globl _$i" >> $2 - echo "_$i:" >> $2 - echo " jmp $sym" >> $2 - echo >> $2 + echo ".globl _$i" >> $outf + echo "_$i:" >> $outf + echo " jmp $sym" >> $outf + echo >> $outf done -- 2.39.5