Correct module symbol export handling

EXPORT_SYMS can be set to YES, NO, a list of symbols to export from a
module, or to a filename containing such a list.  For the case that it
is set to a symbol list, replace spaces in the list with newlines, so
the created file is in the format expected by kmod_syms.awk.

Reviewed by:	imp, jhb
MFC after:	1 month
Sponsored by:	Turing Robotic Industries Inc.
Differential Revision:	https://reviews.freebsd.org/D14284
This commit is contained in:
Ed Maste 2018-02-16 15:38:02 +00:00
parent 219ff59ce2
commit b8283138cd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329373

View File

@ -243,14 +243,14 @@ ${FULLPROG}: ${OBJS}
.if ${EXPORT_SYMS} == NO
:> export_syms
.elif !exists(${.CURDIR}/${EXPORT_SYMS})
echo ${EXPORT_SYMS} > export_syms
echo -n "${EXPORT_SYMS:@s@$s${.newline}@}" > export_syms
.else
grep -v '^#' < ${EXPORT_SYMS} > export_syms
.endif
${AWK} -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET} \
export_syms | xargs -J% ${OBJCOPY} % ${.TARGET}
.endif
.endif
.endif # defined(EXPORT_SYMS)
.if defined(PREFIX_SYMS)
${AWK} -v prefix=${PREFIX_SYMS} -f ${SYSDIR}/conf/kmod_syms_prefix.awk \
${.TARGET} /dev/null | xargs -J% ${OBJCOPY} % ${.TARGET}