Message ID | 20210606220940.2494315-1-raj.khem@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | riscv32: Use medany C model for modules | expand |
On Sun, 06 Jun 2021 15:09:40 PDT (-0700), Khem Raj wrote: > When CONFIG_CMODEL_MEDLOW is used it ends up generating riscv_hi20_rela > relocations in modules which are not resolved during runtime and > following errors would be seen > > [ 4.802714] virtio_input: target 00000000c1539090 can not be addressed by the 32-bit offset from PC = 39148b7b > [ 4.854800] virtio_input: target 00000000c1539090 can not be addressed by the 32-bit offset from PC = 9774456d > > Signed-off-by: Khem Raj <raj.khem@gmail.com> > Cc: Paul Walmsley <paul.walmsley@sifive.com> > Cc: Palmer Dabbelt <palmer@dabbelt.com> > Cc: Albert Ou <aou@eecs.berkeley.edu> > --- > arch/riscv/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile > index 4be020695428..99ecd8bcfd77 100644 > --- a/arch/riscv/Makefile > +++ b/arch/riscv/Makefile > @@ -16,7 +16,7 @@ ifeq ($(CONFIG_DYNAMIC_FTRACE),y) > CC_FLAGS_FTRACE := -fpatchable-function-entry=8 > endif > > -ifeq ($(CONFIG_64BIT)$(CONFIG_CMODEL_MEDLOW),yy) > +ifeq ($(CONFIG_CMODEL_MEDLOW),y) > KBUILD_CFLAGS_MODULE += -mcmodel=medany > endif Thanks, this is on fixes.
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 4be020695428..99ecd8bcfd77 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -16,7 +16,7 @@ ifeq ($(CONFIG_DYNAMIC_FTRACE),y) CC_FLAGS_FTRACE := -fpatchable-function-entry=8 endif -ifeq ($(CONFIG_64BIT)$(CONFIG_CMODEL_MEDLOW),yy) +ifeq ($(CONFIG_CMODEL_MEDLOW),y) KBUILD_CFLAGS_MODULE += -mcmodel=medany endif
When CONFIG_CMODEL_MEDLOW is used it ends up generating riscv_hi20_rela relocations in modules which are not resolved during runtime and following errors would be seen [ 4.802714] virtio_input: target 00000000c1539090 can not be addressed by the 32-bit offset from PC = 39148b7b [ 4.854800] virtio_input: target 00000000c1539090 can not be addressed by the 32-bit offset from PC = 9774456d Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Albert Ou <aou@eecs.berkeley.edu> --- arch/riscv/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)