1 /*! @brief linker script to specify kernel binary's section locations
2 * @see <a href="https://wiki.osdev.org/Bare_Bones#Linking_the_Kernel">Osdev's Linking the kernel</a>
5 /* The bootloader will look at this image and start execution at the symbol
6 designated as the entry point. */
9 /* Tell where the various sections of the object files will be put in the final
13 /* Begin putting sections at 1 MiB, a conventional place for kernels to be
14 loaded at by the bootloader. */
17 /* First put the multiboot header, as it is required to be put very early
18 early in the image or the bootloader won't recognize the file format.
19 Next we'll put the .text section. */
20 .text BLOCK(4K) : ALIGN(4K)
29 .rodata BLOCK(4K) : ALIGN(4K)
31 /* label start, end of global constructors */
39 /* Read-write data (initialized) */
40 .data BLOCK(4K) : ALIGN(4K)
45 /* Read-write data (uninitialized) and stack */
46 .bss BLOCK(4K) : ALIGN(4K)
52 /* The compiler may produce other sections, by default it will put them in
53 a segment with the same name. Simply add stuff here as needed. */