1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/binutils/parse-config
3 # Copyright (C) 2007 - 2021 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; version 2 of the License. A copy of the
11 # GNU General Public License can be found in the file COPYING.
12 # --- T2-COPYRIGHT-NOTE-END ---
15 local tmp="$(mktemp)" # intermediate file
18 echo_status "Splitting debug information"
20 # guard against already existing debug files
21 grep -v "$SDECFG_DEBUG_PATH/.*[.]debug$" $builddir/flist.txt |
23 if [[ $SDECFG_DEBUG_PATH = /* ]]; then
24 local dbg="$root$SDECFG_DEBUG_PATH/$f.debug"
26 local dbg="$root/${f%/*}/$SDECFG_DEBUG_PATH/${f##*/}.debug"
29 # skip if not an object file
30 $OBJCOPY --only-keep-debug "$f" "$tmp" 2>/dev/null || continue
32 # create the debug destination dir
35 $OBJCOPY --strip-debug "$f"
36 $OBJCOPY --add-gnu-debuglink="$dbg" "$f"
44 if [ "$SDECFG_DEBUG" = 2 ]; then
45 hook_add postflist 5 split_debug