Optimize memory layout.
Minimizing the amount of padding between page-aligned data structures.
diff --git a/init.c b/init.c
index b2c4f5a..324bc91 100644
--- a/init.c
+++ b/init.c
@@ -53,7 +53,8 @@
struct pcb_struct pcb __attribute__((section(".sbss")));
-static unsigned long page_dir[1024] __attribute__((aligned(PAGE_SIZE)));
+static unsigned long page_dir[1024]
+ __attribute__((aligned(PAGE_SIZE), section(".bss.page_dir")));
/* The HWRPB must be aligned because it is exported at INIT_HWRPB. */
struct hwrpb_combine hwrpb __attribute__((aligned(PAGE_SIZE)));
diff --git a/pal.S b/pal.S
index 1d579aa..c314bd7 100644
--- a/pal.S
+++ b/pal.S
@@ -1905,7 +1905,7 @@
* Allocate the initial bootup stack.
*/
- .section .bss
+ .section .bss.stack
.align 3
.globl stack
.type stack,@object
diff --git a/palcode.ld b/palcode.ld
index 59efb04..b525cbd 100644
--- a/palcode.ld
+++ b/palcode.ld
@@ -6,12 +6,17 @@
. = 0xfffffc0000000000;
.text : { *(.text*) }
.rodata : { *(.rodata*) }
- .data ALIGN(8192) : { *(.data.hwrpb) *(.data*) }
+ .data ALIGN(8192) : { *(.data*) }
.got : { *(.got.plt) *(.got) }
.sdata : { *(.sdata*) }
.sbss : { *(.sbss) *(.scommon) }
- .bss : { *(.bss) *(COMMON) }
- PROVIDE (_end = .);
+ .bss : {
+ *(.bss.page_dir)
+ *(.bss.stack)
+ *(COMMON)
+ *(.bss)
+ PROVIDE (_end = .);
+ }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning