radare2/libr/stripsyms.sh
pancake fe6cb8c378 Added '-' to create command aliases and lowercase i8080
Lowercase i8080 disassembler (use e asm.ucase=true)
Add Alexander in AUTHORS
Extend r_cmd api to support aliases
Add new '-' command to register and call command aliases
Use RList in RCmd instead of kernel's list.h
Autocomplete aliases with <tab>
Add 'make DEBUG=1' to compile with -g
Do not strip symbols when compiling in debug mode
2012-10-30 02:49:05 +01:00

25 lines
462 B
Bash

#!/bin/sh
[ -n "${NOSTRIP}" ] && exit 0
[ -z "$2" ] && exit 0
FILE=$1
PFX=$2
LIST=$1.list
if [ "${PFX}" = "r_util" ]; then
echo "=> No stripping any symbol in libr_util O:)"
exit 0
PFX="r_"
fi
nm --defined-only -B ${FILE} 2>/dev/null | grep -v ^${PFX}_ | awk '{print $3}' > ${LIST}
#if [ -n "`cat /tmp/list`" ]; then
echo "STRIP ${FILE}"
objcopy --strip-symbols ${LIST} ${FILE} 2>/dev/null
#TODO: Uncomment on release
#strip -s ${FILE}
#fi
rm -f ${LIST}