The MSP430 does not feature native instructions for multiplication/division/modulo operations. These are translated to library function calls by the architecture-specific MSP430 back-end.
Problem. The sancus-cc pass proceeds on the architecture-agnostic LLVM intermediate representation and can therefore not intercept the library function calls, which are later inserted by the back-end.
Solution. Intercept the arithmetic function calls at link time in the sancus-ld script. The target relocation address of these function calls can be redirected to an intra-SM stub by directly patching the binary ELF file.
The MSP430 does not feature native instructions for multiplication/division/modulo operations. These are translated to library function calls by the architecture-specific MSP430 back-end.
Problem. The
sancus-cc
pass proceeds on the architecture-agnostic LLVM intermediate representation and can therefore not intercept the library function calls, which are later inserted by the back-end.Solution. Intercept the arithmetic function calls at link time in the
sancus-ld
script. The target relocation address of these function calls can be redirected to an intra-SM stub by directly patching the binary ELF file.