From: Greg Ungerer <gerg@linux-m68k.org>
To: Damien Le Moal <damien.lemoal@wdc.com>,
uclinux-dev@uclinux.org, Palmer Dabbelt <palmer@dabbelt.com>,
linux-riscv@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, Anup Patel <anup.patel@wdc.com>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v4 2/2] riscv: Disable data start offset in flat binaries
Date: Sat, 17 Apr 2021 14:56:41 +1000 [thread overview]
Message-ID: <ba8edc33-a171-31c4-a873-ae552cca7690@linux-m68k.org> (raw)
In-Reply-To: <20210417011009.54569-3-damien.lemoal@wdc.com>
On 17/4/21 11:10 am, Damien Le Moal wrote:
> uclibc/gcc combined with elf2flt riscv linker file fully resolve the
> PC relative __global_pointer$ value at compile time and do not generate
> a relocation entry to set a correct value of the gp register at runtime.
> As a result, if the flatbin loader offsets the start of the data
> section, the relative position change between the text and data sections
> compared to the compile time positions results in an incorrect gp value
> being used. This causes flatbin executables to crash.
>
> Avoid this problem by enabling CONFIG_BINFMT_FLAT_NO_DATA_START_OFFSET
> automatically when CONFIG_RISCV is enabled and CONFIG_MMU is disabled.
>
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
Acked-by: Greg Ungerer <gerg@linux-m68k.org>
Palmer do you want me to take this via my tree with 1/2 in the series,
or are you going to pick it up?
Regards
Greg
> ---
> arch/riscv/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 4515a10c5d22..add528eb9235 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -33,6 +33,7 @@ config RISCV
> select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
> select ARCH_WANT_FRAME_POINTERS
> select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
> + select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
> select CLONE_BACKWARDS
> select CLINT_TIMER if !MMU
> select COMMON_CLK
>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
prev parent reply other threads:[~2021-04-17 4:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-17 1:10 [PATCH v4 0/2] Fix binfmt_flat loader for RISC-V Damien Le Moal
2021-04-17 1:10 ` [PATCH v4 1/2] binfmt_flat: allow not offsetting data start Damien Le Moal
2021-04-17 4:52 ` Greg Ungerer
2021-04-17 4:54 ` Damien Le Moal
2021-04-18 2:38 ` Greg Ungerer
2021-04-22 12:00 ` Damien Le Moal
2021-04-23 4:04 ` Palmer Dabbelt
2021-04-23 5:38 ` Greg Ungerer
2021-04-23 6:44 ` Palmer Dabbelt
2021-04-17 1:10 ` [PATCH v4 2/2] riscv: Disable data start offset in flat binaries Damien Le Moal
2021-04-17 4:56 ` Greg Ungerer [this message]
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=ba8edc33-a171-31c4-a873-ae552cca7690@linux-m68k.org \
--to=gerg@linux-m68k.org \
--cc=anup.patel@wdc.com \
--cc=damien.lemoal@wdc.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=uclinux-dev@uclinux.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).