From c69921eff27990e63354d772a2a6adabe15b2179 Mon Sep 17 00:00:00 2001 From: jdh8d <jdh8d@git.zephyr-software.com> Date: Thu, 10 May 2018 19:42:17 +0000 Subject: [PATCH] Updated tests and output msgs to reflect move_globals --elftables-only option name change Former-commit-id: 3cabad73d0acacfd226e37c920caf3996d313307 --- tools/selective_cfi/scfi_instr.cpp | 2 +- tools/selective_cfi/tests/test_coreutils.sh | 4 ++-- tools/selective_cfi/tests/test_dude.sh | 6 +++--- tools/selective_cfi/tests/test_fib.sh | 6 +++--- tools/selective_cfi/tests/test_foo.sh | 6 +++--- tools/selective_cfi/tests/test_libc.sh | 4 ++-- tools/selective_cfi/tests/test_pow.sh | 6 +++--- tools/selective_cfi/tests/test_spec.sh | 4 ++-- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tools/selective_cfi/scfi_instr.cpp b/tools/selective_cfi/scfi_instr.cpp index caaed2f1e..198fb0b0d 100644 --- a/tools/selective_cfi/scfi_instr.cpp +++ b/tools/selective_cfi/scfi_instr.cpp @@ -1008,7 +1008,7 @@ static DataScoop_t* find_scoop(FileIR_t *firp,const string &name) static unsigned int add_to_scoop(const string &str, DataScoop_t* scoop) { - // assert that this scoop is unpinned. may need to enable --step move_globals --step-option move_globals:--cfi + // assert that this scoop is unpinned. may need to enable --step move_globals --step-option move_globals:--elftables-only assert(scoop->GetStart()->GetVirtualOffset()==0); int len=str.length(); scoop->SetContents(scoop->GetContents()+str); diff --git a/tools/selective_cfi/tests/test_coreutils.sh b/tools/selective_cfi/tests/test_coreutils.sh index 20ed16a37..20eb3356b 100755 --- a/tools/selective_cfi/tests/test_coreutils.sh +++ b/tools/selective_cfi/tests/test_coreutils.sh @@ -30,7 +30,7 @@ do_cfi() return fi echo -n "$(basename $2) ... " - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" > $2.ps_output 2>&1 + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" > $2.ps_output 2>&1 check_fail $1 $2 $? } @@ -41,7 +41,7 @@ do_coloring_cfi() return fi echo -n "$(basename $2) ... " - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false"> $2.ps_output 2>&1 + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false"> $2.ps_output 2>&1 check_fail $1 $2 $? } diff --git a/tools/selective_cfi/tests/test_dude.sh b/tools/selective_cfi/tests/test_dude.sh index d7936230d..845911fd2 100755 --- a/tools/selective_cfi/tests/test_dude.sh +++ b/tools/selective_cfi/tests/test_dude.sh @@ -5,14 +5,14 @@ do_cfi() if [[ -f $2 ]]; then echo "Eliding rebuild of $2" else - (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" ) + (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" ) fi } # Note: exe nonce cfi doesn't always run against non-exe nonce cfi modules do_cfi_exe_nonces() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" } do_coloring_cfi() @@ -20,7 +20,7 @@ do_coloring_cfi() if [[ -f $2 ]]; then echo "Eliding rebuild of $2" else - (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" ) + (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" ) fi } diff --git a/tools/selective_cfi/tests/test_fib.sh b/tools/selective_cfi/tests/test_fib.sh index 70e5cb819..d98a3663b 100755 --- a/tools/selective_cfi/tests/test_fib.sh +++ b/tools/selective_cfi/tests/test_fib.sh @@ -2,18 +2,18 @@ do_cfi() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" } # Note: exe nonce cfi doesn't always run against non-exe nonce cfi modules do_cfi_exe_nonces() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" } do_coloring_cfi() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" } diff --git a/tools/selective_cfi/tests/test_foo.sh b/tools/selective_cfi/tests/test_foo.sh index 6a29affb4..827972ac2 100755 --- a/tools/selective_cfi/tests/test_foo.sh +++ b/tools/selective_cfi/tests/test_foo.sh @@ -2,18 +2,18 @@ do_cfi() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" } # Note: exe nonce cfi doesn't always run against non-exe nonce cfi modules do_cfi_exe_nonces() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" } do_coloring_cfi() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" } diff --git a/tools/selective_cfi/tests/test_libc.sh b/tools/selective_cfi/tests/test_libc.sh index 26619ab9a..d765007d6 100755 --- a/tools/selective_cfi/tests/test_libc.sh +++ b/tools/selective_cfi/tests/test_libc.sh @@ -4,7 +4,7 @@ libcpath="" do_cfi() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" if [ ! $? -eq 0 ]; then echo "do_cfi(): failed to protect" fi @@ -12,7 +12,7 @@ do_cfi() do_cfi_color() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" if [ ! $? -eq 0 ]; then echo "do_coloring_cfi(): failed to protect" fi diff --git a/tools/selective_cfi/tests/test_pow.sh b/tools/selective_cfi/tests/test_pow.sh index 434426e89..054d4a71c 100755 --- a/tools/selective_cfi/tests/test_pow.sh +++ b/tools/selective_cfi/tests/test_pow.sh @@ -2,18 +2,18 @@ do_cfi() { - (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false") + (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false") } # Note: exe nonce cfi doesn't always run against non-exe nonce cfi modules do_cfi_exe_nonces() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" } do_coloring_cfi() { - (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" ) + (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" ) } diff --git a/tools/selective_cfi/tests/test_spec.sh b/tools/selective_cfi/tests/test_spec.sh index 575b2cfcd..a67af4964 100755 --- a/tools/selective_cfi/tests/test_spec.sh +++ b/tools/selective_cfi/tests/test_spec.sh @@ -136,8 +136,8 @@ main() local zipr_flags="--backend zipr" - local mm_basic_cfi_flags="--step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all " - local mm_basic_cfi_exe_nonces_flags="--step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call " + local mm_basic_cfi_flags="--step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all " + local mm_basic_cfi_exe_nonces_flags="--step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call " local mm_color_cfi_flags="$mm_basic_cfi_flags --step-option selective_cfi:--color" local trace_flags="-o zipr:--traceplacement:on -o zipr:true" -- GitLab