aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/conf/kernel-link.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv64/conf/kernel-link.S')
-rw-r--r--arch/riscv64/conf/kernel-link.S19
1 files changed, 8 insertions, 11 deletions
diff --git a/arch/riscv64/conf/kernel-link.S b/arch/riscv64/conf/kernel-link.S
index 88f2e75..e395e4a 100644
--- a/arch/riscv64/conf/kernel-link.S
+++ b/arch/riscv64/conf/kernel-link.S
@@ -5,12 +5,6 @@ OUTPUT_ARCH(riscv)
ENTRY(main)
SECTIONS {
- /* This is apparently necessary. I *think* it is to tell the linker that
- * the kernel should be able to run in the bottom half of the address
- * space, but I don't know for sure and this feels like a fairly major
- * hack.
- * @todo look into this further.
- */
. = ABSOLUTE(VM_KERNEL);
__kernel_start = .;
.text ALIGN(4K) : AT(0) {
@@ -18,6 +12,14 @@ SECTIONS {
*(.text*);
}
+ /* place bss in between different load sections to force objcopy to
+ * output zeroes for it */
+ .bss : {
+ *(.sbss*)
+ *(.bss*)
+ *(COMMON)
+ }
+
.rodata : {
*(.rodata*)
}
@@ -27,12 +29,7 @@ SECTIONS {
*(.sdata*)
}
- .bss : {
- *(.sbss*) *(.bss*) *(COMMON)
- }
-
__kernel_end = .;
- __kernel_size = __kernel_end - __kernel_start;
.garbage : {
*(.note*)