diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2020-04-27 21:08:06 +1000 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2020-06-11 12:52:55 +1000 |
commit | ac08f4aa9c772eb03b2460500c64b77822f05bf4 (patch) | |
tree | 1346a35b20323c91e052db4680b9276c8267edf4 /skiboot.lds.S | |
parent | e40441198832e8fd69ddca9e75c466085b6ddf6c (diff) | |
download | skiboot-ac08f4aa9c772eb03b2460500c64b77822f05bf4.zip skiboot-ac08f4aa9c772eb03b2460500c64b77822f05bf4.tar.gz skiboot-ac08f4aa9c772eb03b2460500c64b77822f05bf4.tar.bz2 |
skiboot.lds.S: introduce PAGE_SIZE, use it to lay out sections
Separate code, data, read-only data, and other significant sections
with PAGE_SIZE alignment. This enables memory protection for these
sections with a later patch.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'skiboot.lds.S')
-rw-r--r-- | skiboot.lds.S | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/skiboot.lds.S b/skiboot.lds.S index eed26ea..b136e40 100644 --- a/skiboot.lds.S +++ b/skiboot.lds.S @@ -75,6 +75,7 @@ SECTIONS } _head_end = .; + . = ALIGN(PAGE_SIZE); /* * The following sections are read-write at runtime. We need @@ -107,14 +108,14 @@ SECTIONS } /* ...and back to RO */ - - . = ALIGN(0x10); + . = ALIGN(PAGE_SIZE); _stext = .; .text : { *(.text*) *(.sfpr .glink) } _etext = .; + . = ALIGN(PAGE_SIZE); .rodata : { __rodata_start = .; @@ -177,6 +178,7 @@ SECTIONS *(.rela*) __rela_dyn_end = .; } + .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } .gnu.version : { *(.gnu.version) } @@ -196,22 +198,26 @@ SECTIONS */ _romem_end = .; + . = ALIGN(PAGE_SIZE); + + _sdata = .; .data : { /* * A couple of things that need to be 4K aligned and * to reside in their own pages for the sake of TCE - * mappings + * mappings, so use PAGE_SIZE alignment. */ - . = ALIGN(0x1000); + . = ALIGN(PAGE_SIZE); *(.data.memcons); - . = ALIGN(0x10000); + . = ALIGN(PAGE_SIZE); *(.data.boot_trace); - . = ALIGN(0x10000); + . = ALIGN(PAGE_SIZE); *(.data*) *(.force.data) *(.toc1) *(.branch_lt) } + _edata = .; /* We locate the BSS at 4M to leave room for the symbol map */ . = 0x400000; @@ -221,7 +227,7 @@ SECTIONS *(.dynbss) *(.bss*) } - . = ALIGN(0x10000); + . = ALIGN(PAGE_SIZE); _ebss = .; _end = .; @@ -230,7 +236,7 @@ SECTIONS DEBUG_SECTIONS /* Optional kernel image */ - . = ALIGN(0x10000); + . = ALIGN(PAGE_SIZE); .builtin_kernel : { __builtin_kernel_start = .; KEEP(*(.builtin_kernel)) |