HomeFreeBSD

libelf: add compression header support

Description

libelf: add compression header support

GNU and Oracle libelf implementations added support for section
compression, intended to reduce the size of DWARF debug info (which
might be an order of magnitude larger than the code).

There are two compressed ELF section formats:

  1. Old GNU - sections are renmaed to start with 'z'. Section contains a magic number, uncompressed size, and compressed data.
  1. Oracle and New GNU - compressed sections use the SHF_COMPRESSED flag. The compression header contains the compression type, uncompressed size, and uncompressed alignment.

The second style is preferred and this change implements only that one.

Submitted by: Tiger Gao <tig@FreeBSDFoundation.org>
Reviewed by: markj
MFC after: 2 weeks
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24566

Details

Provenance
emasteAuthored on
Reviewer
markj
Differential Revision
D24566: Add functions to get compression header for libelf
Parents
rS366976: cache: reduce memory waste in struct namecache
Branches
Unknown
Tags
Unknown