make unstack work on gcc-compiled binaries
This commit is contained in:
parent
9e075d8623
commit
cf89d27218
1 changed files with 9 additions and 1 deletions
|
@ -5,12 +5,20 @@ then echo "Usage: $0 <executable> [0x... [0x... ] ]"
|
|||
exit 1
|
||||
fi
|
||||
|
||||
PATH=$PATH:/usr/gnu/bin
|
||||
|
||||
if file $1 | grep NSYM >/dev/null 2>&1; then
|
||||
NM="gnm --radix=d"
|
||||
else
|
||||
NM="nm -d"
|
||||
fi
|
||||
|
||||
executable=$1
|
||||
shift
|
||||
|
||||
while [ $# -gt 0 ]
|
||||
do dec="`printf %d $1`"
|
||||
nm -d -n $executable | grep ' [Tt] ' | awk '
|
||||
$NM -n $executable | grep ' [Tt] ' | awk '
|
||||
{ if($1 > '$dec') { printf "%s+0x%x\n", name, '$dec'-offset; exit }
|
||||
name=$3; offset=$1
|
||||
}'
|
||||
|
|
Loading…
Reference in a new issue