Changeset 30662


Ignore:
Timestamp:
2012-02-20T18:38:26+01:00 (4 years ago)
Author:
nbd
Message:

strip kernel modules more aggressively: make all global symbols local, rename all symbols in the symbol table to make them compress better

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/rules.mk

    r30556 r30662  
    220220  endif 
    221221  RSTRIP:= \ 
     222    export CROSS="$(TARGET_CROSS)"; \ 
    222223    NM="$(TARGET_CROSS)nm" \ 
    223224    STRIP="$(STRIP)" \ 
    224     STRIP_KMOD="$(TARGET_CROSS)strip --strip-unneeded -R .comment -R .pdr -R .mdebug.abi32 -R .note.gnu.build-id -R .gnu.attributes -R .reginfo -x" \ 
     225    STRIP_KMOD="$(SCRIPT_DIR)/strip-kmod.sh" \ 
    225226    $(SCRIPT_DIR)/rstrip.sh 
    226227endif 
  • trunk/scripts/rstrip.sh

    r15312 r30662  
    66# See /LICENSE for more information. 
    77# 
    8  
    9 find_modparams() { 
    10         FILE="$1" 
    11         $NM "$FILE" | awk ' 
    12 BEGIN { 
    13         FS=" " 
    14 } 
    15 ($3 ~ /^__module_parm_/) && ($3 !~ /^__module_parm_desc/) { 
    16         gsub(/__module_parm_/, "", $3) 
    17         printf "-K " $3 " " 
    18 } 
    19 ($2 ~ /r/) && ($3 ~ /__param_/) { 
    20         gsub(/__param_/, "", $3) 
    21         printf "-K " $3 " " 
    22 } 
    23 ' 
    24 } 
    25  
    26  
    278SELF=${0##*/} 
    289 
     
    4728    echo "$SELF: $F:$S" 
    4829        [ "${S}" = "relocatable" ] && { 
    49                 eval "$STRIP_KMOD -w -K '__param*' -K '__mod*' $(find_modparams "$F")$F" 
     30                eval "$STRIP_KMOD $F" 
    5031        } || { 
    5132                b=$(stat -c '%a' $F) 
Note: See TracChangeset for help on using the changeset viewer.