riboseinc / retrace

retrace is a versatile security vulnerability / bug discovery tool through monitoring and modifying the behavior of compiled binaries on Linux, OpenBSD/FreeBSD/NetBSD (shared object) and macOS (dynamic library).
Other
60 stars 19 forks source link

Support `aarch64` architecture in v2 #428

Open ribose-jeffreylau opened 2 years ago

ribose-jeffreylau commented 2 years ago

Description

The aarch64 architecture (e.g., in Apple M1 machines) should be supported in v2.

Steps

> ./autogen.sh
> ./configure --enable-v2
> make

Expected result

It builds without errors in Apple M1 machines.

Actual result

It builds with errors in Apple M1 machines.

Sample trace:

funcs_symbols.S:277:1: note: while in macro instantiation
WRAPPER_ENTRY_SYSTEM_V pthread_join
^
<instantiation>:60:11: error: invalid operand
addq $80, %rsp
          ^
funcs_symbols.S:277:1: note: while in macro instantiation
WRAPPER_ENTRY_SYSTEM_V pthread_join
^
<instantiation>:61:1: error: unrecognized instruction mnemonic, did you mean: eret, ret?
retq
^
funcs_symbols.S:277:1: note: while in macro instantiation
WRAPPER_ENTRY_SYSTEM_V pthread_join
^
<instantiation>:5:7: error: unknown token in expression
pushq %rsp
      ^
funcs_symbols.S:278:1: note: while in macro instantiation
WRAPPER_ENTRY_SYSTEM_V pthread_key_create
^
<instantiation>:5:7: error: invalid operand
pushq %rsp
      ^