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