From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Date: Tue, 24 Mar 2015 09:39:10 +0000 (+0100)
Subject: ARM: 8321/1: asm-generic: introduce .text.fixup input section
X-Git-Tag: v4.1-rc1~129^2~25
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=779c88c94c34bd3b521da97b456a1aa51d870dec;p=users%2Fdwmw2%2Flinux.git

ARM: 8321/1: asm-generic: introduce .text.fixup input section

This introduces a new .text.fixup input section that gets emitted
together with the .text section for each input object file.

Note that

  *(.text)
  *(.text.fixup)

is not the same as

  *(.text .text.fixup)

and we are looking for the latter, to ensure that fixup snippets that
are assembled into a separate section in the object file do not end
up out of range for the relative branch instructions it contains if
the .text section itself grows very large.

This helps prevent linker failures on large ARM kernels.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index ac78910d7416c..463231d5bfc79 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -401,7 +401,7 @@
 #define TEXT_TEXT							\
 		ALIGN_FUNCTION();					\
 		*(.text.hot)						\
-		*(.text)						\
+		*(.text .text.fixup)					\
 		*(.ref.text)						\
 	MEM_KEEP(init.text)						\
 	MEM_KEEP(exit.text)						\