@@ -20,39 +20,38 @@ function build {
20
20
}
21
21
22
22
function check {
23
- local func= $1
23
+ local func_re= " $1 "
24
24
local checks=" ${TEST_DIR} /$2 "
25
25
local asm=$( mktemp)
26
- local objdump=" ${BUILD_DIR} /x86_64-unknown-linux-gnu/llvm/build/bin/llvm-objdump"
27
- local filecheck=" ${BUILD_DIR} /x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck"
28
-
29
- ${objdump} --disassemble-symbols=${func} --demangle \
30
- ${WORK_DIR} /enclave/target/x86_64-fortanix-unknown-sgx/debug/enclave > ${asm}
26
+ local objdump=" ${LLVM_BIN_DIR} /llvm-objdump"
27
+ local filecheck=" ${LLVM_BIN_DIR} /FileCheck"
28
+ local enclave=${WORK_DIR} /enclave/target/x86_64-fortanix-unknown-sgx/debug/enclave
29
+
30
+ func=" $( ${objdump} --syms --demangle ${enclave} | \
31
+ grep --only-matching -E " [[:blank:]]+${func_re} \$ " | \
32
+ sed -e ' s/^[[:space:]]*//' ) "
33
+ ${objdump} --disassemble-symbols=" ${func} " --demangle \
34
+ ${enclave} > ${asm}
31
35
${filecheck} --input-file ${asm} ${checks}
32
36
}
33
37
34
38
build
35
39
36
- check unw_getcontext unw_getcontext.checks
37
- check " libunwind::Registers_x86_64::jumpto()" jumpto.checks
38
- check " std::io::stdio::_print::h87f0c238421c45bc" print.checks
39
- check rust_plus_one_global_asm rust_plus_one_global_asm.checks \
40
- || echo " warning: module level assembly currently not hardened"
40
+ check " unw_getcontext" unw_getcontext.checks
41
+ check " __libunwind_Registers_x86_64_jumpto" jumpto.checks
42
+ check ' std::io::stdio::_print::[[:alnum:]]+' print.checks
43
+ check rust_plus_one_global_asm rust_plus_one_global_asm.checks
41
44
42
45
check cc_plus_one_c cc_plus_one_c.checks
43
46
check cc_plus_one_c_asm cc_plus_one_c_asm.checks
44
47
check cc_plus_one_cxx cc_plus_one_cxx.checks
45
48
check cc_plus_one_cxx_asm cc_plus_one_cxx_asm.checks
46
- check cc_plus_one_asm cc_plus_one_asm.checks \
47
- || echo " warning: the cc crate forwards assembly files to the CC compiler." \
48
- " Clang uses its own integrated assembler, which does not include the LVI passes."
49
+ check cc_plus_one_asm cc_plus_one_asm.checks
49
50
50
51
check cmake_plus_one_c cmake_plus_one_c.checks
51
52
check cmake_plus_one_c_asm cmake_plus_one_c_asm.checks
52
- check cmake_plus_one_c_global_asm cmake_plus_one_c_global_asm.checks \
53
- || echo " warning: module level assembly currently not hardened"
53
+ check cmake_plus_one_c_global_asm cmake_plus_one_c_global_asm.checks
54
54
check cmake_plus_one_cxx cmake_plus_one_cxx.checks
55
55
check cmake_plus_one_cxx_asm cmake_plus_one_cxx_asm.checks
56
- check cmake_plus_one_cxx_global_asm cmake_plus_one_cxx_global_asm.checks \
57
- || echo " warning: module level assembly currently not hardened"
56
+ check cmake_plus_one_cxx_global_asm cmake_plus_one_cxx_global_asm.checks
58
57
check cmake_plus_one_asm cmake_plus_one_asm.checks
0 commit comments