Skip to content

Commit b163596

Browse files
chleroyzx2c4
authored andcommitted
powerpc/vdso32: Add crtsavres
Commit 08c18b6 ("powerpc/vdso32: Add missing _restgpr_31_x to fix build failure") added _restgpr_31_x to the vdso for gettimeofday, but the work on getrandom shows that we will need more of those functions. Remove _restgpr_31_x and link in crtsavres.o so that we get all save/restore functions when optimising the kernel for size. Signed-off-by: Christophe Leroy <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Acked-by: Michael Ellerman <[email protected]> Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent d175ee9 commit b163596

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

arch/powerpc/kernel/vdso/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ else
4343
endif
4444

4545
targets := $(obj-vdso32) vdso32.so.dbg vgettimeofday-32.o
46+
targets += crtsavres-32.o
4647
obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
4748
targets += $(obj-vdso64) vdso64.so.dbg vgettimeofday-64.o
4849
obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
@@ -68,14 +69,16 @@ targets += vdso64.lds
6869
CPPFLAGS_vdso64.lds += -P -C
6970

7071
# link rule for the .so file, .lds has to be first
71-
$(obj)/vdso32.so.dbg: $(obj)/vdso32.lds $(obj-vdso32) $(obj)/vgettimeofday-32.o FORCE
72+
$(obj)/vdso32.so.dbg: $(obj)/vdso32.lds $(obj-vdso32) $(obj)/vgettimeofday-32.o $(obj)/crtsavres-32.o FORCE
7273
$(call if_changed,vdso32ld_and_check)
7374
$(obj)/vdso64.so.dbg: $(obj)/vdso64.lds $(obj-vdso64) $(obj)/vgettimeofday-64.o FORCE
7475
$(call if_changed,vdso64ld_and_check)
7576

7677
# assembly rules for the .S files
7778
$(obj-vdso32): %-32.o: %.S FORCE
7879
$(call if_changed_dep,vdso32as)
80+
$(obj)/crtsavres-32.o: %-32.o: $(srctree)/arch/powerpc/lib/crtsavres.S FORCE
81+
$(call if_changed_dep,vdso32as)
7982
$(obj)/vgettimeofday-32.o: %-32.o: %.c FORCE
8083
$(call if_changed_dep,vdso32cc)
8184
$(obj-vdso64): %-64.o: %.S FORCE

arch/powerpc/kernel/vdso/gettimeofday.S

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,3 @@ V_FUNCTION_END(__kernel_clock_getres)
118118
V_FUNCTION_BEGIN(__kernel_time)
119119
cvdso_call __c_kernel_time call_time=1
120120
V_FUNCTION_END(__kernel_time)
121-
122-
/* Routines for restoring integer registers, called by the compiler. */
123-
/* Called with r11 pointing to the stack header word of the caller of the */
124-
/* function, just beyond the end of the integer restore area. */
125-
#ifndef __powerpc64__
126-
_GLOBAL(_restgpr_31_x)
127-
_GLOBAL(_rest32gpr_31_x)
128-
lwz r0,4(r11)
129-
lwz r31,-4(r11)
130-
mtlr r0
131-
mr r1,r11
132-
blr
133-
#endif

0 commit comments

Comments
 (0)