linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: clang-built-linux@googlegroups.com,
	"Kees Cook" <keescook@chromium.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	stable@vger.kernel.org, "Jian Cai" <jiancai@google.com>,
	"Luis Lozano" <llozano@google.com>,
	"Fāng-ruì Sòng" <maskray@google.com>,
	"Manoj Gupta" <manojgupta@google.com>,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] vmlinux.lds: consider .text.{hot|unlikely}.* part of .text too
Date: Wed, 17 Jun 2020 14:06:13 -0700	[thread overview]
Message-ID: <20200617210613.95432-1-ndesaulniers@google.com> (raw)
Message-ID: <20200617210613.UDhXIzD0HPAA_ThDDQFi77PF2hnkc7jkaPMLYCMqY2M@z> (raw)

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@vger.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@google.com>
Debugged-by: Luis Lozano <llozano@google.com>
Suggested-by: Fāng-ruì Sòng <maskray@google.com>
Tested-by: Luis Lozano <llozano@google.com>
Tested-by: Manoj Gupta <manojgupta@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.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

             reply	other threads:[~2020-06-17 21:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 21:06 Nick Desaulniers [this message]
2020-06-17 21:06 ` [PATCH] vmlinux.lds: consider .text.{hot|unlikely}.* part of .text too Nick Desaulniers
2020-06-17 21:27 ` Fāng-ruì Sòng
2020-06-17 21:27   ` Fāng-ruì Sòng
2020-06-22 23:04   ` Nick Desaulniers
2020-06-22 23:04     ` Nick Desaulniers
2020-06-22 23:15     ` Fāng-ruì Sòng
2020-06-22 23:15       ` Fāng-ruì Sòng
2020-06-25 18:47       ` [PATCH v2] vmlinux.lds: add PGO and AutoFDO input sections Nick Desaulniers
2020-06-25 18:47         ` Nick Desaulniers
2020-07-01 21:54         ` Nick Desaulniers
2020-07-02  8:19           ` Arnd Bergmann
2020-07-02 15:57             ` Kees Cook
2020-07-08 23:13               ` Nick Desaulniers
2020-07-09  5:43                 ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200617210613.95432-1-ndesaulniers@google.com \
    --to=ndesaulniers@google.com \
    --cc=arnd@arndb.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=jiancai@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llozano@google.com \
    --cc=manojgupta@google.com \
    --cc=maskray@google.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).