RFC: Add compressed debug section support to elfutils

H.J. Lu hjl.tools at gmail.com
Thu Mar 12 16:02:39 UTC 2015

I am working on fixing:


There are a couple issues with compressed debug section support
in elfutils:

1.libdw doesn't handle compressed debug sections with relocations.
check_section tries to handle compressed debug sections. But
It is too late since relocations have been applied already.
2. Dwarf debug section name handling is duplicated in both libdw
and libebl. ebl_debugscn_p is used to check for debug section.
But it doesn't handle compressed debug section wgile libdw does.

libelf doesn't handle DWARF debug sections and I am not if it
should handle them directly.  However, there is convert_data in
libelf, which seems to be an ideal place to handle compressed
debug sections.  We just need to add a hook to libelf to allow
libdw to decompress debug sections.  I propose to add

Elf *
__libelf_elf_begin (int fildes, Elf_Cmd cmd, Elf *ref,
                    char *(*convert_debug_data) (Elf_Scn *,
                                                 char *,
                                                 size_t *))

to libelf.  It will be a private function for libdw.  The full patch is at


Any comments?

I am not on this mailing list.  Please CC me on this topic.



More information about the elfutils-devel mailing list