2014-06-27

Slitaz -- strip


1.
tux@slitaz:~$ strip --help
[..]
  -s --strip-all                   Remove all symbol and relocation information
  -g -S -d --strip-debug           Remove all debugging symbols & sections
     --only-keep-debug             Strip everything but the debug information
  -K --keep-symbol=<name>          Do not strip symbol <name>
     --keep-file-symbols           Do not strip file symbol(s)


2.
tux@slitaz:~$ grep -A 15 'strip_package()' /usr/bin/cook
strip_package() {
    case "$ARCH" in
        arm|x86_64) export STRIP=${HOST_SYSTEM}-strip ;;
        *) export STRIP=strip ;;
    esac
    gettext "Executing strip on all files..."
    for dir in $fs/bin $fs/sbin $fs/usr/bin $fs/usr/sbin $fs/usr/games
    do
        if [ -d "$dir" ]; then
            find $dir -type f -exec $STRIP -s '{}' 2>/dev/null \;
        fi
    done
    find $fs -name "*.so*" -exec $STRIP -s '{}' 2>/dev/null \;
    find $fs -name "*.a" -exec $STRIP --strip-debug '{}' 2>/dev/null \;
    status

tux@slitaz:~$


3.
tux@slitaz:~$ grep strip /usr/bin/cross
        find $tools/bin -type f -exec strip -s '{}' 2>/dev/null \;
        find $tools/lib -name cc1* -exec strip -s '{}' 2>/dev/null \;
        find $tools/lib -name lto* -exec strip -s '{}' 2>/dev/null \;
        find $sysroot -name "*.so*" -exec ${TARGET}-strip -s '{}' 2>/dev/null \;
tux@slitaz:~$