]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libelf: Always call ftruncate before posix_fallocate to set the right size.
authorMark Wielaard <mjw@redhat.com>
Tue, 16 Jun 2015 12:05:35 +0000 (14:05 +0200)
committerMark Wielaard <mjw@redhat.com>
Fri, 19 Jun 2015 10:16:41 +0000 (12:16 +0200)
commit0d01165e665fd51da69de1aebed64fdb5b5f04e1
tree2d80eacca5fff97203a8320402b0b4297e45e957
parente7a69d5d353e2366260c3b4e1f72978532167619
libelf: Always call ftruncate before posix_fallocate to set the right size.

When elf_update.c (write_file) doesn't know the current maximum file length
it might have to reduce the file size. posix_fallocate can only extend the
file. So always call ftruncate before that to set the file size and making
sure the backing store is fully there. Add test cases for checking strip
in place (eu-strip without -o) actually reduces the file size. But only
for non-ET_REL files. We might not be able to strip ET_REL files (except
when they are kernel modules) because they might contain "dangling" symbol
table entries.

https://bugzilla.redhat.com/show_bug.cgi?id=1232206

Signed-off-by: Mark Wielaard <mjw@redhat.com>
libelf/ChangeLog
libelf/elf_update.c
tests/ChangeLog
tests/run-strip-test.sh