+2015-10-04 Mark Wielaard <mjw@redhat.com>
+
+ * strip.c (handle_elf): Only sanity check section symbols to not
+ kept discarded sections if we are creating a debug file.
+
2015-10-07 Mark Wielaard <mjw@redhat.com>
* unstrip.c (MAX): Removed.
shdr_info[cnt].shdr.sh_info = destidx - 1;
}
}
- else if (debug_fname == NULL
- || shdr_info[cnt].debug_data == NULL)
- /* This is a section or group signature symbol
+ else if (debug_fname != NULL
+ && shdr_info[cnt].debug_data == NULL)
+ /* The symbol points to a section that is discarded
+ but isn't preserved in the debug file. Check that
+ this is a section or group signature symbol
for a section which has been removed. */
{
size_t sidx = (sym->st_shndx != SHN_XINDEX
}
# Now strip in-place and make sure it is smaller.
-# Skip ET_REL files, they might have unexpected symbol table entries.
-is_ET_REL=0
-testrun ${abs_top_builddir}/src/readelf -h $original 2>&1 \
- | fgrep 'REL (Relocatable file)' && is_ET_REL=1
-if test $is_ET_REL -eq 0; then
- SIZE_original=$(stat -c%s $original)
- testrun ${abs_top_builddir}/src/strip $original
- SIZE_stripped=$(stat -c%s $original)
- test $SIZE_stripped -lt $SIZE_original ||
- { echo "*** failure in-place strip file not smaller $original"; status=1; }
-fi
+SIZE_original=$(stat -c%s $original)
+testrun ${abs_top_builddir}/src/strip $original
+SIZE_stripped=$(stat -c%s $original)
+test $SIZE_stripped -lt $SIZE_original ||
+ { echo "*** failure in-place strip file not smaller $original"; status=1; }
tempfiles testfile.sections
testrun ${abs_top_builddir}/src/readelf -S testfile.temp > testfile.sections || status=$?