split debug info for rtld

This commit is contained in:
christos 2013-04-05 20:16:40 +00:00
parent 644dcf797e
commit f903624708
1 changed files with 11 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.114 2012/08/23 21:21:15 joerg Exp $
# $NetBSD: Makefile,v 1.115 2013/04/05 20:16:40 christos Exp $
#
# NOTE: when changing ld.so, ensure that ldd still compiles.
#
@ -129,9 +129,19 @@ STRIPFLAG=
.PATH: $M
${PROG}: ${OBJS} ${DPADD}
${_MKMSG_LINK} ${PROG}
${CC} ${LDFLAGS} -o ${PROG} ${OBJS} ${LDADD}
.if ${MKDEBUG} != "no"
( ${OBJCOPY} --only-keep-debug ${.TARGET} ${.TARGET}.debug \
&& ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
--add-gnu-debuglink=${.TARGET}.debug ${.TARGET} \
) || (rm -f ${.TARGET}.debug; false)
_PROGDEBUG.${PROG} := ${PROG}.debug
.endif
.if ${SHLINKINSTALLDIR} != "/usr/libexec"
SYMLINKS+= ${SHLINKINSTALLDIR}/${PROG} /usr/libexec/${PROG}