[SOLVED] How to link executable of different architectures ?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
wichtounet
Member
Member
Posts: 90
Joined: Fri Nov 01, 2013 4:05 pm
Location: Fribourg, Switzerland
Contact:

[SOLVED] How to link executable of different architectures ?

Post by wichtounet »

Hi,

I'm developing a 64bit kernel. Until now, I had an assembly step after the bootloader that is doing the 16 -> 32 -> 64 stuff and then it calls the kernel main function that is placed at a specific address by the linker.

I'm now trying to integrate this part inside my C++ kernel instead of creating two separated executables.

I figured out how to create 16-bit compatible and 32 bit executables, but now how do I put together the three C++ generated parts (16, 32, 64).

Is there a way to link them together ?

Thanks
Last edited by wichtounet on Sun Dec 15, 2013 2:31 pm, edited 1 time in total.
Thor Operating System: C++ 64 bits OS: https://github.com/wichtounet/thor-os
Good osdeving!
User avatar
wichtounet
Member
Member
Posts: 90
Joined: Fri Nov 01, 2013 4:05 pm
Location: Fribourg, Switzerland
Contact:

Re: How can I link executable of different architectures ?

Post by wichtounet »

I've been able to find a solution. It is necessary to convert the 16 and 32 bit executables in elf-x86-64 format before linking and then everything works fine.
Thor Operating System: C++ 64 bits OS: https://github.com/wichtounet/thor-os
Good osdeving!
Post Reply