Skip to content

Commit

Permalink
riscv: Add -fPIC option to CFLAGS_vgettimeofday.o
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vincent Chen authored and Palmer Dabbelt committed Jun 25, 2020
1 parent 4877846 commit a0fc3b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/riscv/kernel/vdso/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a0fc3b3

Please sign in to comment.