From: Petr Mladek <pmladek@suse.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Jiri Kosina <jikos@kernel.org>, Miroslav Benes <mbenes@suse.cz>,
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: Tue, 15 Oct 2024 14:08:33 +0200 [thread overview]
Message-ID: <Zw5a-JH99HwxhoY3@pathway.suse.cz> (raw)
In-Reply-To: <CAMj1kXGtruDm81Yor8hrOnSj7-J1vKKB1c-H0ZAtyMG_mZgWMg@mail.gmail.com>
On Mon 2024-10-14 20:19:32, Ard Biesheuvel wrote:
> On Mon, 14 Oct 2024 at 20:10, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > 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 don't disagree with any of this. CC'ing folks working on live patch
> in case they have any insights.
The livepatching specific sections use the name pattern:
.klp.rela.objname.section_name
They are generated by a post processing of the livepatch module.
The code is not upstream at the moment. It is implemented by
some out-of-tree tools which are used to build the livepatches.
More details can be found in
Documentation/livepatch/module-elf-format.rst
Best Regards,
Petr
prev parent reply other threads:[~2024-10-15 12:08 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
2024-10-14 18:19 ` Ard Biesheuvel
2024-10-15 12:08 ` Petr Mladek [this message]
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=Zw5a-JH99HwxhoY3@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=jikos@kernel.org \
--cc=jpoimboe@kernel.org \
--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=mbenes@suse.cz \
--cc=nathan@kernel.org \
--cc=surenb@google.com \
--cc=torvalds@linux-foundation.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