If you are using ELF, don't rely on all that. When I started using C as the language for my operating systems, I used NASM instead of FASM. But then I tried to switch back to FASM (together with C), that failed, because the linker put the FASM code behind the C code (I still don't know why the same thing didn't happen with NASM). Thus I had to create a new section and everything worked fine.Love4Boobies wrote:It is not a mistake to have the multiboot header in the .text section, it is in fact the most common approach. You needn't be afraid that your header will end up in some random place because you basically end up with the assembly code generated from the C file appended to the multiboot header part. Having a separate section is inconsistent with many executable formats (e.g., a.out).
So I can't recommend putting the multiboot header into the text section.