public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/boot: explicitly place .eh_frame after .rodata
@ 2019-11-04  9:03 Ilie Halip
  2019-11-04 17:54 ` Nick Desaulniers
  0 siblings, 1 reply; 13+ messages in thread
From: Ilie Halip @ 2019-11-04  9:03 UTC (permalink / raw)
  To: x86
  Cc: Nick Desaulniers, Ilie Halip, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin, linux-kernel, clang-built-linux

When using GCC as compiler and LLVM's lld as linker, linking
setup.elf fails:
      LD      arch/x86/boot/setup.elf
    ld.lld: error: init sections too big!

This happens because ld.lld has different rules for placing
orphan sections (i.e. sections not mentioned in a linker script)
compared to ld.bfd.

Particularly, in this case, the merged .eh_frame section is
placed before __end_init, which triggers an assert in the script.

Explicitly place this section after .rodata, in accordance with
ld.bfd's behavior.

Signed-off-by: Ilie Halip <ilie.halip@gmail.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/760
---
 arch/x86/boot/setup.ld | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/boot/setup.ld b/arch/x86/boot/setup.ld
index 0149e41d42c2..4e02eab11b59 100644
--- a/arch/x86/boot/setup.ld
+++ b/arch/x86/boot/setup.ld
@@ -25,6 +25,7 @@ SECTIONS
 
 	. = ALIGN(16);
 	.rodata		: { *(.rodata*) }
+	.eh_frame	: { *(.eh_frame*) }
 
 	.videocards	: {
 		video_cards = .;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-12-14  7:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-04  9:03 [PATCH] x86/boot: explicitly place .eh_frame after .rodata Ilie Halip
2019-11-04 17:54 ` Nick Desaulniers
2019-11-05 14:37   ` Ilie Halip
2019-11-06 12:06   ` [PATCH V2] " Ilie Halip
2019-11-06 17:23     ` Nick Desaulniers
2019-11-18 10:22       ` Ilie Halip
2019-11-18 14:35     ` Borislav Petkov
2019-11-18 17:46       ` Nick Desaulniers
2019-11-18 17:52         ` Borislav Petkov
2019-11-26 14:45           ` [PATCH v3] x86/boot: discard .eh_frame sections Ilie Halip
2019-11-26 17:16             ` Nick Desaulniers
2019-12-06 21:53               ` Nick Desaulniers
2019-12-14  7:12             ` [tip: x86/boot] x86/boot: Discard " tip-bot2 for Ilie Halip

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox