qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Chu, Benson" <b-chu1@ti.com>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: [qemu-riscv] Error mapping file: Invalid argument
Date: Mon, 10 Mar 2025 14:52:47 +0000	[thread overview]
Message-ID: <f5ee7468950a4c3abbd3b05b7753d15c@ti.com> (raw)

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

Hello all,

I am working on a linker for the RISC-V target, and I was trying to use qemu-riscv32 to test my linker.

However, I have noticed that qemu-riscv32 has some restrictions about how the program can be laid out in memory, and getting my linker to place the program in a way that qemu-riscv32 will accept is very annoying.

By my understanding, for each segment to be loaded, offset into the ELF file must match the offset into a target page, which seems to be 4KiB.

I noticed that GNU ld and LLVM's lld both follow this placement by default. Is there some ABI that's being conformed to for this? Is there any documentation describing why placement needs to be done this way?

Thanks!
Benson


[-- Attachment #2: Type: text/html, Size: 2845 bytes --]

             reply	other threads:[~2025-03-10 15:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10 14:52 Chu, Benson [this message]
2025-03-10 15:55 ` [qemu-riscv] Error mapping file: Invalid argument Peter Maydell

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=f5ee7468950a4c3abbd3b05b7753d15c@ti.com \
    --to=b-chu1@ti.com \
    --cc=qemu-devel@nongnu.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 NNTP newsgroup(s).