OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jessica Clarke <jrtc27@jrtc27.com>
To: opensbi@lists.infradead.org
Subject: [PATCH v4 2/5] fw_base: Put data in .data rather than .text
Date: Fri,  9 Jul 2021 20:34:20 +0100	[thread overview]
Message-ID: <20210709193423.29712-3-jrtc27@jrtc27.com> (raw)
In-Reply-To: <20210709193423.29712-1-jrtc27@jrtc27.com>

The -N linker option is supposed to make .text writable, but GNU ld and
LLD differ in interpreting what that means. GNU ld will happily let you
have relocations in it, but LLD will see that the input section is
read-only (even though the output section is writable) and give an
error. It's unclear if either of them intend to have that behaviour in
this edge case, but regardless there's no reason not to just put the
data in a writable .data section.
---
 firmware/fw_base.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/firmware/fw_base.S b/firmware/fw_base.S
index ee2a51b..f8aea05 100644
--- a/firmware/fw_base.S
+++ b/firmware/fw_base.S
@@ -501,6 +501,7 @@ _skip_trap_exit_rv32_hyp:
 	/* We don't expect to reach here hence just hang */
 	j	_start_hang
 
+	.data
 	.align 3
 #ifdef FW_PIC
 _runtime_offset:
-- 
2.31.0



  parent reply	other threads:[~2021-07-09 19:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09 19:34 [PATCH v4 0/5] Fully support standalone Clang/LLVM toolchains Jessica Clarke
2021-07-09 19:34 ` [PATCH v4 1/5] fw_base: Don't mark fw_platform_init as both global and weak Jessica Clarke
2021-07-10  2:30   ` Bin Meng
2021-07-09 19:34 ` Jessica Clarke [this message]
2021-07-10  2:52   ` [PATCH v4 2/5] fw_base: Put data in .data rather than .text Bin Meng
2021-07-09 19:34 ` [PATCH v4 3/5] firmware: Explicitly pass -pie to the linker, not just the driver Jessica Clarke
2021-07-10  2:56   ` Bin Meng
2021-07-10  8:53     ` Bin Meng
2021-07-10 10:41       ` Anup Patel
2021-07-10 12:43         ` Bin Meng
2021-07-10 13:38           ` Anup Patel
2021-07-10 13:43             ` Bin Meng
2021-07-10 14:56               ` Anup Patel
2021-07-10 18:07                 ` Xiang W
2021-07-10 18:10                   ` Jessica Clarke
2021-07-10 18:27                     ` Xiang W
2021-07-10 18:34                       ` Jessica Clarke
2021-07-09 19:34 ` [PATCH v4 4/5] Makefile: Support building with Clang and LLVM binutils Jessica Clarke
2021-07-10 13:23   ` Bin Meng
2021-07-11 13:53     ` Bin Meng
2021-07-21  5:49       ` Jessica Clarke
2021-07-21  7:40         ` Bin Meng
2021-07-09 19:34 ` [PATCH v4 5/5] Drop dependency on libgcc by importing part of FreeBSD's libquad Jessica Clarke
2021-07-09 21:00 ` [PATCH v4 0/5] Fully support standalone Clang/LLVM toolchains Jessica Clarke

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=20210709193423.29712-3-jrtc27@jrtc27.com \
    --to=jrtc27@jrtc27.com \
    --cc=opensbi@lists.infradead.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