diff options
author | Palmer Dabbelt <palmer@sifive.com> | 2018-04-03 05:43:14 +0200 |
---|---|---|
committer | Palmer Dabbelt <palmer@sifive.com> | 2018-04-03 05:43:14 +0200 |
commit | 7a8e7da42250138adf202ba2596ef7f68651060a (patch) | |
tree | 4b736dff3d2bd1b04fe7d6b1683350e6cc5f2df7 /arch/riscv/Makefile | |
parent | RISC-V: Assorted memory model fixes (diff) | |
parent | RISC-V: Add definition of relocation types (diff) | |
download | linux-7a8e7da42250138adf202ba2596ef7f68651060a.tar.xz linux-7a8e7da42250138adf202ba2596ef7f68651060a.zip |
RISC-V: Fixes to module loading
This cleans up the module support that was commited earlier to work with
what's actually emitted from our GCC port as it lands upstream. Most of
the work here is adding new relocations to the kernel.
There's some limitations on module loading imposed by the kernel:
* The kernel doesn't support linker relaxation, which is necessary to
support R_RISCV_ALIGN. In order to get reliable module building
you're going to need to a GCC that supports the new '-mno-relax',
which IIRC isn't going to be out until 8.1.0. It's somewhat unlikely
that R_RISCV_ALIGN will appear in a module even without '-mno-relax'
support, so issues shouldn't be common.
* There is no large code model for RISC-V, which means modules must be
loaded within a 32-bit signed offset of the kernel. We don't
currently have any mechanism for ensuring this memory remains free or
moving pages around, so issues here might be common.
I fixed a singcle merge conflict in arch/riscv/kernel/Makefile.
Diffstat (limited to 'arch/riscv/Makefile')
-rw-r--r-- | arch/riscv/Makefile | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 899226e0da7d..76e958a5414a 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -59,6 +59,11 @@ endif ifeq ($(CONFIG_CMODEL_MEDANY),y) KBUILD_CFLAGS += -mcmodel=medany endif +ifeq ($(CONFIG_MODULE_SECTIONS),y) + KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/riscv/kernel/module.lds +endif + +KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-relax) # GCC versions that support the "-mstrict-align" option default to allowing # unaligned accesses. While unaligned accesses are explicitly allowed in the |