Code Snippets Linker Script

Short texts Linker Script 🧑‍💻 Code snippets Linker Script ✍️ Reading lists Linker Script 👀

new_kernel.ld

ENTRY(loader) /* the name of the entry symbol */ . = 0xC0100000 /* the code should be relocated to 3 GB + 1 MB */ /* these labels get exported to the code files */ kernel_virtual_start = .; kernel_physical_start = . – 0xC0000000; /* align at 4 KB and load at 1 MB */ .text […]

link.ld

ENTRY(loader) /* the name of the entry label */ kernel_start = .; SECTIONS { . = 0x00100000; /* the code should be loaded at 1 MB */ .text ALIGN (0x1000) : /* align at 4 KB */ { *(.text) /* all text sections from all files */ } .rodata ALIGN (0x1000) : /* align at […]

link1.ld

ENTRY(loader) /* the name of the entry label */ kernel_start = .; SECTIONS { . = 0x00100000; /* the code should be loaded at 1 MB */ .text ALIGN (0x1000) : /* align at 4 KB */ { *(.text) /* all text sections from all files */ } .rodata ALIGN (0x1000) : /* align at […]

link.ld

ENTRY(loader) /* the name of the entry symbol */ . = 0xC0100000 /* the code should be relocated to 3GB + 1MB */ /* align at 4 KB and load at 1 MB */ .text ALIGN (0x1000) : AT(ADDR(.text)-0xC0000000) { *(.text) /* all text sections from all files */ } /* align at 4 KB […]

osdev_link.ld

ENTRY(start) SECTIONS{ . = 1M; .rodata BLOCK(4K) : ALIGN(4K){ *(.multiboot) } .text BLOCK(4K) : ALIGN(4K){ *(.text) } .rodata BLOCK(4K) : ALIGN(4K){ *(.rodata) } .data BLOCK(4K) : ALIGN(4K){ *(.data) } .bss BLOCK(4K) : ALIGN(4K){ *(COMMON) *(.bss) } }