Comment 32 for bug 1567219

Revision history for this message
In , Aleksandar-rikalo (aleksandar-rikalo) wrote :

Thank you for suggestions.

I've prepared few patches:

ElfXX_Chdr-build-fixup.diff - tinfl is moved to m_debuginfo, checking for Elf32/64_Chdr structs is placed into "configure" and line endings in tinfl.c are converted to Unix style.

Elf32/64_Chdr, SHF_COMPRESSED and ELFCOMPRESS_ZLIB come from libc (<elf.h>) and exist only in newer versions of libc. These structures/constants are not present in Kernel, so I didn't move them to vki. We can place them to separate header or pub_tool_libcbase.h, if you think it's more appropriate.

zdebug-support.diff - support for .zdebug sections is added to readelf.c.

Three kinds of compressed debug sections are supported by Binutils 2.26 (zlib, zlib-gnu and zlib-gabi) and I have tested Valgrind with all of them on MIPS/X86 Linux.

According to the manual (https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html), GCC should support -gz=zlib and -gz=zlib-gnu options for generating compressed debug sections, but I haven't succeeded to set up the environment in which it works. I've written two simple Memchek tests (compressed_sections_test.diff) which use these options, but they are not tested properly.

The order of applying patches (after applying compressed-dwarf-support.diff and tinfl-modifications.diff) :

patch -p1 < ElfXX_Chdr-build-fixup.diff
patch -p1 < zdebug-support.diff
patch -p1 < compressed_sections_test.diff