[PATCH 8/9] RISC-V: Support RISCV_ALIGN relocations in modules.

Stef O'Rear sorear2 at gmail.com
Fri Mar 2 01:12:26 PST 2018


On Thu, Mar 1, 2018 at 3:53 PM, Shea Levy <shea at shealevy.com> wrote:
> Palmer Dabbelt <palmer at sifive.com> writes:
>> Well, this is awkward: I remembered doing this (and telling people about
>> "-mno-relax"), but apparently that was all just in my head.  Here's a patch to
>> add "-mno-relax" to GCC in the real world :)
>> https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00062.html
>>
>> I think the best thing to do is:
>>
>> * Check if the complier supports "-mno-relax" and add it to the module build
>>   command-line.
>> * Change R_RISCV_ALIGN support in the kernel to check if the address happens to
>>   already be aligned (which happens sometimes), and if it's not then provide a
>>   helpful error message along the lines of "upgrade to GCC 8".
>>
>> I guess we eventually want to support relaxation in the kernel, but only if
>> there's a real performance problem that someone can point out.
>
> OK, thanks! I'll look into that.
>
> Actually, other than the initial implementation cost, is there any
> potential *problem* with implementing relaxations? If I have time I
> might want to look into that just for my own education.

It might be a reasonable exercise but I'd rather not upstream it.

-mno-relax .o files ought to be order of 2x smaller, so assuming you
care about initramfs size we want to use that instead of complicating
the loader.

(I'd be interested in real numbers for a larger module, e.g. btrfs.)

-s



More information about the linux-riscv mailing list