blob: 4bbce1cfa359991511127b6f53a3f58e2522f1d9 [file] [log] [blame]
obj-y += vsyscall.o vsyscall-syscall.o
$(obj)/vsyscall-syscall.o: \
$(foreach F,trapa,$(obj)/vsyscall-$
# Teach kbuild about targets
targets += $(foreach F,trapa,vsyscall-$F.o vsyscall-$
targets += vsyscall-note.o
# The DSO images are built using a special linker script
quiet_cmd_syscall = SYSCALL $@
cmd_syscall = $(CC) -nostdlib $(SYSCFLAGS_$(@F)) \
-Wl,-T,$(filter-out FORCE,$^) -o $@
export += -P -C -Ush
vsyscall-flags = -shared -s -Wl, \
$(call ld-option, -Wl$(comma)--hash-style=sysv) = $(vsyscall-flags)
$(obj)/ \
$(obj)/ $(src)/ $(obj)/vsyscall-%.o FORCE
$(call if_changed,syscall)
# We also create a special relocatable object that should mirror the symbol
# table and layout of the linked DSO. With ld -R we can then refer to
# these symbols in the kernel code rather than hand-coded addresses.
extra-y += vsyscall-syms.o
$(obj)/built-in.o: $(obj)/vsyscall-syms.o
$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
SYSCFLAGS_vsyscall-syms.o = -r
$(obj)/vsyscall-syms.o: $(src)/ \
$(obj)/vsyscall-trapa.o $(obj)/vsyscall-note.o FORCE
$(call if_changed,syscall)