From: Alex Ghiti <alex@ghiti.fr>
To: Jerome Forissier <jerome@forissier.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Anup Patel <Anup.Patel@wdc.com>,
Atish Patra <Atish.Patra@wdc.com>, Zong Li <zong.li@sifive.com>,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-riscv@lists.infradead.org
Cc: Anup Patel <anup@brainfault.org>
Subject: Re: [PATCH v5 2/4] riscv: Introduce CONFIG_RELOCATABLE
Date: Thu, 11 Jun 2020 15:43:56 -0400 [thread overview]
Message-ID: <43ef1623-2186-aa07-cfa5-d618aa4f09c0@ghiti.fr> (raw)
In-Reply-To: <b588dd9e-dff8-3458-0c7d-149e3990bca7@forissier.org>
Hi Jerome,
Le 6/10/20 à 10:10 AM, Jerome Forissier a écrit :
> On 6/7/20 9:59 AM, Alexandre Ghiti wrote:
> [...]
>
>> +config RELOCATABLE
>> + bool
>> + depends on MMU
>> + help
>> + This builds a kernel as a Position Independent Executable (PIE),
>> + which retains all relocation metadata required to relocate the
>> + kernel binary at runtime to a different virtual address than the
>> + address it was linked at.
>> + Since RISCV uses the RELA relocation format, this requires a
>> + relocation pass at runtime even if the kernel is loaded at the
>> + same address it was linked at.
> Is this true? I thought that the GNU linker would write the "proper"
> values by default, contrary to the LLVM linker (ld.lld) which would need
> a special flag: --apply-dynamic-relocs (by default the relocated places
> are set to zero). At least, it is my experience with Aarch64 on a
> different project. So, sorry if I'm talking nonsense here -- I have not
> looked at the details.
>
>
It seems that you're right, at least for aarch64 since they specifically
specify the --no-apply-dynamic-relocs option. I retried to boot without
relocating at runtime, and it fails on riscv. Can this be arch specific ?
Thanks,
Alex
next prev parent reply other threads:[~2020-06-11 19:46 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-07 7:59 [PATCH v5 0/4] vmalloc kernel mapping and relocatable kernel Alexandre Ghiti
2020-06-07 7:59 ` [PATCH v5 1/4] riscv: Move kernel mapping to vmalloc zone Alexandre Ghiti
2020-06-11 21:34 ` Atish Patra
2020-06-12 12:30 ` Alex Ghiti
2020-07-09 5:05 ` Palmer Dabbelt
2020-07-09 8:15 ` Zong Li
2020-07-09 11:11 ` Alex Ghiti
2020-07-21 18:36 ` Alex Ghiti
2020-07-21 19:05 ` Palmer Dabbelt
2020-07-21 23:12 ` Benjamin Herrenschmidt
2020-07-21 23:48 ` Palmer Dabbelt
2020-07-22 2:21 ` Benjamin Herrenschmidt
2020-07-22 4:50 ` Michael Ellerman
2020-07-22 5:46 ` Palmer Dabbelt
2020-07-22 9:43 ` Arnd Bergmann
2020-07-22 19:52 ` Palmer Dabbelt
2020-07-22 20:22 ` Arnd Bergmann
2020-07-22 21:05 ` Atish Patra
2020-07-24 7:20 ` Arnd Bergmann
2020-07-23 5:32 ` Alex Ghiti
2020-07-21 23:11 ` Benjamin Herrenschmidt
2020-07-21 23:36 ` Palmer Dabbelt
2020-07-23 5:36 ` Alex Ghiti
2020-07-23 5:21 ` Alex Ghiti
2020-07-23 22:33 ` Benjamin Herrenschmidt
2020-07-24 8:14 ` Arnd Bergmann
2020-06-07 7:59 ` [PATCH v5 2/4] riscv: Introduce CONFIG_RELOCATABLE Alexandre Ghiti
2020-06-10 14:10 ` Jerome Forissier
2020-06-11 19:43 ` Alex Ghiti [this message]
2020-06-07 7:59 ` [PATCH v5 3/4] powerpc: Move script to check relocations at compile time in scripts/ Alexandre Ghiti
2020-06-07 7:59 ` [PATCH v5 4/4] riscv: Check relocations at compile time Alexandre Ghiti
2020-07-08 4:21 ` [PATCH v5 0/4] vmalloc kernel mapping and relocatable kernel Alex Ghiti
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=43ef1623-2186-aa07-cfa5-d618aa4f09c0@ghiti.fr \
--to=alex@ghiti.fr \
--cc=Anup.Patel@wdc.com \
--cc=Atish.Patra@wdc.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=benh@kernel.crashing.org \
--cc=jerome@forissier.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=paulus@samba.org \
--cc=zong.li@sifive.com \
/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).