From: Linus Torvalds <torvalds@linux-foundation.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Ard Biesheuvel <ardb+git@google.com>,
linux-kernel@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Kent Overstreet <kent.overstreet@linux.dev>,
Arnd Bergmann <arnd@arndb.de>,
linux-arch@vger.kernel.org, linux-mm@kvack.org,
linux-kbuild@vger.kernel.org
Subject: Re: [PATCH 0/2] Use dot prefixes for section names
Date: Mon, 14 Oct 2024 11:10:35 -0700 [thread overview]
Message-ID: <CAHk-=wjk3ynjomNvFN8jf9A1k=qSc=JFF591W00uXj-qqNUxPQ@mail.gmail.com> (raw)
In-Reply-To: <CAMj1kXFu=fABi+d=A5PL2yNx2b70toT9KtDfnvU=8mmUBHMutg@mail.gmail.com>
On Mon, 14 Oct 2024 at 10:44, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> We have this code in arch/x86/Makefile.postlink:
>
> quiet_cmd_strip_relocs = RSTRIP $@
> cmd_strip_relocs = \
> $(OBJCOPY) --remove-section='.rel.*' --remove-section='.rel__*' \
> --remove-section='.rela.*' --remove-section='.rela__*' $@
>
> Of course, that could easily be fixed, I was just being cautious in
> case there is other, out-of-tree tooling for live patch or kexec etc
> that has similar assumptions wrt section names.
I'd actually much rather just make strip_relocs not have that "." and
"__" pattern at all, and just say "we strip all sections that start
with '.rel'".
And then we make the rule that we do *not* create sections named ".rel*".
That seems like a much simpler rule, and would seem to simplify
strip_relocs too, which would just become
$(OBJCOPY) --remove-section='.rel*' $@
(We seem to have three different copies of that complex pattern with
.rel vs .rela and "." vs "__" - it's in s390, riscv, and x86. So we'd
do that simplification in three places)
IOW, I'd much rather make our section rules simpler rather than more complex.
Of course, if there is some active and acute problem report with this
thing, we might not have that option, but in the absence of any
*known* issue with just simplifying things, I'd rather do that.
I feel that our linker scripts - and linking rules in general - are
already quite complicated, which is why I'd really like to take this
as a time to try to simplify the rules.
Linus
Linus
next prev parent reply other threads:[~2024-10-14 18:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 12:57 Ard Biesheuvel
2024-10-14 12:57 ` [PATCH 1/2] codetag: Use dot prefix for section name Ard Biesheuvel
2024-10-14 21:16 ` Suren Baghdasaryan
2024-10-14 12:57 ` [PATCH 2/2] runtime-const: Use dot prefix for section names Ard Biesheuvel
2024-10-14 17:29 ` [PATCH 0/2] Use dot prefixes " Linus Torvalds
2024-10-14 17:43 ` Ard Biesheuvel
2024-10-14 18:10 ` Linus Torvalds [this message]
2024-10-14 18:19 ` Ard Biesheuvel
2024-10-15 12:08 ` Petr Mladek
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='CAHk-=wjk3ynjomNvFN8jf9A1k=qSc=JFF591W00uXj-qqNUxPQ@mail.gmail.com' \
--to=torvalds@linux-foundation.org \
--cc=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=kent.overstreet@linux.dev \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=surenb@google.com \
/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