From: Ben Dooks <ben.dooks@codethink.co.uk>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: linux-kernel@lists.codethink.co.uk,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-riscv <linux-riscv@lists.infradead.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>
Subject: Re: [PATCH] riscv: add correct as-options for assembly in modules
Date: Fri, 16 Jul 2021 16:33:07 +0100 [thread overview]
Message-ID: <36a5d9d8-67be-e128-2798-5bf1989ce06d@codethink.co.uk> (raw)
In-Reply-To: <CAEUhbmWmrEuwdy8OPhF1p1Sb7779QiWkx-Ca1OG5VQ38dxChLw@mail.gmail.com>
On 16/07/2021 11:44, Bin Meng wrote:
> On Tue, Jul 13, 2021 at 2:28 AM Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>>
>> When trying to load modules built for riscv which include assembly
>
> nits: RISC-V
>
>> the kernel loader errors with "unexpected relocation type 'R_RISCV_ALIGN'"
>> due to R_RISCV_ALIGN relocations being generated by the assembler.
>>
>> In commit 7a8e7da42250138 ("RISC-V: Fixes to module loading")
>> the fix for gcc adds -mno-relax to the command line when building
>> C files. However this was never applied to assembly flags, and gcc
>> does no pass -mno-relax to gas when presented with a .S file.
>
> does not pass
I'll see if I can make this simpler. Should this get done for a v2?
> FYI
>
> The GCC bug was fixed recently via:
> https://github.com/gcc-mirror/gcc/commit/3b0a7d624e64eeb81e4d5e8c62c46d86ef521857
thanks, I think it still useful to fix this in the kernel.
>>
>> The fix (other than making gcc always pass -mno-relax to gas) is
>> to add -Wa,-mno-relax to gcc to make sure the as is invoked with
>> the right options.
>>
>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>> ---
>> arch/riscv/Makefile | 1 +
>> 1 file changed, 1 insertion(+)
>>
>
> Otherwise,
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
https://www.codethink.co.uk/privacy.html
next prev parent reply other threads:[~2021-07-16 15:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-12 17:48 [PATCH] riscv: add correct as-options for assembly in modules Ben Dooks
2021-07-16 10:23 ` Ben Dooks
2021-07-16 10:44 ` Bin Meng
2021-07-16 15:33 ` Ben Dooks [this message]
2021-07-16 22:37 ` Bin Meng
-- strict thread matches above, loose matches on Subject: below --
2021-12-08 19:26 Ben Dooks
2022-01-10 15:51 ` Ben Dooks
2022-01-11 7:41 ` Bin Meng
2022-05-29 15:19 Ben Dooks
2022-05-29 15:23 ` Ben Dooks
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=36a5d9d8-67be-e128-2798-5bf1989ce06d@codethink.co.uk \
--to=ben.dooks@codethink.co.uk \
--cc=aou@eecs.berkeley.edu \
--cc=bmeng.cn@gmail.com \
--cc=linux-kernel@lists.codethink.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@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