mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Rich Felker <dalias@libc.org>
Cc: Rob Landley <rob@landley.net>,
	Linux-sh list <linux-sh@vger.kernel.org>,
	 musl <musl@lists.openwall.com>
Subject: Re: [musl] FDPIC on sh4?
Date: Thu, 15 Feb 2024 15:53:53 +0100	[thread overview]
Message-ID: <CAMuHMdVczQMiyDkhgAd4G6Zrmw7-pBYMnDvVn18vxd-3CSsSaA@mail.gmail.com> (raw)
In-Reply-To: <20240215134941.GE4163@brightrain.aerifal.cx>

Hi Rich,

On Thu, Feb 15, 2024 at 2:49 PM Rich Felker <dalias@libc.org> wrote:
> On Thu, Feb 15, 2024 at 04:31:00AM -0600, Rob Landley wrote:
> > Is there any easy way to build FDPIC support for sh4 with-mmu? In theory ARM can
>
> On the userspace toolchain and musl side, yes, I see no reason you
> shouldn't be able to build musl for sh4 with fdpic ABI or build a
> toolchain for sh4 that defaults to fdpic and has fdpic target-libs. I
> just tested passing -mfdpic to sh4-linux-musl-gcc and it seems to
> produce correct fdpic code.
>
> On the kernel side, I'm not sure, but the normal ELF loader should be
> able to load fdpic binaries on a system with mmu. It will not float
> the data segment separately from text, but doesn't need to because it
> has an mmu. If this is no longer working it's a kernel regression;
> that's how I always tested sh2eb fdpic binaries on qemu-system-sh4eb.
>
> > do it, so I tried editing the kconfig BINFMT_ELF_FDPIC dependencies in
> > fs/Kconfig.binfmt to move "SUPERH" out of the !MMU list and put it next to ARM,
> > switched on the FDPIC loader, and the build broke with:
> >
> > fs/binfmt_elf_fdpic.o: in function `load_elf_fdpic_binary':
> > binfmt_elf_fdpic.c:(.text+0x1b44): undefined reference to
> > `elf_fdpic_arch_lay_out_mm'
>
> It looks like there's an arch-provided function that's conditional on
> !MMU in arch/sh but that, now that fdpic loader is intended to be
> supported on mmu-ful systems, should be changed to be conditional on
> fdpic support (or maybe even unconditional if fdpic can be loaded as a
> module). Just look for where it's defined in arch/sh. If it's in a
> nommu-specific file it might need to be moved somewhere more
> appropriate, or an mmu-ful variant may need to be written and placed
> somewhere more appropriate.

ARM is the sole architecture that provides elf_fdpic_arch_lay_out_mm().

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2024-02-15 14:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 10:31 Rob Landley
2024-02-15 13:49 ` Rich Felker
2024-02-15 14:53   ` Geert Uytterhoeven [this message]
2024-02-15 16:47     ` Rich Felker
2024-02-16 12:25       ` Rob Landley
2024-02-16 18:32         ` Rob Landley

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=CAMuHMdVczQMiyDkhgAd4G6Zrmw7-pBYMnDvVn18vxd-3CSsSaA@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=dalias@libc.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=musl@lists.openwall.com \
    --cc=rob@landley.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).