2 * Copyright (c) 2016 Martin Pieuchot <mpi@openbsd.org>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 * CTF ``Compact ANSI-C Type Format'' ABI header file.
22 unsigned short cth_magic;
23 unsigned char cth_version;
24 unsigned char cth_flags;
25 unsigned int cth_parlabel;
26 unsigned int cth_parname;
27 unsigned int cth_lbloff;
28 unsigned int cth_objtoff;
29 unsigned int cth_funcoff;
30 unsigned int cth_typeoff;
31 unsigned int cth_stroff;
32 unsigned int cth_strlen;
35 #define CTF_F_COMPRESS (1 << 0) /* zlib compression */
38 unsigned int ctl_label;
39 unsigned int ctl_typeidx;
43 unsigned int cts_name;
44 unsigned short cts_info;
49 #define cts_size _ST._size
50 #define cts_type _ST._type
54 unsigned short cta_contents;
55 unsigned short cta_index;
56 unsigned int cta_nelems;
60 unsigned int ctm_name;
61 unsigned short ctm_type;
62 unsigned short ctm_offset;
66 struct ctf_member _ctlm_member;
67 #define ctlm_name _ctlm_member.ctm_name
68 #define ctlm_type _ctlm_member.ctlm_type
69 #define ctlm_pad0 _ctlm_member.ctm_offset
70 unsigned int ctlm_offsethi;
71 unsigned int ctlm_offsetlo;
74 #define CTF_LSTRUCT_THRESH 8192
77 unsigned int cte_name;
81 #define CTF_MAGIC 0xcff1
84 #define CTF_MAX_NAME 0x7fffffff
85 #define CTF_STRTAB_0 0
86 #define CTF_STRTAB_1 1
89 * Name reference macro.
91 #define CTF_NAME_STID(n) ((n) >> 31)
92 #define CTF_NAME_OFFSET(n) ((n) & CTF_MAX_NAME)