1 /*
2   Copyright (C) 2018 David Anderson  All Rights Reserved.
3 
4   This program is free software; you can redistribute it
5   and/or modify it under the terms of version 2.1 of the
6   GNU Lesser General Public License as published by the Free
7   Software Foundation.
8 
9   This program is distributed in the hope that it would be
10   useful, but WITHOUT ANY WARRANTY; without even the implied
11   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12   PURPOSE.
13 
14   Further, this software is distributed without any warranty
15   that it is free of the rightful claim of any third person
16   regarding infringement or the like.  Any license provided
17   herein, whether implied or otherwise, applies only to this
18   software file.  Patent licenses, if any, provided herein
19   do not apply to combinations of this program with other
20   software, or any other product whatsoever.
21 
22   You should have received a copy of the GNU Lesser General
23   Public License along with this program; if not, write the
24   Free Software Foundation, Inc., 51 Franklin Street - Fifth
25   Floor, Boston MA 02110-1301, USA.
26 
27 */
28 
29 /*  The numbers here are almost all 32 bits.
30     Not long  long ever.
31     In the public function interfaces we'll use Dwarf_Unsigned though,
32     for call consistency with everything else.
33     Here we use Dwarf_Unsigned to avoid having to
34     even know what is or is not 32 bits. */
35 
36 typedef Dwarf_Unsigned dn_type;
37 
38 struct Dwarf_P_Dnames_Head_s {
39     Dwarf_Unsigned dh_unit_length;
40     unsigned       dh_version;
41     dn_type dh_comp_unit_count;
42     dn_type dh_local_type_unit_count;
43     dn_type dh_foreign_type_unit_count;
44     dn_type dh_bucket_count;
45     dn_type dh_name_count;
46     dn_type dh_abbrev_table_size;
47     dn_type dh_augmentation_string_size;
48     const char *   dh_augmentation_string;
49 };
50 
51 struct Dwarf_P_Dnames_uarray_s {
52     dn_type  dne_allocated;
53     dn_type  dne_used;
54     dn_type  *dne_values;
55 };
56 struct Dwarf_P_Dnames_sarray_s {
57     dn_type     dne_allocated;
58     dn_type     dne_used;
59     Dwarf_Sig8 *dne_values;
60 };
61 
62 
63 struct Dwarf_P_Dnames_s {
64     Dwarf_Small dn_create_section;
65     struct Dwarf_P_Dnames_Head_s dn_header;
66     struct Dwarf_P_Dnames_uarray_s dn_cunit_offset;
67     struct Dwarf_P_Dnames_uarray_s dn_tunit_offset;
68     struct Dwarf_P_Dnames_sarray_s dn_sunit_sigs;
69 
70     struct Dwarf_P_Dnames_uarray_s dn_buckets;
71 
72     /* Hashes count applies to string offsets and entry offsets arrays too. */
73     struct Dwarf_P_Dnames_uarray_s dn_hashes;
74     struct Dwarf_P_Dnames_uarray_s dn_string_offsets;
75     struct Dwarf_P_Dnames_uarray_s dn_entry_pool;
76 
77     Dwarf_Small *dn_index_entry_pool;
78     Dwarf_Small  dn_index_entry_pool_size;
79     Dwarf_Small  dn_index_entry_pool_used;
80 
81 };
82