build: Better solution than e23eff73a5270458d41e9742e2f4af2663169cca to the same issue
diff --git a/common/linker_bios.ld.in b/common/linker_bios.ld.in
index 4c90b986..7154ec9e 100644
--- a/common/linker_bios.ld.in
+++ b/common/linker_bios.ld.in
@@ -58,7 +58,9 @@ SECTIONS
s2_data_begin = .;
*.s2.o(.data .data.*)
s2_data_end = .;
+ } :data_s2
+ .no_unwind.stage2 : {
*.s2.o(.no_unwind)
} :data_s2
@@ -85,7 +87,9 @@ SECTIONS
data_begin = .;
*(.data .data.*)
data_end = .;
+ } :data_s3
+ .no_unwind.stage3 : {
*(.no_unwind)
} :data_s3
#endif
diff --git a/common/linker_uefi_aarch64.ld.in b/common/linker_uefi_aarch64.ld.in
index e6bcb2ab..760ddac3 100644
--- a/common/linker_uefi_aarch64.ld.in
+++ b/common/linker_uefi_aarch64.ld.in
@@ -50,11 +50,16 @@ SECTIONS
.data : {
data_begin = .;
*(.data .data.*)
+ } :data
+
+ .bss : {
*(.bss .bss.*)
*(COMMON)
data_end = .;
+ } :data
- *(.no_unwind)
+ .no_unwind : {
+ *(.no_unwind)
} :data
.dynamic : {
diff --git a/common/linker_uefi_loongarch64.ld.in b/common/linker_uefi_loongarch64.ld.in
index fbc9ba56..3946af55 100644
--- a/common/linker_uefi_loongarch64.ld.in
+++ b/common/linker_uefi_loongarch64.ld.in
@@ -50,11 +50,16 @@ SECTIONS
.data : {
data_begin = .;
*(.data .data.*)
+ } :data
+
+ .bss : {
*(.bss .bss.*)
*(COMMON)
data_end = .;
+ } :data
- *(.no_unwind)
+ .no_unwind : {
+ *(.no_unwind)
} :data
.dynamic : {
diff --git a/common/linker_uefi_riscv64.ld.in b/common/linker_uefi_riscv64.ld.in
index 55f2a9c6..2c319256 100644
--- a/common/linker_uefi_riscv64.ld.in
+++ b/common/linker_uefi_riscv64.ld.in
@@ -51,12 +51,17 @@ SECTIONS
data_begin = .;
*(.data .data.*)
*(.sdata .sdata.*)
+ } :data
+
+ .bss : {
*(.sbss .sbss.*)
*(.bss .bss.*)
*(COMMON)
data_end = .;
+ } :data
- *(.no_unwind)
+ .no_unwind : {
+ *(.no_unwind)
} :data
.dynamic : {
diff --git a/common/linker_uefi_x86_64.ld.in b/common/linker_uefi_x86_64.ld.in
index 0176a510..db5f1761 100644
--- a/common/linker_uefi_x86_64.ld.in
+++ b/common/linker_uefi_x86_64.ld.in
@@ -50,11 +50,16 @@ SECTIONS
.data : {
data_begin = .;
*(.data .data.*)
+ } :data
+
+ .bss : {
*(.bss .bss.*)
*(COMMON)
data_end = .;
+ } :data
- *(.no_unwind)
+ .no_unwind : {
+ *(.no_unwind)
} :data
.dynamic : {
