summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2013-04-05 20:16:40 +0000
committerchristos <christos@NetBSD.org>2013-04-05 20:16:40 +0000
commita76bb40ba80ac888d59e1bd32ba5581ed6ee9ee0 (patch)
tree42e92064affbd05543994006d71e80394ea1fc3a /libexec
parentfebdece622f881faee3158883c78cdcaa644ab63 (diff)
split debug info for rtld
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.elf_so/Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/libexec/ld.elf_so/Makefile b/libexec/ld.elf_so/Makefile
index fd6e5d120e9..f17bf45260a 100644
--- a/libexec/ld.elf_so/Makefile
+++ b/libexec/ld.elf_so/Makefile
@@ -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}