Revert "test: Update linker script to match limine-c-template"
This reverts commit 329d989b01f1702675dabe79e4ead51c64009a6c.
diff --git a/test/linker.ld b/test/linker.ld
index 50649326..0aeca1df 100644
--- a/test/linker.ld
+++ b/test/linker.ld
@@ -1,17 +1,29 @@
+PHDRS
+{
+ text PT_LOAD FLAGS(0x05); /* Execute + Read */
+ rodata PT_LOAD FLAGS(0x04); /* Read only */
+ data PT_LOAD FLAGS(0x06); /* Write + Read */
+ dynamic PT_DYNAMIC FLAGS(0x06); /* Dynamic segment needed for PIE */
+}
+
SECTIONS
{
. = SIZEOF_HEADERS;
kernel_start = . - SIZEOF_HEADERS;
- .rodata ALIGN(CONSTANT(MAXPAGESIZE)) : {
+ .text : {
+ *(.text .text.*)
+ } :text
+
+ . += 0x1000;
+
+ .rodata : {
*(.rodata .rodata.*)
- }
+ } :rodata
- .text ALIGN(CONSTANT(MAXPAGESIZE)) : {
- *(.text .text.*)
- }
+ . += 0x1000;
- .data ALIGN(CONSTANT(MAXPAGESIZE)) : {
+ .data : {
*(.data .data.*)
*(.limine_requests_start_marker)
@@ -19,19 +31,15 @@ SECTIONS
*(.limine_requests_end_marker)
*(.sdata .sdata.*)
- }
+ } :data
.dynamic : {
*(.dynamic)
- }
+ } :data :dynamic
- .bss ALIGN(CONSTANT(MAXPAGESIZE)) : {
+ .bss : {
*(.sbss .sbss.*)
*(.bss .bss.*)
*(COMMON)
- }
-
- /DISCARD/ : {
- *(.interp)
- }
+ } :data
}
