From e2ba52d3ec70adcd2c1135d02598aee27a7e9932 Mon Sep 17 00:00:00 2001 From: jiegec Date: Sat, 6 Mar 2021 22:50:54 +0800 Subject: [PATCH 1/2] Add sbss to bss sections --- kernel/src/arch/aarch64/boot/linker.ld | 1 + kernel/src/arch/mipsel/boot/linker.ld.S | 1 + kernel/src/arch/riscv/board/u540/linker.ld | 1 + kernel/src/arch/riscv/boot/linker32.ld | 1 + kernel/src/arch/riscv/boot/linker64.ld | 1 + kernel/src/arch/x86_64/linker.ld | 1 + 6 files changed, 6 insertions(+) diff --git a/kernel/src/arch/aarch64/boot/linker.ld b/kernel/src/arch/aarch64/boot/linker.ld index 1a953cd8..4e45cbf0 100644 --- a/kernel/src/arch/aarch64/boot/linker.ld +++ b/kernel/src/arch/aarch64/boot/linker.ld @@ -34,6 +34,7 @@ SECTIONS { . = ALIGN(32); sbss = .; *(.bss .bss.*) + *(.sbss .sbss.*) *(COMMON) . = ALIGN(4K); ebss = .; diff --git a/kernel/src/arch/mipsel/boot/linker.ld.S b/kernel/src/arch/mipsel/boot/linker.ld.S index 13adcfc1..07321d61 100644 --- a/kernel/src/arch/mipsel/boot/linker.ld.S +++ b/kernel/src/arch/mipsel/boot/linker.ld.S @@ -46,6 +46,7 @@ SECTIONS .bss : { sbss = .; *(.bss .bss.*) + *(.sbss .sbss.*) ebss = .; } diff --git a/kernel/src/arch/riscv/board/u540/linker.ld b/kernel/src/arch/riscv/board/u540/linker.ld index 3cd94fc0..beb246b0 100644 --- a/kernel/src/arch/riscv/board/u540/linker.ld +++ b/kernel/src/arch/riscv/board/u540/linker.ld @@ -45,6 +45,7 @@ SECTIONS .bss : { sbss = .; *(.bss .bss.*) + *(.sbss .sbss.*) ebss = .; } diff --git a/kernel/src/arch/riscv/boot/linker32.ld b/kernel/src/arch/riscv/boot/linker32.ld index 3f0c386f..acb5d7a0 100644 --- a/kernel/src/arch/riscv/boot/linker32.ld +++ b/kernel/src/arch/riscv/boot/linker32.ld @@ -50,6 +50,7 @@ SECTIONS .bss : { sbss = .; *(.bss .bss.*) + *(.sbss .sbss.*) ebss = .; } diff --git a/kernel/src/arch/riscv/boot/linker64.ld b/kernel/src/arch/riscv/boot/linker64.ld index 3cd94fc0..beb246b0 100644 --- a/kernel/src/arch/riscv/boot/linker64.ld +++ b/kernel/src/arch/riscv/boot/linker64.ld @@ -45,6 +45,7 @@ SECTIONS .bss : { sbss = .; *(.bss .bss.*) + *(.sbss .sbss.*) ebss = .; } diff --git a/kernel/src/arch/x86_64/linker.ld b/kernel/src/arch/x86_64/linker.ld index 1d46248f..a7489a93 100644 --- a/kernel/src/arch/x86_64/linker.ld +++ b/kernel/src/arch/x86_64/linker.ld @@ -34,5 +34,6 @@ SECTIONS { .bss ALIGN(4K): { *(.bss .bss.*) + *(.sbss .sbss.*) } } From f98a482a106012e35def6e1d1ca9df2ab86bc9dc Mon Sep 17 00:00:00 2001 From: jiegec Date: Sat, 6 Mar 2021 23:06:59 +0800 Subject: [PATCH 2/2] Add sdata to data section --- kernel/src/arch/aarch64/boot/linker.ld | 1 + kernel/src/arch/mipsel/boot/linker.ld.S | 1 + kernel/src/arch/riscv/board/u540/linker.ld | 1 + kernel/src/arch/riscv/boot/linker32.ld | 1 + kernel/src/arch/riscv/boot/linker64.ld | 1 + kernel/src/arch/x86_64/linker.ld | 1 + 6 files changed, 6 insertions(+) diff --git a/kernel/src/arch/aarch64/boot/linker.ld b/kernel/src/arch/aarch64/boot/linker.ld index 4e45cbf0..b9b24f36 100644 --- a/kernel/src/arch/aarch64/boot/linker.ld +++ b/kernel/src/arch/aarch64/boot/linker.ld @@ -21,6 +21,7 @@ SECTIONS { .data : { sdata = .; *(.data .data.* .gnu.linkonce.d*) + *(.sdata .sdata.*) . = ALIGN(4K); edata = .; } diff --git a/kernel/src/arch/mipsel/boot/linker.ld.S b/kernel/src/arch/mipsel/boot/linker.ld.S index 07321d61..158af22c 100644 --- a/kernel/src/arch/mipsel/boot/linker.ld.S +++ b/kernel/src/arch/mipsel/boot/linker.ld.S @@ -36,6 +36,7 @@ SECTIONS .data : { sdata = .; *(.data .data.*) + *(.sdata .sdata.*) edata = .; } diff --git a/kernel/src/arch/riscv/board/u540/linker.ld b/kernel/src/arch/riscv/board/u540/linker.ld index beb246b0..634e8838 100644 --- a/kernel/src/arch/riscv/board/u540/linker.ld +++ b/kernel/src/arch/riscv/board/u540/linker.ld @@ -35,6 +35,7 @@ SECTIONS .data : { sdata = .; *(.data .data.*) + *(.sdata .sdata.*) edata = .; } diff --git a/kernel/src/arch/riscv/boot/linker32.ld b/kernel/src/arch/riscv/boot/linker32.ld index acb5d7a0..83b1604a 100644 --- a/kernel/src/arch/riscv/boot/linker32.ld +++ b/kernel/src/arch/riscv/boot/linker32.ld @@ -40,6 +40,7 @@ SECTIONS .data : { sdata = .; *(.data .data.*) + *(.sdata .sdata.*) edata = .; } diff --git a/kernel/src/arch/riscv/boot/linker64.ld b/kernel/src/arch/riscv/boot/linker64.ld index beb246b0..634e8838 100644 --- a/kernel/src/arch/riscv/boot/linker64.ld +++ b/kernel/src/arch/riscv/boot/linker64.ld @@ -35,6 +35,7 @@ SECTIONS .data : { sdata = .; *(.data .data.*) + *(.sdata .sdata.*) edata = .; } diff --git a/kernel/src/arch/x86_64/linker.ld b/kernel/src/arch/x86_64/linker.ld index a7489a93..46a248af 100644 --- a/kernel/src/arch/x86_64/linker.ld +++ b/kernel/src/arch/x86_64/linker.ld @@ -24,6 +24,7 @@ SECTIONS { .data ALIGN(4K): { *(.data .data.*) + *(.sdata .sdata.*) } .got ALIGN(4K):