Use simple linker script to force data segment to be page aligned

This commit is contained in:
Frans Kaashoek 2022-08-23 10:54:40 -04:00
parent cef1b57d4a
commit 4cd4d194b8
3 changed files with 43 additions and 9 deletions

36
user/user.ld Normal file
View file

@ -0,0 +1,36 @@
OUTPUT_ARCH( "riscv" )
ENTRY( _main )
SECTIONS
{
. = 0x0;
.text : {
*(.text .text.*)
}
.rodata : {
. = ALIGN(16);
*(.srodata .srodata.*) /* do not need to distinguish this from .rodata */
. = ALIGN(16);
*(.rodata .rodata.*)
. = ALIGN(0x1000);
}
.data : {
. = ALIGN(16);
*(.sdata .sdata.*) /* do not need to distinguish this from .data */
. = ALIGN(16);
*(.data .data.*)
}
.bss : {
. = ALIGN(16);
*(.sbss .sbss.*) /* do not need to distinguish this from .bss */
. = ALIGN(16);
*(.bss .bss.*)
}
PROVIDE(end = .);
}