diff options
Diffstat (limited to 'arch/sh/kernel/vsyscall/Makefile')
-rw-r--r-- | arch/sh/kernel/vsyscall/Makefile | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile new file mode 100644 index 000000000000..4bbce1cfa359 --- /dev/null +++ b/arch/sh/kernel/vsyscall/Makefile | |||
@@ -0,0 +1,36 @@ | |||
1 | obj-y += vsyscall.o vsyscall-syscall.o | ||
2 | |||
3 | $(obj)/vsyscall-syscall.o: \ | ||
4 | $(foreach F,trapa,$(obj)/vsyscall-$F.so) | ||
5 | |||
6 | # Teach kbuild about targets | ||
7 | targets += $(foreach F,trapa,vsyscall-$F.o vsyscall-$F.so) | ||
8 | targets += vsyscall-note.o vsyscall.lds | ||
9 | |||
10 | # The DSO images are built using a special linker script | ||
11 | quiet_cmd_syscall = SYSCALL $@ | ||
12 | cmd_syscall = $(CC) -nostdlib $(SYSCFLAGS_$(@F)) \ | ||
13 | -Wl,-T,$(filter-out FORCE,$^) -o $@ | ||
14 | |||
15 | export CPPFLAGS_vsyscall.lds += -P -C -Ush | ||
16 | |||
17 | vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \ | ||
18 | $(call ld-option, -Wl$(comma)--hash-style=sysv) | ||
19 | |||
20 | SYSCFLAGS_vsyscall-trapa.so = $(vsyscall-flags) | ||
21 | |||
22 | $(obj)/vsyscall-trapa.so: \ | ||
23 | $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE | ||
24 | $(call if_changed,syscall) | ||
25 | |||
26 | # We also create a special relocatable object that should mirror the symbol | ||
27 | # table and layout of the linked DSO. With ld -R we can then refer to | ||
28 | # these symbols in the kernel code rather than hand-coded addresses. | ||
29 | extra-y += vsyscall-syms.o | ||
30 | $(obj)/built-in.o: $(obj)/vsyscall-syms.o | ||
31 | $(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o | ||
32 | |||
33 | SYSCFLAGS_vsyscall-syms.o = -r | ||
34 | $(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \ | ||
35 | $(obj)/vsyscall-trapa.o $(obj)/vsyscall-note.o FORCE | ||
36 | $(call if_changed,syscall) | ||