helos1/Linker.ld.old
2021-10-10 14:11:45 +08:00

63 lines
1.5 KiB
Plaintext

OUTPUT_FORMAT(pei-x86-64)
SEARCH_DIR("/usr/x86_64-w64-mingw32/lib");
/* Tell where the various sections of the object files will be put in the final
kernel image. */
SECTIONS
{
/* Make the virtual address and file offset synced if the alignment is
lower than the target page size. */
. = SIZEOF_HEADERS;
. = ALIGN(__section_alignment__);
/* First put the multiboot header, as it is required to be put very early
early in the image or the bootloader won't recognize the file format.
Next we'll put the .text section. */
.text BLOCK(4K) : ALIGN(4K)
{
PROVIDE(link_TextStart = .);
/* *(.multiboot) */
*(.text)
PROVIDE(link_TextEnd = .);
}
/* Read-only data. */
.rdata BLOCK(4K) : ALIGN(4K)
{
PROVIDE(link_RodataStart = .);
/* *(.rodata) */ /* as in ELF/SysV style */
*(.rdata)
*(SORT(.rdata$*))
. = ALIGN(4);
__rt_psrelocs_start = .;
KEEP(*(.rdata_runtime_pseudo_reloc))
__rt_psrelocs_end = .;
PROVIDE(link_RodataEnd = .);
}
/* Read-write data (initialized) */
.data BLOCK(4K) : ALIGN(4K)
{
PROVIDE(link_DataStart = .);
*(.data)
*(.data)
*(.data2)
*(SORT(.data$*))
KEEP(*(.jcr))
PROVIDE(link_DataEnd = .);
}
/* Read-write data (uninitialized) and stack */
.bss BLOCK(4K) : ALIGN(4K)
{
PROVIDE(link_BssStart = .);
*(COMMON)
*(.bss)
PROVIDE(link_BssEnd = .);
}
/* The compiler may produce other sections, by default it will put them in
a segment with the same name. Simply add stuff here as needed. */
}