From 9e0f2a9fb1fa37796909ab6dd8a1fcb9c371f78f Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Mon, 20 Mar 2000 01:29:59 +0000 Subject: [PATCH] Use an intermediate file containing the module binary before converting it into a ``shared'' .ko file. This intermediate file can be directly linked into a static kernel. This isn't all that useful yet but will become much more interesting shortly. --- share/mk/bsd.kmod.mk | 11 +++++++---- sys/conf/kmod.mk | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/share/mk/bsd.kmod.mk b/share/mk/bsd.kmod.mk index aa6e97b638f4..3cafc330dcba 100644 --- a/share/mk/bsd.kmod.mk +++ b/share/mk/bsd.kmod.mk @@ -131,14 +131,17 @@ OBJS+= ${SRCS:N*.h:R:S/$/.o/g} PROG= ${KMOD}.ko .endif -${PROG}: ${OBJS} ${DPADD} ${KMODDEPS} +${PROG}: ${KMOD}.kld ${KMODDEPS} + ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld ${KMODDEPS} + +${KMOD}.kld: ${OBJS} .if ${OBJFORMAT} == elf gensetdefs ${OBJS} ${CC} ${CFLAGS} -c setdef0.c ${CC} ${CFLAGS} -c setdef1.c - ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} setdef0.o ${OBJS} setdef1.o ${KMODDEPS} + ${LD} ${LDFLAGS} -r -o ${.TARGET} setdef0.o ${OBJS} setdef1.o .else - ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${OBJS} ${KMODDEPS} + ${LD} ${LDFLAGS} -r -o ${.TARGET} ${OBJS} .endif .if defined(KMODDEPS) @@ -193,7 +196,7 @@ ${_ILINKS}: ${ECHO} ${.TARGET} "->" $$path ; \ ln -s $$path ${.TARGET} -CLEANFILES+= ${PROG} ${OBJS} ${_ILINKS} symb.tmp tmp.o +CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS} ${_ILINKS} symb.tmp tmp.o .if !target(install) .if !target(beforeinstall) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index aa6e97b638f4..3cafc330dcba 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -131,14 +131,17 @@ OBJS+= ${SRCS:N*.h:R:S/$/.o/g} PROG= ${KMOD}.ko .endif -${PROG}: ${OBJS} ${DPADD} ${KMODDEPS} +${PROG}: ${KMOD}.kld ${KMODDEPS} + ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld ${KMODDEPS} + +${KMOD}.kld: ${OBJS} .if ${OBJFORMAT} == elf gensetdefs ${OBJS} ${CC} ${CFLAGS} -c setdef0.c ${CC} ${CFLAGS} -c setdef1.c - ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} setdef0.o ${OBJS} setdef1.o ${KMODDEPS} + ${LD} ${LDFLAGS} -r -o ${.TARGET} setdef0.o ${OBJS} setdef1.o .else - ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${OBJS} ${KMODDEPS} + ${LD} ${LDFLAGS} -r -o ${.TARGET} ${OBJS} .endif .if defined(KMODDEPS) @@ -193,7 +196,7 @@ ${_ILINKS}: ${ECHO} ${.TARGET} "->" $$path ; \ ln -s $$path ${.TARGET} -CLEANFILES+= ${PROG} ${OBJS} ${_ILINKS} symb.tmp tmp.o +CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS} ${_ILINKS} symb.tmp tmp.o .if !target(install) .if !target(beforeinstall)