Changeset 2625

Show
Ignore:
Timestamp:
05/23/07 13:58:20 (2 years ago)
Author:
tg
Message:

scan for statically linked executables too

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freewrt/scripts/rstrip.sh

    r2596 r2625  
    2323 
    2424find $TARGETS -type f -a -exec file {} \; | \ 
    25     sed -n -e 's/^\(.*\):.*ELF.*\(executable\|relocatable\|shared object\).*, not stripped/\1:\2/p' | 
    26     while IFS=: read F S; do 
     25    while IFS= read -r line; do 
     26        F=${line%%:*} 
     27        V=${F##*/fake-+([!/])/} 
    2728        T="${prefix}strip -R .comment" 
    28         if [[ $F = */lib/modules/2.*.@(o|ko) ]]; then 
    29                 S="kernel module $S" 
     29        case $line in 
     30        *ELF*executable*statically\ linked*) 
     31                echo >&2 "$SELF: *WARNING* '$V' is not dynamically linked!" 
     32                ;; 
     33        esac 
     34        case $line in 
     35        *ELF*executable*,\ not\ stripped*) 
     36                S=executable ;; 
     37        */lib/modules/2.*.o:*ELF*relocatable*,\ not\ stripped* | \ 
     38        */lib/modules/2.*.ko:*ELF*relocatable*,\ not\ stripped*) 
    3039                # kernel module parametres must not be stripped off 
    3140                T="$T --strip-unneeded $(echo $(${prefix}nm $F | \ 
    3241                    sed -n -e '/__param_/s/^.*__param_/-K /p' \ 
    3342                    -e '/__module_parm_/s/^.*__module_parm_/-K /p'))" 
    34         fi 
    35         echo "$SELF: $F:$S" 
    36         # The following line intentionally left in to prove 
    37         # to n0-1@ that I do test my changes… yes it works. 
    38         #echo "D: $T $F" 
     43                S='kernel module' ;; 
     44        *ELF*relocatable*,\ not\ stripped*) 
     45                S=relocatable ;; 
     46        *ELF*shared\ object*,\ not\ stripped*) 
     47                S='shared object' ;; 
     48        *) 
     49                continue ;; 
     50        esac 
     51        echo "$SELF: $V:$S" 
    3952        eval "$T $F" 
    4053done