public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Matthew Malcomson <matthew.malcomson@arm.com>
To: <binutils@sourceware.org>
Cc: <Richard.Earnshaw@arm.com>
Subject: [PATCH] ld: aarch64: Update test linker scripts relocs.ld and relocs-ilp32.ld
Date: Fri, 8 Jul 2022 13:43:39 +0100	[thread overview]
Message-ID: <8cb2b1e0-8b89-4aa1-8b03-92dbd57c98f9@AZ-NEU-EX03.Arm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1657 bytes --]

The updates are to ensure that the .data section exists.  This means
that we always have a data section.  That means that we don't create a
RWX segment and avoid the corresponding warning.

We get this warning when testing aarch64-none-elf with -mcmodel=tiny.
N.b. this changes quite a few testcases from fail to pass.

OK for master?


###############     Attachment also inlined for ease of reply    ###############


diff --git a/ld/testsuite/ld-aarch64/relocs-ilp32.ld b/ld/testsuite/ld-aarch64/relocs-ilp32.ld
index 7174aff236f189a1ae5caa94ecaf27c7ddb171b5..4ddba9141209a48c1342c4ffaf65b327d91873a8 100644
--- a/ld/testsuite/ld-aarch64/relocs-ilp32.ld
+++ b/ld/testsuite/ld-aarch64/relocs-ilp32.ld
@@ -16,4 +16,8 @@ SECTIONS
   . = 0x12340000;
   .far : { *(.far) }
   .ARM.attributes 0 : { *(.ARM.atttributes) }
+  /* Providing a .data section triggers a non-executable segment to be
+     generated, which gives somewhere else for the linker to put the TLS
+     segment without creating a RWX permissioned one. */
+  .data : { *(.data) }
 }
diff --git a/ld/testsuite/ld-aarch64/relocs.ld b/ld/testsuite/ld-aarch64/relocs.ld
index f42176e64d30daa9949c0679ff3b0a931de46dfd..77adac8b46e01b488e68405b1291335a2dfa29fc 100644
--- a/ld/testsuite/ld-aarch64/relocs.ld
+++ b/ld/testsuite/ld-aarch64/relocs.ld
@@ -16,4 +16,8 @@ SECTIONS
   . = 0x12340000;
   .far : { *(.far) }
   .ARM.attributes 0 : { *(.ARM.atttributes) }
+  /* Providing a .data section triggers a non-executable segment to be
+     generated, which gives somewhere else for the linker to put the TLS
+     segment without creating a RWX permissioned one. */
+  .data : { *(.data) }
 }




[-- Attachment #2: linker-script-test.patch --]
[-- Type: text/plain, Size: 1237 bytes --]

diff --git a/ld/testsuite/ld-aarch64/relocs-ilp32.ld b/ld/testsuite/ld-aarch64/relocs-ilp32.ld
index 7174aff236f189a1ae5caa94ecaf27c7ddb171b5..4ddba9141209a48c1342c4ffaf65b327d91873a8 100644
--- a/ld/testsuite/ld-aarch64/relocs-ilp32.ld
+++ b/ld/testsuite/ld-aarch64/relocs-ilp32.ld
@@ -16,4 +16,8 @@ SECTIONS
   . = 0x12340000;
   .far : { *(.far) }
   .ARM.attributes 0 : { *(.ARM.atttributes) }
+  /* Providing a .data section triggers a non-executable segment to be
+     generated, which gives somewhere else for the linker to put the TLS
+     segment without creating a RWX permissioned one. */
+  .data : { *(.data) }
 }
diff --git a/ld/testsuite/ld-aarch64/relocs.ld b/ld/testsuite/ld-aarch64/relocs.ld
index f42176e64d30daa9949c0679ff3b0a931de46dfd..77adac8b46e01b488e68405b1291335a2dfa29fc 100644
--- a/ld/testsuite/ld-aarch64/relocs.ld
+++ b/ld/testsuite/ld-aarch64/relocs.ld
@@ -16,4 +16,8 @@ SECTIONS
   . = 0x12340000;
   .far : { *(.far) }
   .ARM.attributes 0 : { *(.ARM.atttributes) }
+  /* Providing a .data section triggers a non-executable segment to be
+     generated, which gives somewhere else for the linker to put the TLS
+     segment without creating a RWX permissioned one. */
+  .data : { *(.data) }
 }




             reply	other threads:[~2022-07-08 12:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08 12:43 Matthew Malcomson [this message]
2022-07-29 10:16 ` Nick Clifton

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=8cb2b1e0-8b89-4aa1-8b03-92dbd57c98f9@AZ-NEU-EX03.Arm.com \
    --to=matthew.malcomson@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=binutils@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).