summaryrefslogtreecommitdiffstats
path: root/libelf/elf_compress_gnu.c
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/elf_compress_gnu.c')
-rw-r--r--libelf/elf_compress_gnu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libelf/elf_compress_gnu.c b/libelf/elf_compress_gnu.c
index 198dc7d5..1ecd6a08 100644
--- a/libelf/elf_compress_gnu.c
+++ b/libelf/elf_compress_gnu.c
@@ -144,9 +144,10 @@ elf_compress_gnu (Elf_Scn *scn, int inflate, unsigned int flags)
else if (inflate == 0)
{
/* In theory the user could have constucted a compressed section
- by hand. But we always just take the rawdata directly and
- decompress that. */
- Elf_Data *data = elf_rawdata (scn, NULL);
+ by hand. And in practice they do. For example when copying
+ a section from one file to another using elf_newdata. So we
+ have to use elf_getdata (not elf_rawdata). */
+ Elf_Data *data = elf_getdata (scn, NULL);
if (data == NULL)
return -1;