Changeset View
Changeset View
Standalone View
Standalone View
sys/conf/kern.post.mk
Show First 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | ${FULLKERNEL}: ${SYSTEM_DEP} vers.o | ||||
@echo linking ${.TARGET} | @echo linking ${.TARGET} | ||||
${SYSTEM_LD} | ${SYSTEM_LD} | ||||
.if !empty(MD_ROOT_SIZE_CONFIGURED) && defined(MFS_IMAGE) | .if !empty(MD_ROOT_SIZE_CONFIGURED) && defined(MFS_IMAGE) | ||||
@sh ${S}/tools/embed_mfs.sh ${.TARGET} ${MFS_IMAGE} | @sh ${S}/tools/embed_mfs.sh ${.TARGET} ${MFS_IMAGE} | ||||
.endif | .endif | ||||
.if ${MK_CTF} != "no" | .if ${MK_CTF} != "no" | ||||
@echo ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ... | @echo ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ... | ||||
@${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o | @${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SYSTEM_OBJS} vers.o | ||||
.if defined(SUNW_LOADABLE) | |||||
markj: How does this get set? Is it a kernel config option? Or is one expected to pass it on the… | |||||
Done Inline ActionsIt is set through a kernel config option - makeoptions SUNW_LOADABLE=1 bnovkov: It is set through a kernel config option -
```
makeoptions SUNW_LOADABLE=1
``` | |||||
@echo "Integrating .SUNW_ctf into the kernel" | |||||
# Dump merged ctf data | |||||
@${OBJCOPY} --set-section-flags .SUNW_ctf=alloc,load,readonly ${.TARGET} | |||||
@${OBJCOPY} -O binary -j ".SUNW_ctf" ${.TARGET} ctf.raw | |||||
# Create a temporary file to hold ctf data | |||||
@touch ctf.c | |||||
@${CC} -c ctf.c | |||||
@${OBJCOPY} --add-section .SUNW_ctf=ctf.raw ctf.o | |||||
@${OBJCOPY} --set-section-flags .SUNW_ctf=alloc,load,readonly ctf.o | |||||
# Re-link the kernel | |||||
@echo Re-linking ${.TARGET} | |||||
${SYSTEM_LD} ctf.o | |||||
.if !empty(MD_ROOT_SIZE_CONFIGURED) && defined(MFS_IMAGE) | |||||
@sh ${S}/tools/embed_mfs.sh ${.TARGET} ${MFS_IMAGE} | |||||
.endif | .endif | ||||
# Remove "old" .SUNW_ctf | |||||
@${OBJCOPY} -R ".SUNW_ctf" ${.TARGET} | |||||
# Rename loadable ctf section | |||||
@objcopy --rename-section .kern_SUNW_ctf=.SUNW_ctf ${.TARGET} | |||||
# Cleanup | |||||
@rm ctf.raw | |||||
@rm ctf.o | |||||
@rm ctf.c | |||||
.endif | |||||
.endif | |||||
Not Done Inline ActionsWith this approach, do we need to do any extra work for kernel modules? markj: With this approach, do we need to do any extra work for kernel modules? | |||||
Done Inline ActionsWe would need a bit of extra work, but this mostly boils down to slight ldscript modifications and adjusting the existing linker methods used for loading modules to load the section and unpack the data. This also wouldn't require any additional linker script symbols as we can load the section header string table. bnovkov: We would need a bit of extra work, but this mostly boils down to slight ldscript modifications… | |||||
Not Done Inline ActionsIt's rather ugly that this has to be repeated. Ditto for the kernel link. I don't have a better suggestion offhand though. markj: It's rather ugly that this has to be repeated. Ditto for the kernel link. I don't have a better… | |||||
.if !defined(DEBUG) | .if !defined(DEBUG) | ||||
${OBJCOPY} --strip-debug ${.TARGET} | ${OBJCOPY} --strip-debug ${.TARGET} | ||||
.endif | .endif | ||||
${SYSTEM_LD_TAIL} | ${SYSTEM_LD_TAIL} | ||||
OBJS_DEPEND_GUESS+= offset.inc assym.inc vnode_if.h ${BEFORE_DEPEND:M*.h} \ | OBJS_DEPEND_GUESS+= offset.inc assym.inc vnode_if.h ${BEFORE_DEPEND:M*.h} \ | ||||
${MFILES:T:S/.m$/.h/} | ${MFILES:T:S/.m$/.h/} | ||||
▲ Show 20 Lines • Show All 263 Lines • Show Last 20 Lines |
How does this get set? Is it a kernel config option? Or is one expected to pass it on the command line, as in make -DSUNW_LOADABLE buildkernel?