2 # If using normal root, avoid changing anything.
3 if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
7 # Strip .comment and .note sections (the latter only if it is not allocated)
8 # for already stripped elf files in the build root
9 for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
10 grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
11 sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped/\1/p'`; do
13 if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
14 grep ALLOC >/dev/null; then
17 strip -R .comment $note $f || :