From: Segher Boessenkool <segher@kernel.crashing.org>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Naveen N Rao <naveen@kernel.org>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] arch/powerpc: Remove .interp section in vmlinux
Date: Tue, 1 Jul 2025 08:32:57 -0500 [thread overview]
Message-ID: <aGPjibUcPDubyFY1@gate> (raw)
In-Reply-To: <eeaf8fd6628a75d19872ab31cf7e7179e2baef5e.1751366959.git.christophe.leroy@csgroup.eu>
Hi!
On Tue, Jul 01, 2025 at 12:49:29PM +0200, Christophe Leroy wrote:
> When building with CONFIG_RELOCATABLE, there is a .interp section
> which contains the name of the expected ELF interpreter:
>
> Contents of section .interp:
> c0000000021c1bac 2f757372 2f6c6962 2f6c642e 736f2e31 /usr/lib/ld.so.1
> c0000000021c1bbc 00 .
>
> That information is useless and even likely wrong. Remove it.
s/ likely//
You cannot run the kernel as some dynamic object (under control of some
interpreter that will load DSOs for you), hehe.
The various bfd/elf*.c (in binutils/ld) have code like
if (htab->elf.dynamic_sections_created)
{
/* Set the contents of the .interp section to the interpreter. */
if (bfd_link_executable (info) && !info->nointerp)
{
s = bfd_get_linker_section (dynobj, ".interp");
if (s == NULL)
abort ();
s->size = sizeof ELF_DYNAMIC_INTERPRETER;
s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
}
}
(yes there are about a hundred copies of this code, that could be
improved :-) )
whenever producing dynamic objects, so this code just sets that text and
that's all, no side effect to be worried of.
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
(Maybe this could or should be in generic code though, not architecture
code?)
Segher
next prev parent reply other threads:[~2025-07-01 13:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 10:49 [PATCH] arch/powerpc: Remove .interp section in vmlinux Christophe Leroy
2025-07-01 13:32 ` Segher Boessenkool [this message]
2025-10-13 4:01 ` Vishal Chourasia
2025-10-13 6:46 ` Christophe Leroy
2025-10-13 7:27 ` Vishal Chourasia
2025-10-15 0:21 ` Nathan Chancellor
2025-10-15 3:37 ` Vishal Chourasia
2025-10-15 18:27 ` Nathan Chancellor
2025-10-16 6:06 ` Vishal Chourasia
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=aGPjibUcPDubyFY1@gate \
--to=segher@kernel.crashing.org \
--cc=christophe.leroy@csgroup.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=naveen@kernel.org \
--cc=npiggin@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.