summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Chen <vincent.chen@sifive.com>2020-06-23 09:13:22 +0800
committerPalmer Dabbelt <palmerdabbelt@google.com>2020-06-25 14:58:59 -0700
commita0fc3b32893b29a7b3a2771b6d63bae16cb1e8de (patch)
treef5455993f728bb55c94a0ce60cd545c55bec35e5
parent48778464bb7d346b47157d21ffde2af6b2d39110 (diff)
riscv: Add -fPIC option to CFLAGS_vgettimeofday.o
The time related vDSO functions use a variable, vdso_data, to access the vDSO data page to get the system time information. Because the vdso_data for CFLAGS_vgettimeofday.o is an external variable defined in vdso.o, the CFLAGS_vgettimeofday.o should be compiled with -fPIC to ensure that vdso_data is addressable. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Vincent Chen <vincent.chen@sifive.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
-rw-r--r--arch/riscv/kernel/vdso/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
index 38ba55b0eb9d..29cf052f6541 100644
--- a/arch/riscv/kernel/vdso/Makefile
+++ b/arch/riscv/kernel/vdso/Makefile
@@ -17,7 +17,7 @@ vdso-syms += flush_icache
obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
ifneq ($(c-gettimeofday-y),)
- CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
+ CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
endif
# Build rules