From: Heiko Carstens <hca@linux.ibm.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: gor@linux.ibm.com, agordeev@linux.ibm.com,
borntraeger@linux.ibm.com, svens@linux.ibm.com,
maskray@google.com, ndesaulniers@google.com,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, patches@lists.linux.dev
Subject: Re: [PATCH 04/11] s390: vmlinux.lds.S: Discard unnecessary sections
Date: Mon, 12 Feb 2024 14:55:11 +0100 [thread overview]
Message-ID: <20240212135511.65142-A-hca@linux.ibm.com> (raw)
In-Reply-To: <20240207-s390-lld-and-orphan-warn-v1-4-8a665b3346ab@kernel.org>
On Wed, Feb 07, 2024 at 05:14:56PM -0700, Nathan Chancellor wrote:
> When building with CONFIG_LD_ORPHAN_WARN after selecting
> CONFIG_ARCH_HAS_LD_ORPHAN_WARN, there are some warnings around certain
> ELF sections that are unnecessary for the kernel's purposes.
>
> s390-linux-ld: warning: orphan section `.dynstr' from `arch/s390/kernel/head64.o' being placed in section `.dynstr'
> s390-linux-ld: warning: orphan section `.dynamic' from `arch/s390/kernel/head64.o' being placed in section `.dynamic'
> s390-linux-ld: warning: orphan section `.hash' from `arch/s390/kernel/head64.o' being placed in section `.hash'
> s390-linux-ld: warning: orphan section `.gnu.hash' from `arch/s390/kernel/head64.o' being placed in section `.gnu.hash'
>
> Add them to the discards to clear up the warnings, which matches other
> architectures.
>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> arch/s390/kernel/vmlinux.lds.S | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
...
> - *(.interp)
> + *(.interp .dynamic)
> + *(.dynstr .hash .gnu.hash)
This seems to be wrong, since it leads to 1000s of error messages when
using the "crash" utility e.g. when looking into a live dump of system
with the generated debug info:
BFD: /usr/lib/debug/usr/lib/modules/6.8.0-20240211.rc3.git0.bdca9b8dcf3f.300.fc39.s390x/vmlinux: attempt to load strings from a non-string section (number 0)
I will change this commit to the below; it seems to work and is in
line with other architectures:
-----
When building with CONFIG_LD_ORPHAN_WARN after selecting
CONFIG_ARCH_HAS_LD_ORPHAN_WARN, there are some warnings around certain
ELF sections:
s390-linux-ld: warning: orphan section `.dynstr' from `arch/s390/kernel/head64.o' being placed in section `.dynstr'
s390-linux-ld: warning: orphan section `.dynamic' from `arch/s390/kernel/head64.o' being placed in section `.dynamic'
s390-linux-ld: warning: orphan section `.hash' from `arch/s390/kernel/head64.o' being placed in section `.hash'
s390-linux-ld: warning: orphan section `.gnu.hash' from `arch/s390/kernel/head64.o' being placed in section `.gnu.hash'
Explicitly keep those sections like other architectures when
CONFIG_RELOCATABLE is enabled, which is always true for s390.
[hca@linux.ibm.com: keep sections instead of discarding]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20240207-s390-lld-and-orphan-warn-v1-4-8a665b3346ab@kernel.org
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
arch/s390/kernel/vmlinux.lds.S | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index 661a487a3048..d46e3c383952 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -200,6 +200,21 @@ SECTIONS
*(.rela*)
__rela_dyn_end = .;
}
+ .dynamic ALIGN(8) : {
+ *(.dynamic)
+ }
+ .dynsym ALIGN(8) : {
+ *(.dynsym)
+ }
+ .dynstr ALIGN(8) : {
+ *(.dynstr)
+ }
+ .hash ALIGN(8) : {
+ *(.hash)
+ }
+ .gnu.hash ALIGN(8) : {
+ *(.gnu.hash)
+ }
. = ALIGN(PAGE_SIZE);
__init_end = .; /* freed after init ends here */
--
2.40.1
next prev parent reply other threads:[~2024-02-12 13:55 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-08 0:14 [PATCH 00/11] s390: Support linking with ld.lld Nathan Chancellor
2024-02-08 0:14 ` [PATCH 01/11] s390: boot: Add support for CONFIG_LD_ORPHAN_WARN Nathan Chancellor
2024-02-08 0:14 ` [PATCH 02/11] s390: vmlinux.lds.S: Handle '.data.rel' sections explicitly Nathan Chancellor
2024-02-08 0:14 ` [PATCH 03/11] s390: vmlinux.lds.S: Explicitly handle '.got' and '.plt' sections Nathan Chancellor
2024-02-13 5:31 ` Fangrui Song
2024-02-14 12:20 ` Heiko Carstens
2024-02-14 19:48 ` Nathan Chancellor
2024-02-08 0:14 ` [PATCH 04/11] s390: vmlinux.lds.S: Discard unnecessary sections Nathan Chancellor
2024-02-12 13:55 ` Heiko Carstens [this message]
2024-02-12 15:19 ` Heiko Carstens
2024-02-13 0:15 ` Nathan Chancellor
2024-02-08 0:14 ` [PATCH 05/11] s390/boot: vmlinux.lds.S: Handle '.init.text' Nathan Chancellor
2024-02-08 0:14 ` [PATCH 06/11] s390/boot: vmlinux.lds.S: Handle '.rela' sections Nathan Chancellor
2024-02-13 5:18 ` Fangrui Song
2024-02-14 12:17 ` Heiko Carstens
2024-02-14 21:32 ` Fangrui Song
2024-02-08 0:14 ` [PATCH 07/11] s390/boot: vmlinux.lds.S: Handle DWARF debug sections Nathan Chancellor
2024-02-13 5:33 ` Fangrui Song
2024-02-08 0:15 ` [PATCH 08/11] s390/boot: vmlinux.lds.S: Handle ELF required sections Nathan Chancellor
2024-02-08 0:15 ` [PATCH 09/11] s390/boot: vmlinux.lds.S: Handle commonly discarded sections Nathan Chancellor
2024-02-08 0:15 ` [PATCH 10/11] s390: Select CONFIG_ARCH_WANT_LD_ORPHAN_WARN Nathan Chancellor
2024-02-08 0:15 ` [PATCH 11/11] s390: Link vmlinux with '-z notext' Nathan Chancellor
2024-02-13 5:20 ` Fangrui Song
2024-02-08 23:14 ` [PATCH 00/11] s390: Support linking with ld.lld Justin Stitt
2024-02-09 11:20 ` Heiko Carstens
2024-02-09 15:08 ` Nathan Chancellor
2024-02-14 13:43 ` Heiko Carstens
2024-02-14 19:57 ` Nathan Chancellor
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=20240212135511.65142-A-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=maskray@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=patches@lists.linux.dev \
--cc=svens@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).