@@ -26,8 +26,6 @@
#define STACK_BUF_ENTRIES 60
static struct bt_entry bt_buf[STACK_BUF_ENTRIES];
-extern uint32_t _stext, _etext;
-
/* Dumps backtrace to buffer */
void __nomcount ___backtrace(struct bt_entry *entries, unsigned int *count,
unsigned long r1,
@@ -48,6 +48,13 @@
struct mem_region;
extern struct mem_region *mem_region_next(struct mem_region *region);
+/* Misc linker script symbols */
+extern char _start[];
+extern char _stext[];
+extern char _etext[];
+extern char __sym_map_end[];
+extern char _romem_end[];
+
#ifndef __TESTING__
/* Readonly section start and end. */
extern char __rodata_start[], __rodata_end[];
@@ -20,6 +20,7 @@
ENTRY(boot_entry);
SECTIONS
{
+ _start = .;
. = 0;
.head : {
@@ -65,23 +66,6 @@ SECTIONS
__rodata_end = .;
}
- .data : {
- /*
- * A couple of things that need to be 4K aligned and
- * to reside in their own pages for the sake of TCE
- * mappings
- */
- . = ALIGN(0x1000);
- *(.data.memcons);
- . = ALIGN(0x1000);
- *(.data.boot_trace);
- . = ALIGN(0x1000);
- *(.data*)
- *(.force.data)
- *(.toc1)
- *(.branch_lt)
- }
-
. = ALIGN(0x10);
.init : {
__ctors_start = .;
@@ -146,6 +130,29 @@ SECTIONS
__sym_map_end = . ;
}
+ /*
+ * Memory above this point should be un-changing after the OS
+ * boots, and is verified with a checksum upon fast reboot.
+ */
+ _romem_end = .;
+
+ .data : {
+ /*
+ * A couple of things that need to be 4K aligned and
+ * to reside in their own pages for the sake of TCE
+ * mappings
+ */
+ . = ALIGN(0x1000);
+ *(.data.memcons);
+ . = ALIGN(0x1000);
+ *(.data.boot_trace);
+ . = ALIGN(0x1000);
+ *(.data*)
+ *(.force.data)
+ *(.toc1)
+ *(.branch_lt)
+ }
+
/* We locate the BSS at 3M to leave room for the symbol map */
. = 0x300000;
This also tidies up linker script symbol declarations and adds _rodata_mem symbol for the next change to use. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> --- core/stack.c | 2 -- include/skiboot.h | 7 +++++++ skiboot.lds.S | 41 ++++++++++++++++++++++++----------------- 3 files changed, 31 insertions(+), 19 deletions(-)