Linking two different ABIs together

Simon Richter Simon.Richter@hogyros.de
Mon Aug 2 14:19:26 GMT 2021


Hi,

On 8/2/21 12:32 AM, Alan Lehotsky wrote:

> The idea would be to supply glue code when calling from one ISA to the other that takes care of the handoff of control and manages how any arguments are passed.

This will likely need a system call and/or marshalling of arguments into 
a queue, even if you can skip deep marshalling for pointers, so we're 
basically in component architecture/remote procedure call land here.

> I think it makes more sense to link separate DLLs and only have to insert the glue when calling to a DLL with a dissimilar ISA.  At least there, I’d have a much more restricted set of functions to have to alter and there’s already a notion of requiring shim code to effect the transfer of control.

The existing implementations use separate processes and RPC between 
those. Changing architecture is currently possible only in execve(), 
when the entire process is replaced.

In principle it could be implemented to create threads with a different 
architecture in clone(). In practice, this would likely only work if the 
page table format is the same, or we'd have to weigh down the page table 
generation code with a loop that iterates over all architectures in the 
current process, and the separate threads only draw rather limited 
benefits from the common mappings.

    Simon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://sourceware.org/pipermail/binutils/attachments/20210802/9278718a/attachment.sig>


More information about the Binutils mailing list