diff options
author | 2018-04-02 20:43:14 -0700 | |
---|---|---|
committer | 2018-04-02 20:43:14 -0700 | |
commit | 7a8e7da42250138adf202ba2596ef7f68651060a (patch) | |
tree | 4b736dff3d2bd1b04fe7d6b1683350e6cc5f2df7 /arch/riscv/kernel/module.lds | |
parent | RISC-V: Assorted memory model fixes (diff) | |
parent | RISC-V: Add definition of relocation types (diff) | |
download | linux-dev-7a8e7da42250138adf202ba2596ef7f68651060a.tar.xz linux-dev-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/kernel/module.lds')
-rw-r--r-- | arch/riscv/kernel/module.lds | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/riscv/kernel/module.lds b/arch/riscv/kernel/module.lds new file mode 100644 index 000000000000..295ecfb341a2 --- /dev/null +++ b/arch/riscv/kernel/module.lds @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright (C) 2017 Andes Technology Corporation */ + +SECTIONS { + .plt (NOLOAD) : { BYTE(0) } + .got (NOLOAD) : { BYTE(0) } + .got.plt (NOLOAD) : { BYTE(0) } +} |