博客地址:http://home.cnblogs.com/u/zengjianrong/

关于strip

strip两种方式:

1. 编译完成后手动strip;

2. 通过编译flags:"-s"直接strip;

 

方式一循环strip脚本:

#!/bin/bash
STRIP_CMD="strip"
function read_dir(){
    for file in `ls $1`
    do
        local path=$1"/"$file 
        if [ -d ${path} ]
        then
            echo "Enter ${path}."
            read_dir ${path}
            echo "Leave ${path}."
        else
            file ${path}  | grep ", not stripped" >/dev/null 2>&1
            if [ $? == 0 ]; then
                echo "Strip for ${path}"
                ${STRIP_CMD} ${path}
            fi
        fi

    done
}

if [ $# -ne 1 ]; then
    echo "Usage: $0 path"
    exit 1
fi
read_dir $1

 

posted @ 2022-11-08 14:06  black_man  阅读(55)  评论(0编辑  收藏  举报