[Bug tools/21332] elflint doesn't handle compressed sections

2017-04-06 Thread rguenther at suse dot de
https://sourceware.org/bugzilla/show_bug.cgi?id=21332

--- Comment #8 from rguenther at suse dot de ---
On Wed, 5 Apr 2017, mark at klomp dot org wrote:

> https://sourceware.org/bugzilla/show_bug.cgi?id=21332
> 
> --- Comment #7 from Mark Wielaard  ---
> Turns out supporting (gabi) compressed ELF sections in eu-elflint is is fairly
> simple by just decompressing every section unconditionally at the start (when
> we also check if all sections are actually there):
> 
> diff --git a/src/elflint.c b/src/elflint.c
> index e0c65b6..51e53c2 100644
> --- a/src/elflint.c
> +++ b/src/elflint.c
> @@ -464,6 +466,9 @@ invalid number of section header table entries\n"));
> scn = elf_nextscn (ebl->elf, scn);
> if (scn == NULL)
>   break;
> +   /* If the section wasn't compressed this does nothing, but
> +  returns an error.  We don't care.  */
> +   elf_compress (scn, 0, 0);
>   }
>if (scnt < shnum)
>  ERROR (gettext ("Can only check %u headers, shnum was %u\n"), scnt,
> shnum);
> 
> Full patch plus testcases:
> https://sourceware.org/ml/elfutils-devel/2017-q2/msg00026.html
> 
> Would you be able to test that on your s390x setup?

A quick test shows that it works.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[Bug tools/21332] elflint doesn't handle compressed sections

2017-04-06 Thread mark at klomp dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=21332

Mark Wielaard  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Mark Wielaard  ---
(In reply to rguenther from comment #8)
> A quick test shows that it works.

Thanks.

commit caf135b7f49f9f3499c952b352493cf561ae12bd
Author: Mark Wielaard 
Date:   Wed Apr 5 17:09:27 2017 +0200

elflint: Support checking ELF files with compressed sections.

Simply unconditionally uncompress any section to make sure indexes between
sections check out. Add some testcases with various compressed sections.

https://sourceware.org/bugzilla/show_bug.cgi?id=21332

Signed-off-by: Mark Wielaard 

-- 
You are receiving this mail because:
You are on the CC list for the bug.