Module Name: src
Committed By: christos
Date: Fri Apr 5 20:16:40 UTC 2013
Modified Files:
src/libexec/ld.elf_so: Makefile
Log Message:
split debug info for rtld
To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/libexec/ld.elf_so/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/libexec/ld.elf_so/Makefile
diff -u src/libexec/ld.elf_so/Makefile:1.114 src/libexec/ld.elf_so/Makefile:1.115
--- src/libexec/ld.elf_so/Makefile:1.114 Thu Aug 23 17:21:15 2012
+++ src/libexec/ld.elf_so/Makefile Fri Apr 5 16:16:40 2013
@@ -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}