[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200617210613.95432-1-ndesaulniers@google.com>
Date: Wed, 17 Jun 2020 14:06:13 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: clang-built-linux@...glegroups.com,
Kees Cook <keescook@...omium.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
stable@...r.kernel.org, Jian Cai <jiancai@...gle.com>,
Luis Lozano <llozano@...gle.com>,
"Fāng-ruì Sòng" <maskray@...gle.com>,
Manoj Gupta <manojgupta@...gle.com>,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] vmlinux.lds: consider .text.{hot|unlikely}.* part of .text too
ld.bfd's internal linker script considers .text.hot AND .text.hot.* to
be part of .text, as well as .text.unlikely and .text.unlikely.*. ld.lld
will produce .text.hot.*/.text.unlikely.* sections. Make sure to group
these together. Otherwise these orphan sections may be placed outside
of the the _stext/_etext boundaries.
Cc: stable@...r.kernel.org
Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=add44f8d5c5c05e08b11e033127a744d61c26aee
Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=1de778ed23ce7492c523d5850c6c6dbb34152655
Link: https://reviews.llvm.org/D79600
Reported-by: Jian Cai <jiancai@...gle.com>
Debugged-by: Luis Lozano <llozano@...gle.com>
Suggested-by: Fāng-ruì Sòng <maskray@...gle.com>
Tested-by: Luis Lozano <llozano@...gle.com>
Tested-by: Manoj Gupta <manojgupta@...gle.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
---
include/asm-generic/vmlinux.lds.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index d7c7c7f36c4a..fe5aaef169e3 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -560,7 +560,9 @@
*/
#define TEXT_TEXT \
ALIGN_FUNCTION(); \
- *(.text.hot TEXT_MAIN .text.fixup .text.unlikely) \
+ *(.text.hot .text.hot.*) \
+ *(TEXT_MAIN .text.fixup) \
+ *(.text.unlikely .text.unlikely.*) \
NOINSTR_TEXT \
*(.text..refcount) \
*(.ref.text) \
--
2.27.0.290.gba653c62da-goog
Powered by blists - more mailing lists