From ce3950488b3d9b427b8d8fab000c58dd17397200 Mon Sep 17 00:00:00 2001 From: Yifan Wu Date: Sun, 7 Mar 2021 19:54:09 +0800 Subject: [PATCH] Link small sections in linker --- os/src/linker-k210.ld | 3 +++ os/src/linker-qemu.ld | 3 +++ user/src/linker.ld | 3 +++ 3 files changed, 9 insertions(+) diff --git a/os/src/linker-k210.ld b/os/src/linker-k210.ld index 8a24ad14..2ef74ca0 100644 --- a/os/src/linker-k210.ld +++ b/os/src/linker-k210.ld @@ -18,6 +18,7 @@ SECTIONS srodata = .; .rodata : { *(.rodata .rodata.*) + *(.srodata .srodata.*) } . = ALIGN(4K); @@ -25,6 +26,7 @@ SECTIONS sdata = .; .data : { *(.data .data.*) + *(.sdata .sdata.*) } . = ALIGN(4K); @@ -33,6 +35,7 @@ SECTIONS *(.bss.stack) sbss = .; *(.bss .bss.*) + *(.sbss .sbss.*) } . = ALIGN(4K); diff --git a/os/src/linker-qemu.ld b/os/src/linker-qemu.ld index 8348a385..8bcce1a7 100644 --- a/os/src/linker-qemu.ld +++ b/os/src/linker-qemu.ld @@ -18,6 +18,7 @@ SECTIONS srodata = .; .rodata : { *(.rodata .rodata.*) + *(.srodata .srodata.*) } . = ALIGN(4K); @@ -25,6 +26,7 @@ SECTIONS sdata = .; .data : { *(.data .data.*) + *(.sdata .sdata.*) } . = ALIGN(4K); @@ -33,6 +35,7 @@ SECTIONS *(.bss.stack) sbss = .; *(.bss .bss.*) + *(.sbss .sbss.*) } . = ALIGN(4K); diff --git a/user/src/linker.ld b/user/src/linker.ld index d3f023d2..75438fb9 100644 --- a/user/src/linker.ld +++ b/user/src/linker.ld @@ -13,13 +13,16 @@ SECTIONS } .rodata : { *(.rodata .rodata.*) + *(.srodata .srodata.*) } .data : { *(.data .data.*) + *(.sdata .sdata.*) } .bss : { start_bss = .; *(.bss .bss.*) + *(.sbss .sbss.*) end_bss = .; } /DISCARD/ : {