GNU-Style Section Compression

In addition to the compression format discussed previously, the Oracle Solaris link-editor understands an alternative format used by the GNU tool chain. This format does not employ a section flag to indicate compression. Instead, a section name that starts with the .zdebug prefix identifies a section containing compressed data. GNU-style compressed sections start with the following compression header structure.

typedef struct {
        uchar_t         gch_magic[4];
        uchar_t         gch_size[8];
} Chdr_GNU;
gch_magic

A 4-byte magic number identifying the compression algorithm. At this time, only ZLIB compression is supported. The values of gch_magic for ZLIB compression is as listed in Table 14-11.

gch_size

The size in bytes of the uncompressed data, encoded as a 64-bit ELFDATA2MSB big endian integer value.

Table 14-11 GNU ZLIB Compression, gch_magic

Name Value

gch_magic[0]

'Z'

gch_magic[1]

'L'

gch_magic[2]

'I'

gch_magic[3]

'B'