diff --git a/include/arch/x86/linker.ld b/include/arch/x86/linker.ld index c8e0631150e..4984f05b115 100644 --- a/include/arch/x86/linker.ld +++ b/include/arch/x86/linker.ld @@ -107,6 +107,7 @@ SECTIONS *(.text) *(".text.*") *(.gnu.linkonce.t.*) + *(.eh_frame_hdr) *(.eh_frame) *(.init) *(.fini) @@ -450,6 +451,8 @@ SECTIONS #include + /DISCARD/ : { *(.note.GNU-stack) } + } #ifdef CONFIG_XIP diff --git a/include/linker/debug-sections.ld b/include/linker/debug-sections.ld index 4a7d04fdb21..e0eaf7f7cec 100644 --- a/include/linker/debug-sections.ld +++ b/include/linker/debug-sections.ld @@ -7,6 +7,7 @@ SECTION_PROLOGUE(.stab.exclstr, 0,) { *(.stab.exclstr) } SECTION_PROLOGUE(.stab.index, 0,) { *(.stab.index) } SECTION_PROLOGUE(.stab.indexstr, 0,) { *(.stab.indexstr) } + SECTION_PROLOGUE(.gnu.build.attributes, 0,) { *(.gnu.build.attributes .gnu.build.attributes.*) } SECTION_PROLOGUE(.comment, 0,) { *(.comment) } /* DWARF debug sections. Symbols in the DWARF debugging sections are relative to the beginning