notaz.gp2x.de
/
ia32rtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tools: better fastcall support
[ia32rtools.git]
/
run_exp.sh
diff --git
a/run_exp.sh
b/run_exp.sh
index
6b9460f
..
f90c7fe
100755
(executable)
--- a/
run_exp.sh
+++ b/
run_exp.sh
@@
-1,20
+1,30
@@
#!/bin/sh
#!/bin/sh
+# export decorated symbols using undecorated ones from .asm
+# $1 - .def
+# $2 - .in_c
outf=$3
outf=$3
-grep '@' $1 | awk '{print $1}' > ${outf}_explist
+grep '@' $1 |
grep -v '\<DATA\>' |
awk '{print $1}' > ${outf}_explist
echo ".text" > $outf
echo ".align 4" >> $outf
cat ${outf}_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}'`
+ s0=`echo $i | cut -c 1`
+ if [ "$s0" = "@" ]; then
+ sym=`echo $i | awk -F@ '{print $2}'`
+ pre=""
+ else
+ sym=`echo $i | awk -F@ '{print $1}'`
+ pre="_"
+ fi
if grep -q "$sym" $2; then
continue
fi
if grep -q "$sym" $2; then
continue
fi
- echo ".globl
_
$i" >> $outf
- echo "
_
$i:" >> $outf
+ echo ".globl
$pre
$i" >> $outf
+ echo "
$pre
$i:" >> $outf
echo " jmp $sym" >> $outf
echo >> $outf
done
echo " jmp $sym" >> $outf
echo >> $outf
done