[PATCH 1/9] RISC-V: Build non position-independent modules.

Shea Levy shea at shealevy.com
Thu Feb 22 19:12:10 PST 2018


The relocations we have to handle for no-PIC are much simpler, and we
can't take advantage of GOT/PLT sharing anyway.

Signed-off-by: Shea Levy <shea at shealevy.com>
---
 arch/riscv/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 26892daefa05..e0b04a0b5b82 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -11,8 +11,8 @@
 LDFLAGS         :=
 OBJCOPYFLAGS    := -O binary
 LDFLAGS_vmlinux :=
-KBUILD_AFLAGS_MODULE += -fPIC
-KBUILD_CFLAGS_MODULE += -fPIC
+KBUILD_AFLAGS_MODULE += -fno-PIC -mcmodel=medany
+KBUILD_CFLAGS_MODULE += -fno-PIC -mcmodel=medany
 
 KBUILD_DEFCONFIG = defconfig
 
-- 
2.16.1




More information about the linux-riscv mailing list