diff options
author | Frans Kaashoek <[email protected]> | 2022-08-23 10:54:40 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2022-08-23 10:54:40 -0400 |
commit | 4cd4d194b8827af4971a81ad28968499925f884f (patch) | |
tree | 49eae2e3938a4e6676895a10253b419d729f3bcd /user | |
parent | cef1b57d4a97f15e9858804e368f7928b579b88e (diff) | |
download | xv6-labs-4cd4d194b8827af4971a81ad28968499925f884f.tar.gz xv6-labs-4cd4d194b8827af4971a81ad28968499925f884f.tar.bz2 xv6-labs-4cd4d194b8827af4971a81ad28968499925f884f.zip |
Use simple linker script to force data segment to be page aligned
Diffstat (limited to 'user')
-rw-r--r-- | user/user.ld | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/user/user.ld b/user/user.ld new file mode 100644 index 0000000..0ca922b --- /dev/null +++ b/user/user.ld @@ -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 = .); +} |