[Request for help] issue when add relative extable support to riscv64
Jisheng Zhang
jszhang3 at mail.ustc.edu.cn
Sat Sep 18 07:20:48 PDT 2021
On Sat, 18 Sep 2021 09:23:48 +0800
Kefeng Wang <wangkefeng.wang at huawei.com> wrote:
> On 2021/9/18 0:26, Jisheng Zhang wrote:
> > On Fri, 17 Sep 2021 23:57:33 +0800 Jisheng Zhang wrote:
> >
> >> Hi,
> >>
> >> Now the extable entry contains 16bytes for riscv64 -- 8bytes for the insn and
> >> another 8bytes for the fixup. This wastes mem a bit. I think we can add
> >> the relative extable support. A draft patch put at the end of this mail. But
> >> I met abnormal build errors:
> >>
> >> FATAL: modpost: The relocation at __ex_table+0x0 references
> >> section "__ex_table" which is not executable, IOW
> >> it is not possible for the kernel to fault
> >> at that address. Something is seriously wrong
> >> and should be fixed.
>
> I try this before, and meet the same issue, and add norelax to the label,
>
> but it won't fix the error. seems that we con't find the lable from the
> text?
I also tried adding --no-relax to LDFLAGS and -mno-relax to AFLAGS and CFLAGS
but still met the error. This is an insteresting issue.
Thanks
>
>
> 82 index 1b00badb9f87..cb1aca8e8a23 100644
> 83 --- a/arch/riscv/include/asm/futex.h
> 84 +++ b/arch/riscv/include/asm/futex.h
> 85 @@ -23,17 +23,18 @@
> 86 uintptr_t tmp; \
> 87 __enable_user_access(); \
> 88 __asm__ __volatile__ ( \
> 89 + " .option push \n" \
> 90 + " .option norelax \n" \
> 91 + " .option norvc \n" \
> 92 "1: " insn " \n" \
> 93 + " .option pop \n" \
> 94 "2: \n" \
>
>
>
More information about the linux-riscv
mailing list