=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ctfconv/ctfstrip,v retrieving revision 1.11 retrieving revision 1.12 diff -c -r1.11 -r1.12 *** src/usr.bin/ctfconv/ctfstrip 2019/05/27 09:31:08 1.11 --- src/usr.bin/ctfconv/ctfstrip 2019/10/15 10:27:25 1.12 *************** *** 1,6 **** #!/bin/sh # ! # $OpenBSD: ctfstrip,v 1.11 2019/05/27 09:31:08 jca Exp $ # # Copyright (c) 2017 Martin Pieuchot # --- 1,6 ---- #!/bin/sh # ! # $OpenBSD: ctfstrip,v 1.12 2019/10/15 10:27:25 mpi Exp $ # # Copyright (c) 2017 Martin Pieuchot # *************** *** 53,64 **** LABEL=`what "$INFILE" | sed -n '$s/^ //p'` fi ! # If ctfstrip was passed a file that lacks useful debug sections, ctfconv will fail. ! # So try to run ctfconv and silently fallback to plain strip(1) if that failed. ctfconv -o ${TMPFILE} -l "${LABEL}" "${INFILE}" 2> /dev/null if [ $? -eq 0 ]; then ! objcopy --add-section .SUNW_ctf=${TMPFILE} ${STRIPFLAG} "${INFILE}" ${OUTFILE} else strip ${STRIPFLAG} ${OUTFILE:+"-o${OUTFILE}"} "${INFILE}" fi --- 53,71 ---- LABEL=`what "$INFILE" | sed -n '$s/^ //p'` fi ! # If ctfstrip was passed a file that lacks useful debug sections, ctfconv will ! # fail. So try to run ctfconv and silently fallback to plain strip(1) if that ! # failed. ctfconv -o ${TMPFILE} -l "${LABEL}" "${INFILE}" 2> /dev/null if [ $? -eq 0 ]; then ! objcopy ${STRIPFLAG} \ ! --add-section .SUNW_ctf=${TMPFILE} "${INFILE}" ${OUTFILE} ! ! # Also add CTF data to the debug kernel ! if [ -z "${INFILE##bsd.gdb}" ]; then ! objcopy --add-section .SUNW_ctf=${TMPFILE} "${INFILE}" ! fi else strip ${STRIPFLAG} ${OUTFILE:+"-o${OUTFILE}"} "${INFILE}" fi