3 ms·
Is there a possibility of integrating GCC compiler and adding support for ELF executables? If yes, then how?
by mryalamanchi 5y ago
Is there a possibility of integrating GCC compiler and adding support for ELF executables?
If yes, then how?
- mryalamanchi 5y agoIt's a tough ask but I would like to understand what will be the steps to go through.
- halfer53 5y agoIt's certainly plausible It's currently using wcc to compile the kernel https://github.com/wandwramp/wcc https://github.com/wandwramp/wcc. We can swap it with gcc for sure, but require bit of work, especially the output format and backend. Winix assumes the output file is in srec format https://en.wikipedia.org/wiki/SREC_(file_format) https://en.wikipedia.org/wiki/SREC_(file_format), so we would need to tweak gcc to support this header format and add backend support for WRAMP architecture. ELF is quite complicated, if I have to do this, I probably just copy some codes from linux.
- bregma 5y agoIf you're not supporting DSOs (shared libraries) then ELF is pretty straightforward. In fact, from the kernel point of view it's still fairly straightforward since all you need to do is either load the (non-DSO) program and go, or else load the (non-DSO) program named in the interpreter entry and go, and leave the hard lifting to the interpreter. The kernel itself never needs to understand about DSOs or GOTs and PLTs or DWARF or any of the other fancy magic that ELF brigs to the table. Just how to find and load the LOAD segments and where the entry address is, or where the PT_INTERP string is. It's really just that easy.
- halfer53 5y agoThanks for the info, good to know that it's easy to implement from kernel's perspective