summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-01-19 22:41:50 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2018-01-19 22:48:34 +0100
commit5e93dd3896ab214fda599775efb0e97df5c6ab7b (patch)
tree46c593f43a8229d170c1ea23b49787a36aa80fd4
parent636ee90f79a5a1551220427c89865c40bc0b65a7 (diff)
downloadbuilder-5e93dd3896ab214fda599775efb0e97df5c6ab7b.tar.xz
renames in opcode sniffer, using proper tmpdir
-rwxr-xr-xbin/check-opcodes (renamed from bin/check_opcodes)6
-rwxr-xr-xbin/opcode2
-rw-r--r--conf/Opcode_list (renamed from bin/Opcode_list)0
3 files changed, 5 insertions, 3 deletions
diff --git a/bin/check_opcodes b/bin/check-opcodes
index 648be5c..fd740b1 100755
--- a/bin/check_opcodes
+++ b/bin/check-opcodes
@@ -1,5 +1,7 @@
#!/bin/sh
+. "${0%/*}/../conf/default.conf"
+
usage( ) {
>&2 cat <<EOF
@@ -28,7 +30,7 @@ err( ) {
EXIT_CODE=1
}
-tmp_dir=$(mktemp -d 'tmp.check-opcodes.XXXXXXXXXX' --tmpdir)
+tmp_dir=$(mktemp -d "${work_dir}/tmp.check-opcodes.XXXXXX")
trap "rm -rf --one-file-system '${tmp_dir:?}'" EXIT
ARCH=i686
@@ -140,7 +142,7 @@ for absfile in `find $tmp_dir -name '*.so*' -type f`; do
fi
objdump -M intel -d $absfile > $tmp_dir/$file.asm
- bad_opcodes=`cat $tmp_dir/$file.asm | ./opcode $OPCODE_ARGS -m 1 | wc -l`
+ bad_opcodes=`cat $tmp_dir/$file.asm | ${base_dir}/bin/opcode $OPCODE_ARGS -m 1 | wc -l`
if test $bad_opcodes != 0; then
case $ARCH in
i486)
diff --git a/bin/opcode b/bin/opcode
index 59e6c0a..de1b3f8 100755
--- a/bin/opcode
+++ b/bin/opcode
@@ -42,7 +42,7 @@ Line_Numbers=false
Leading_Context=0
Trailing_Context=0
-source Opcode_list # include opcodes from a separate file
+source "${0%/*}/../conf/Opcode_list" # include opcodes from a separate file
# GAS-specific opcodes (unofficial names) belonging to the x64 instruction set.
# They are generated by GNU tools (e.g. GDB, objdump) and specify a variant of ordinal opcodes like NOP and MOV.
diff --git a/bin/Opcode_list b/conf/Opcode_list
index 213321f..213321f 100644
--- a/bin/Opcode_list
+++ b/conf/Opcode_list