1 .\" SPDX-License-Identifier: BSD-2-Clause
3 .\" Copyright (c) 2020 The FreeBSD Foundation
5 .\" This document was written by Tiger Gao under sponsorship from
6 .\" the FreeBSD Foundation.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions are
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in
15 .\" the documentation and/or other materials provided with the distribution.
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" $Id: gelf_getchdr.3 3639 2020-10-20 16:07:02Z tig $
38 .Nd retrieve the compression header of a section
44 .Fn elf32_getchdr "Elf_Scn *s"
46 .Fn elf64_getchdr "Elf_Scn *s"
49 .Fn gelf_getchdr "Elf_Scn *scn" "GElf_Chdr *chdr"
51 These functions return a pointer to the ELF Compression Header data
52 structure associated with section descriptor
57 retrieves a pointer to an
62 must be associated with an ELF descriptor of class
67 retrieves a pointer to an
72 must be associated with an ELF descriptor of class
77 copies the values in the compression header associated with argument
79 to the structure pointed to be argument
83 data structure is described in
90 return a valid pointer to the appropriate compression header on success
91 or NULL if an error was encountered.
97 if successful, or NULL if an error was encountered.
99 These functions may fail with the following errors:
100 .Bl -tag -width "[ELF_E_RESOURCE]"
101 .It Bq Er ELF_E_INVALID_SECTION_FLAGS
105 .It Bq Er ELF_E_INVALID_SECTION_TYPE
109 .It Bq Er ELF_E_NOT_COMPRESSED