File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,24 @@ pub(crate) fn disassemble_myself() -> HashSet<Function> {
67
67
String :: from_utf8_lossy ( Vec :: leak ( output. stdout ) )
68
68
} else if cfg ! ( target_os = "windows" ) {
69
69
panic ! ( "disassembly unimplemented" )
70
+ } else if cfg ! ( target_os = "macos" ) && cfg ! ( target_arch = "aarch64" ) {
71
+ // use LLVM objdump because it is not possible to enable TME support with otool
72
+ let objdump = env:: var ( "OBJDUMP" ) . unwrap_or_else ( |_| "objdump" . to_string ( ) ) ;
73
+ let output = Command :: new ( objdump. clone ( ) )
74
+ . arg ( "--disassemble" )
75
+ . arg ( "--no-show-raw-insn" )
76
+ . arg ( "--mattr=+crc,+crypto,+tme" )
77
+ . arg ( & me)
78
+ . output ( )
79
+ . unwrap_or_else ( |_| panic ! ( "failed to execute objdump. OBJDUMP={}" , objdump) ) ;
80
+ println ! (
81
+ "{}\n {}" ,
82
+ output. status,
83
+ String :: from_utf8_lossy( & output. stderr)
84
+ ) ;
85
+ assert ! ( output. status. success( ) ) ;
86
+
87
+ String :: from_utf8_lossy ( Vec :: leak ( output. stdout ) )
70
88
} else if cfg ! ( target_os = "macos" ) {
71
89
let output = Command :: new ( "otool" )
72
90
. arg ( "-vt" )
You can’t perform that action at this time.
0 commit comments