From: Thomas Huth <thuth@redhat.com>
To: Andrew Jones <andrew.jones@linux.dev>, kvmarm@lists.linux.dev
Cc: kvm@vger.kernel.org
Subject: [kvm-unit-tests PATCH] arm/flat.lds: Specify program headers with flags to avoid linker warnings
Date: Fri, 23 Jun 2023 15:05:28 +0200 [thread overview]
Message-ID: <20230623130528.483909-1-thuth@redhat.com> (raw)
With ld from binutils v2.40 I currently get warning messages like this:
ld: warning: arm/spinlock-test.elf has a LOAD segment with RWX permissions
ld: warning: arm/selftest.elf has a LOAD segment with RWX permissions
ld: warning: arm/pci-test.elf has a LOAD segment with RWX permissions
ld: warning: arm/pmu.elf has a LOAD segment with RWX permissions
...
Seems like these can be silenced by explicitly specifying the program
headers with the appropriate flags (like we did in commit 0a06949aafac4a4
on x86 and in commit 5126732d73aa75 on powerpc already).
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
arm/flat.lds | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/arm/flat.lds b/arm/flat.lds
index 47fcb649..f722c650 100644
--- a/arm/flat.lds
+++ b/arm/flat.lds
@@ -22,10 +22,16 @@
* +----------------------+ <-- physical address 0x0
*/
+PHDRS
+{
+ text PT_LOAD FLAGS(5);
+ data PT_LOAD FLAGS(6);
+}
+
SECTIONS
{
PROVIDE(_text = .);
- .text : { *(.init) *(.text) *(.text.*) }
+ .text : { *(.init) *(.text) *(.text.*) } :text
. = ALIGN(64K);
PROVIDE(etext = .);
@@ -39,8 +45,8 @@ SECTIONS
.got : { *(.got) *(.got.plt) }
.eh_frame : { *(.eh_frame) }
- .rodata : { *(.rodata*) }
- .data : { *(.data) }
+ .rodata : { *(.rodata*) } :data
+ .data : { *(.data) } :data
. = ALIGN(16);
PROVIDE(bss = .);
.bss : { *(.bss) }
--
2.39.3
next reply other threads:[~2023-06-23 13:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-23 13:05 Thomas Huth [this message]
2023-06-23 15:38 ` [kvm-unit-tests PATCH] arm/flat.lds: Specify program headers with flags to avoid linker warnings Andrew Jones
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=20230623130528.483909-1-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=andrew.jones@linux.dev \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
/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