From a6497217a30deb7aab17dfcdd85e7d6adc6b576c Mon Sep 17 00:00:00 2001 From: numzero Date: Mon, 12 Aug 2024 00:27:54 +0300 Subject: [PATCH] Simplify the linker script --- link.ld | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/link.ld b/link.ld index 71efd06..99e2b10 100644 --- a/link.ld +++ b/link.ld @@ -1,14 +1,12 @@ ENTRY(_start) SECTIONS { - . = 4M; - . = . + SIZEOF_HEADERS; - .text : { *(.text) } :text - .rodata : { *(.rodata) } :text - . += 4K; - .data : { *(.data) } :data - . = ALIGN(4K); - .bss : { *(COMMON) *(.bss) } :bss + . = 4M + SIZEOF_HEADERS; + .text ALIGN(16) : { *(.text) } :text + .rodata ALIGN(16) : { *(.rodata) } :text + . += 4K; /* put .data in the next page in memory while not actually moving it in the file */ + .data ALIGN(16) : { *(.data) } :data + .bss ALIGN(4K) : { *(COMMON) *(.bss) } :bss } PHDRS {