3 ms·
> fairly straightforward conversion of x86 code into ARM, albeit with a 1-to-1 mapping between registers rather than following AAPCS or any standard calling con
by lisper 4y ago
> fairly straightforward conversion of x86 code into ARM, albeit with a 1-to-1 mapping between registers rather than following AAPCS or any standard calling convention
OK, that explains why I can't dlopen an ARM dylib. But then how does Rosettafied code call system library routines?
- toast0 4y ago> how does Rosettafied code call system library routines? (I have no specific knowledge about how Rosetta works) x86 code (translated or not) needs to call into system libraries with the x86 calling convention. The easiest way would be to have the x86 system libraries, and translate those too, although someone mentioned they're included as pre-translated cache files. System calls (typically made from libc) in x86 will trap into the kernel, but I'd assume the CPU will run the kernel handler in ARM mode... probably? a different handler address for ARM and x86, but either way, some method to determine which type of cpu and use the appropriate syscall numbers and structures depending on the type. It's possible, but I'd think unlikely, that Apple made all the syscalls the same across both architectures, down to the width and alignment of all of the structs.