]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libelf: add compression header support
authoremaste <emaste@FreeBSD.org>
Fri, 23 Oct 2020 16:35:23 +0000 (16:35 +0000)
committeremaste <emaste@FreeBSD.org>
Fri, 23 Oct 2020 16:35:23 +0000 (16:35 +0000)
commit8dafc9b00623807a860888d3ce63c4ca165c8f0d
tree7502ccc421ba47aa023438ddffdf6a99698a4f2c
parent862f5d35f6ac45403ce2becefbf665405cfb7491
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.

2. 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
contrib/elftoolchain/libelf/Version.map
contrib/elftoolchain/libelf/_libelf.h
contrib/elftoolchain/libelf/gelf.3
contrib/elftoolchain/libelf/gelf.h
contrib/elftoolchain/libelf/gelf_chdr.c [new file with mode: 0644]
contrib/elftoolchain/libelf/gelf_getchdr.3 [new file with mode: 0644]
contrib/elftoolchain/libelf/libelf.h
contrib/elftoolchain/libelf/libelf_chdr.c [new file with mode: 0644]
lib/libelf/Makefile