From 87fb40d0345752899965a7917f7cdbe4eb67377f Mon Sep 17 00:00:00 2001 From: mintsuki Date: Mon, 15 Aug 2022 16:22:56 +0200 Subject: [PATCH] build: Discard .eh_frame section in linker scripts to fix potential GNU toolchain miscompilation --- common/linker_bios.ld.in | 1 + common/linker_uefi_ia32.ld.in | 1 + common/linker_uefi_x86_64.ld.in | 1 + decompressor/linker.ld | 1 + 4 files changed, 4 insertions(+) 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.*) } }