linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: vmlinux.lds.S: keep .entry.tramp.text section
@ 2021-02-26 14:03 Arnd Bergmann
  2021-02-26 20:59 ` Kees Cook
  0 siblings, 1 reply; 9+ messages in thread
From: Arnd Bergmann @ 2021-02-26 14:03 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: Arnd Bergmann, Ard Biesheuvel, Mark Rutland, Marc Zyngier,
	David Brazdil, Kees Cook, linux-arm-kernel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

When building with CONFIG_LD_DEAD_CODE_DATA_ELIMINATION,
I sometimes see an assertion

 ld.lld: error: Entry trampoline text too big

This happens when any reference to the trampoline is discarded at link
time. Marking the section as KEEP() avoids the assertion, but I have
not figured out whether this is the correct solution for the underlying
problem.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm64/kernel/vmlinux.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index 926cdb597a45..c5ee9d5842db 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -96,7 +96,7 @@ jiffies = jiffies_64;
 #define TRAMP_TEXT					\
 	. = ALIGN(PAGE_SIZE);				\
 	__entry_tramp_text_start = .;			\
-	*(.entry.tramp.text)				\
+	KEEP(*(.entry.tramp.text))			\
 	. = ALIGN(PAGE_SIZE);				\
 	__entry_tramp_text_end = .;
 #else
-- 
2.29.2


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

end of thread, other threads:[~2021-06-03 12:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 14:03 [PATCH] arm64: vmlinux.lds.S: keep .entry.tramp.text section Arnd Bergmann
2021-02-26 20:59 ` Kees Cook
2021-02-27  4:32   ` Fangrui Song
2021-03-16 10:45     ` Catalin Marinas
2021-03-16 16:27       ` Catalin Marinas
2021-03-16 16:39         ` Arnd Bergmann
2021-03-16 19:09           ` Catalin Marinas
2021-06-02 19:32             ` Kees Cook
2021-06-03 12:07               ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).