version 1.7, 2017/08/14 20:09:17 |
version 1.8, 2017/08/15 15:48:10 |
|
|
-S) STRIPFLAG=-g; shift; continue;; |
-S) STRIPFLAG=-g; shift; continue;; |
esac |
esac |
shift |
shift |
set -- "$@" "$INFILE" |
set -- "$@" "$arg" |
INFILE="$arg" |
INFILE="$arg" |
done |
done |
|
|
|
|
|
|
# Extract kernel version |
# Extract kernel version |
if [ -z "${INFILE##bsd*}" ]; then |
if [ -z "${INFILE##bsd*}" ]; then |
LABEL=`what $INFILE | sed -n '$s/^ //p'` |
LABEL=`what "$INFILE" | sed -n '$s/^ //p'` |
fi |
fi |
|
|
# If ctfstrip was passed a file that lacks useful debug sections, ctfconv will fail. |
# 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. |
# So try to run ctfconv and silently fallback to plain strip(1) if that failed. |
ctfconv -o ${TMPFILE} -l "${LABEL}" ${INFILE} 2> /dev/null |
ctfconv -o ${TMPFILE} -l "${LABEL}" "${INFILE}" 2> /dev/null |
|
|
if [ $? -eq 0 ]; then |
if [ $? -eq 0 ]; then |
objcopy --add-section .SUNW_ctf=${TMPFILE} ${STRIPFLAG} ${INFILE} ${OUTFILE} |
objcopy --add-section .SUNW_ctf=${TMPFILE} ${STRIPFLAG} "${INFILE}" "${OUTFILE}" |
else |
else |
strip ${STRIPFLAG} $@ -o ${OUTFILE} ${INFILE} |
strip ${STRIPFLAG} -o "${OUTFILE}" "$@" |
fi |
fi |
|
|
rm -f ${TMPFILE} |
rm -f ${TMPFILE} |