:: commit 87fb40d0345752899965a7917f7cdbe4eb67377f

mintsuki <mintsuki@protonmail.com> — 2022-08-15 14:22

parents: 031cd12458

build: Discard .eh_frame section in linker scripts to fix potential GNU toolchain miscompilation

diff --git a/common/linker_bios.ld.in b/common/linker_bios.ld.in
index 618649c3..29d3c3c7 100644
--- a/common/linker_bios.ld.in
+++ b/common/linker_bios.ld.in
@@ -84,6 +84,7 @@ SECTIONS
     } :data_s3
 
     /DISCARD/ : {
+        *(.eh_frame)
         *(.note .note.*)
     }
 }
diff --git a/common/linker_uefi_ia32.ld.in b/common/linker_uefi_ia32.ld.in
index f5cb241a..5d32b21e 100644
--- a/common/linker_uefi_ia32.ld.in
+++ b/common/linker_uefi_ia32.ld.in
@@ -85,6 +85,7 @@ SECTIONS
     __image_end = __data_end;
 
     /DISCARD/ : {
+        *(.eh_frame)
         *(.note .note.*)
     }
 }
diff --git a/common/linker_uefi_x86_64.ld.in b/common/linker_uefi_x86_64.ld.in
index dbe0b190..146d1656 100644
--- a/common/linker_uefi_x86_64.ld.in
+++ b/common/linker_uefi_x86_64.ld.in
@@ -85,6 +85,7 @@ SECTIONS
     __image_end = __data_end;
 
     /DISCARD/ : {
+        *(.eh_frame)
         *(.note .note.*)
     }
 }
diff --git a/decompressor/linker.ld b/decompressor/linker.ld
index 2d7b904c..169de6e2 100644
--- a/decompressor/linker.ld
+++ b/decompressor/linker.ld
@@ -30,6 +30,7 @@ SECTIONS
     } :data
 
     /DISCARD/ : {
+        *(.eh_frame)
         *(.note .note.*)
     }
 }
tab: 248 wrap: offon