1 # SPDX-License-Identifier: GPL-2.0
2 obj-y
+= vsyscall.o vsyscall-syscall.o vsyscall-syms.o
4 $(obj
)/vsyscall-syscall.o
: \
5 $(foreach F
,trapa
,$(obj
)/vsyscall-
$F.so
)
7 # Teach kbuild about targets
8 targets
+= $(foreach F
,trapa
,vsyscall-
$F.o vsyscall-
$F.so
)
9 targets
+= vsyscall-note.o vsyscall.lds vsyscall-dummy.o
11 # The DSO images are built using a special linker script
12 quiet_cmd_syscall
= SYSCALL
$@
13 cmd_syscall
= $(CC
) -nostdlib
$(SYSCFLAGS_
$(@F
)) \
14 -Wl
,-T
,$(filter-out FORCE
,$^
) -o
$@
16 export CPPFLAGS_vsyscall.lds
+= -P
-C
-Ush
18 vsyscall-flags
= -shared
-s
-Wl
,-soname
=linux-gate.so
.1 \
19 $(call cc-ldoption
, -Wl
$(comma
)--hash-style
=sysv
)
21 SYSCFLAGS_vsyscall-trapa.so
= $(vsyscall-flags
)
23 $(obj
)/vsyscall-trapa.so
: \
24 $(obj
)/vsyscall-
%.so
: $(src
)/vsyscall.lds
$(obj
)/vsyscall-
%.o FORCE
25 $(call if_changed
,syscall
)
27 # We also create a special relocatable object that should mirror the symbol
28 # table and layout of the linked DSO. With ld -R we can then refer to
29 # these symbols in the kernel code rather than hand-coded addresses.
30 SYSCFLAGS_vsyscall-dummy.o
= -r
31 $(obj
)/vsyscall-dummy.o
: $(src
)/vsyscall.lds \
32 $(obj
)/vsyscall-trapa.o
$(obj
)/vsyscall-note.o FORCE
33 $(call if_changed
,syscall
)
35 LDFLAGS_vsyscall-syms.o
:= -r
-R
36 $(obj
)/vsyscall-syms.o
: $(obj
)/vsyscall-dummy.o FORCE