xref: /titanic_44/usr/src/tools/ctf/dwarf/common/dwarf_opaque.h (revision 07dc1947c362e187fb955d283b692f8769dd5def)
149d3bc91SRichard Lowe /*
249d3bc91SRichard Lowe 
3*07dc1947SRichard Lowe   Copyright (C) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
4*07dc1947SRichard Lowe   Portions Copyright (C) 2007-2010 David Anderson. All Rights Reserved.
5*07dc1947SRichard Lowe   Portions Copyright (C) 2008-2010 Arxan Technologies, Inc. All Rights Reserved.
649d3bc91SRichard Lowe 
749d3bc91SRichard Lowe   This program is free software; you can redistribute it and/or modify it
849d3bc91SRichard Lowe   under the terms of version 2.1 of the GNU Lesser General Public License
949d3bc91SRichard Lowe   as published by the Free Software Foundation.
1049d3bc91SRichard Lowe 
1149d3bc91SRichard Lowe   This program is distributed in the hope that it would be useful, but
1249d3bc91SRichard Lowe   WITHOUT ANY WARRANTY; without even the implied warranty of
1349d3bc91SRichard Lowe   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1449d3bc91SRichard Lowe 
1549d3bc91SRichard Lowe   Further, this software is distributed without any warranty that it is
1649d3bc91SRichard Lowe   free of the rightful claim of any third person regarding infringement
1749d3bc91SRichard Lowe   or the like.  Any license provided herein, whether implied or
1849d3bc91SRichard Lowe   otherwise, applies only to this software file.  Patent licenses, if
1949d3bc91SRichard Lowe   any, provided herein do not apply to combinations of this program with
2049d3bc91SRichard Lowe   other software, or any other product whatsoever.
2149d3bc91SRichard Lowe 
2249d3bc91SRichard Lowe   You should have received a copy of the GNU Lesser General Public
2349d3bc91SRichard Lowe   License along with this program; if not, write the Free Software
24*07dc1947SRichard Lowe   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
2549d3bc91SRichard Lowe   USA.
2649d3bc91SRichard Lowe 
27*07dc1947SRichard Lowe   Contact information:  Silicon Graphics, Inc., 1500 Crittenden Lane,
2849d3bc91SRichard Lowe   Mountain View, CA 94043, or:
2949d3bc91SRichard Lowe 
3049d3bc91SRichard Lowe   http://www.sgi.com
3149d3bc91SRichard Lowe 
3249d3bc91SRichard Lowe   For further information regarding this notice, see:
3349d3bc91SRichard Lowe 
3449d3bc91SRichard Lowe   http://oss.sgi.com/projects/GenInfo/NoticeExplan
3549d3bc91SRichard Lowe 
3649d3bc91SRichard Lowe */
37*07dc1947SRichard Lowe /* The versions applicable by section are:
38*07dc1947SRichard Lowe                        DWARF2 DWARF3 DWARF4
39*07dc1947SRichard Lowe  .debug_abbrev           -      -      -
40*07dc1947SRichard Lowe  .debug_aranges          2      2      2
41*07dc1947SRichard Lowe  .debug_frame            1      3      4
42*07dc1947SRichard Lowe  .debug_info             2      3      4
43*07dc1947SRichard Lowe  .debug_line             2      3      4
44*07dc1947SRichard Lowe  .debug_loc              -      -      -
45*07dc1947SRichard Lowe  .debug_macinfo          -      -      -
46*07dc1947SRichard Lowe  .debug_pubtypes         x      2      2
47*07dc1947SRichard Lowe  .debug_pubnames         2      2      2
48*07dc1947SRichard Lowe  .debug_ranges           x      -      -
49*07dc1947SRichard Lowe  .debug_str              -      -      -
50*07dc1947SRichard Lowe  .debug_types            x      x      4
51*07dc1947SRichard Lowe */
5249d3bc91SRichard Lowe 
5349d3bc91SRichard Lowe #include <stddef.h>
5449d3bc91SRichard Lowe 
5549d3bc91SRichard Lowe 
5649d3bc91SRichard Lowe struct Dwarf_Die_s {
5749d3bc91SRichard Lowe     Dwarf_Byte_Ptr di_debug_info_ptr;
5849d3bc91SRichard Lowe     Dwarf_Abbrev_List di_abbrev_list;
5949d3bc91SRichard Lowe     Dwarf_CU_Context di_cu_context;
60*07dc1947SRichard Lowe     int  di_abbrev_code;
6149d3bc91SRichard Lowe };
6249d3bc91SRichard Lowe 
6349d3bc91SRichard Lowe struct Dwarf_Attribute_s {
6449d3bc91SRichard Lowe     Dwarf_Half ar_attribute;	/* Attribute Value. */
6549d3bc91SRichard Lowe     Dwarf_Half ar_attribute_form;	/* Attribute Form. */
6649d3bc91SRichard Lowe     Dwarf_Half ar_attribute_form_direct;
6749d3bc91SRichard Lowe 	        /* Identical to ar_attribute_form except that if
6849d3bc91SRichard Lowe 		the original form uleb was DW_FORM_indirect,
6949d3bc91SRichard Lowe 		ar_attribute_form_direct contains DW_FORM_indirect
7049d3bc91SRichard Lowe 		but ar_attribute_form contains the true form. */
7149d3bc91SRichard Lowe 
7249d3bc91SRichard Lowe     Dwarf_CU_Context ar_cu_context;
7349d3bc91SRichard Lowe     Dwarf_Small *ar_debug_info_ptr;
7449d3bc91SRichard Lowe     Dwarf_Attribute ar_next;
7549d3bc91SRichard Lowe };
7649d3bc91SRichard Lowe 
7749d3bc91SRichard Lowe /*
7849d3bc91SRichard Lowe     This structure provides the context for a compilation unit.
7949d3bc91SRichard Lowe     Thus, it contains the Dwarf_Debug, cc_dbg, that this cu
8049d3bc91SRichard Lowe     belongs to.  It contains the information in the compilation
8149d3bc91SRichard Lowe     unit header, cc_length, cc_version_stamp, cc_abbrev_offset,
8249d3bc91SRichard Lowe     and cc_address_size, in the .debug_info section for that cu.
8349d3bc91SRichard Lowe     In addition, it contains the count, cc_count_cu, of the cu
8449d3bc91SRichard Lowe     number of that cu in the list of cu's in the .debug_info.
8549d3bc91SRichard Lowe     The count starts at 1, ie cc_count_cu is 1 for the first cu,
8649d3bc91SRichard Lowe     2 for the second and so on.  This struct also contains a
8749d3bc91SRichard Lowe     pointer, cc_abbrev_table, to a list of pairs of abbrev code
8849d3bc91SRichard Lowe     and a pointer to the start of that abbrev
8949d3bc91SRichard Lowe     in the .debug_abbrev section.
9049d3bc91SRichard Lowe 
9149d3bc91SRichard Lowe     Each die will also contain a pointer to such a struct to
9249d3bc91SRichard Lowe     record the context for that die.
9349d3bc91SRichard Lowe 
94*07dc1947SRichard Lowe     Notice that a pointer to the CU DIE itself is
95*07dc1947SRichard Lowe     Dwarf_Off off2 = cu_context->cc_debug_info_offset;
96*07dc1947SRichard Lowe     cu_die_info_ptr = dbg->de_debug_info.dss_data +
97*07dc1947SRichard Lowe             off2 + _dwarf_length_of_cu_header(dbg, off2);
98*07dc1947SRichard Lowe 
9949d3bc91SRichard Lowe     **Updated by dwarf_next_cu_header in dwarf_die_deliv.c
10049d3bc91SRichard Lowe */
10149d3bc91SRichard Lowe struct Dwarf_CU_Context_s {
10249d3bc91SRichard Lowe     Dwarf_Debug cc_dbg;
103*07dc1947SRichard Lowe     /* The sum of cc_length, cc_length_size, and cc_extension_size
104*07dc1947SRichard Lowe        is the total length of the CU including its header. */
10549d3bc91SRichard Lowe     Dwarf_Word cc_length;
106*07dc1947SRichard Lowe     /* cc_length_size is the size in bytes of an offset.
107*07dc1947SRichard Lowe        4 for 32bit dwarf, 8 for 64bit dwarf (whether MIPS/IRIX
108*07dc1947SRichard Lowe        64bit dwarf or standard 64bit dwarf using the extension
109*07dc1947SRichard Lowe        mechanism). */
11049d3bc91SRichard Lowe     Dwarf_Small cc_length_size;
111*07dc1947SRichard Lowe     /* cc_extension_size is zero unless this is standard
112*07dc1947SRichard Lowe        DWARF3 and later 64bit dwarf using the extension mechanism.
113*07dc1947SRichard Lowe        If it is the DWARF3 and later 64bit dwarf cc_extension
114*07dc1947SRichard Lowe        size is 4. So for 32bit dwarf and MIPS/IRIX 64bit dwarf
115*07dc1947SRichard Lowe        cc_extension_size is zero.  */
11649d3bc91SRichard Lowe     Dwarf_Small cc_extension_size;
11749d3bc91SRichard Lowe     Dwarf_Half cc_version_stamp;
11849d3bc91SRichard Lowe     Dwarf_Sword cc_abbrev_offset;
11949d3bc91SRichard Lowe     Dwarf_Small cc_address_size;
120*07dc1947SRichard Lowe     /* cc_debug_info_offset is the offset in the section
121*07dc1947SRichard Lowe        of the CU header of this CU.  Dwarf_Word
122*07dc1947SRichard Lowe        should be large enough. */
12349d3bc91SRichard Lowe     Dwarf_Word cc_debug_info_offset;
12449d3bc91SRichard Lowe     Dwarf_Byte_Ptr cc_last_abbrev_ptr;
12549d3bc91SRichard Lowe     Dwarf_Hash_Table cc_abbrev_hash_table;
12649d3bc91SRichard Lowe     Dwarf_CU_Context cc_next;
127*07dc1947SRichard Lowe     /*unsigned char cc_offset_length; */
12849d3bc91SRichard Lowe };
12949d3bc91SRichard Lowe 
130*07dc1947SRichard Lowe /* Consolidates section-specific data in one place.
131*07dc1947SRichard Lowe    Section is an Elf specific term, intended as a general
132*07dc1947SRichard Lowe    term (for non-Elf objects some code must synthesize the
133*07dc1947SRichard Lowe    values somehow).
134*07dc1947SRichard Lowe    Makes adding more section-data much simpler. */
135*07dc1947SRichard Lowe struct Dwarf_Section_s {
136*07dc1947SRichard Lowe     Dwarf_Small *  dss_data;
137*07dc1947SRichard Lowe     Dwarf_Unsigned dss_size;
138*07dc1947SRichard Lowe     Dwarf_Word     dss_index;
139*07dc1947SRichard Lowe     /* dss_addr is the 'section address' which is only
140*07dc1947SRichard Lowe        non-zero for a GNU eh section.
141*07dc1947SRichard Lowe        Purpose: to handle DW_EH_PE_pcrel encoding. Leaving
142*07dc1947SRichard Lowe        it zero is fine for non-elf.  */
143*07dc1947SRichard Lowe     Dwarf_Addr     dss_addr;
144*07dc1947SRichard Lowe     Dwarf_Small    dss_data_was_malloc;
145*07dc1947SRichard Lowe 
146*07dc1947SRichard Lowe     /* For non-elf, leaving the following fields zero
147*07dc1947SRichard Lowe        will mean they are ignored. */
148*07dc1947SRichard Lowe     /* dss_link should be zero unless a section has a link
149*07dc1947SRichard Lowe        to another (sh_link).  Used to access relocation data for
150*07dc1947SRichard Lowe        a section (and for symtab section, access its strtab). */
151*07dc1947SRichard Lowe     Dwarf_Word     dss_link;
152*07dc1947SRichard Lowe     /* The following is used when reading .rela sections
153*07dc1947SRichard Lowe        (such sections appear in some .o files). */
154*07dc1947SRichard Lowe     Dwarf_Half     dss_reloc_index; /* Zero means ignore the reloc fields. */
155*07dc1947SRichard Lowe     Dwarf_Small *  dss_reloc_data;
156*07dc1947SRichard Lowe     Dwarf_Unsigned dss_reloc_size;
157*07dc1947SRichard Lowe     Dwarf_Addr     dss_reloc_addr;
158*07dc1947SRichard Lowe     /* dss_reloc_symtab is the sh_link of a .rela to its .symtab, leave
159*07dc1947SRichard Lowe        it 0 if non-meaningful. */
160*07dc1947SRichard Lowe     Dwarf_Addr     dss_reloc_symtab;
161*07dc1947SRichard Lowe     /* dss_reloc_link should be zero unless a reloc section has a link
162*07dc1947SRichard Lowe        to another (sh_link).  Used to access the symtab for relocations
163*07dc1947SRichard Lowe        a section. */
164*07dc1947SRichard Lowe     Dwarf_Word     dss_reloc_link;
165*07dc1947SRichard Lowe     /* Pointer to the elf symtab, used for elf .rela. Leave it 0
166*07dc1947SRichard Lowe        if not relevant. */
167*07dc1947SRichard Lowe     struct Dwarf_Section_s *dss_symtab;
168*07dc1947SRichard Lowe };
169*07dc1947SRichard Lowe 
170*07dc1947SRichard Lowe /* Overview: if next_to_use== first, no error slots are used.
171*07dc1947SRichard Lowe    If next_to_use+1 (mod maxcount) == first the slots are all used
172*07dc1947SRichard Lowe */
173*07dc1947SRichard Lowe struct Dwarf_Harmless_s {
174*07dc1947SRichard Lowe   unsigned dh_maxcount;
175*07dc1947SRichard Lowe   unsigned dh_next_to_use;
176*07dc1947SRichard Lowe   unsigned dh_first;
177*07dc1947SRichard Lowe   unsigned dh_errs_count;
178*07dc1947SRichard Lowe   char **  dh_errors;
179*07dc1947SRichard Lowe };
18049d3bc91SRichard Lowe 
18149d3bc91SRichard Lowe struct Dwarf_Debug_s {
182*07dc1947SRichard Lowe     /* All file access methods and support data
183*07dc1947SRichard Lowe        are hidden in this structure.
184*07dc1947SRichard Lowe        We get a pointer, callers control the lifetime of the
185*07dc1947SRichard Lowe        structure and contents. */
186*07dc1947SRichard Lowe     struct Dwarf_Obj_Access_Interface_s *de_obj_file;
18749d3bc91SRichard Lowe 
18849d3bc91SRichard Lowe     Dwarf_Handler de_errhand;
18949d3bc91SRichard Lowe     Dwarf_Ptr de_errarg;
19049d3bc91SRichard Lowe 
19149d3bc91SRichard Lowe     /*
19249d3bc91SRichard Lowe        Context for the compilation_unit just read by a call to
19349d3bc91SRichard Lowe        dwarf_next_cu_header. **Updated by dwarf_next_cu_header in
19449d3bc91SRichard Lowe        dwarf_die_deliv.c */
19549d3bc91SRichard Lowe     Dwarf_CU_Context de_cu_context;
19649d3bc91SRichard Lowe 
19749d3bc91SRichard Lowe     /*
19849d3bc91SRichard Lowe        Points to linked list of CU Contexts for the CU's already read.
19949d3bc91SRichard Lowe        These are only CU's read by dwarf_next_cu_header(). */
20049d3bc91SRichard Lowe     Dwarf_CU_Context de_cu_context_list;
20149d3bc91SRichard Lowe 
20249d3bc91SRichard Lowe     /*
20349d3bc91SRichard Lowe        Points to the last CU Context added to the list by
20449d3bc91SRichard Lowe        dwarf_next_cu_header(). */
20549d3bc91SRichard Lowe     Dwarf_CU_Context de_cu_context_list_end;
20649d3bc91SRichard Lowe 
20749d3bc91SRichard Lowe     /*
20849d3bc91SRichard Lowe        This is the list of CU contexts read for dwarf_offdie().  These
20949d3bc91SRichard Lowe        may read ahead of dwarf_next_cu_header(). */
21049d3bc91SRichard Lowe     Dwarf_CU_Context de_offdie_cu_context;
21149d3bc91SRichard Lowe     Dwarf_CU_Context de_offdie_cu_context_end;
21249d3bc91SRichard Lowe 
21349d3bc91SRichard Lowe     /* Offset of last byte of last CU read. */
21449d3bc91SRichard Lowe     Dwarf_Word de_info_last_offset;
21549d3bc91SRichard Lowe 
21649d3bc91SRichard Lowe     /*
21749d3bc91SRichard Lowe        Number of bytes in the length, and offset field in various
21849d3bc91SRichard Lowe        .debug_* sections.  It's not very meaningful, and is
21949d3bc91SRichard Lowe        only used in one 'approximate' calculation.  */
22049d3bc91SRichard Lowe     Dwarf_Small de_length_size;
22149d3bc91SRichard Lowe 
22249d3bc91SRichard Lowe     /* number of bytes in a pointer of the target in various .debug_
22349d3bc91SRichard Lowe        sections. 4 in 32bit, 8 in MIPS 64, ia64. */
22449d3bc91SRichard Lowe     Dwarf_Small de_pointer_size;
22549d3bc91SRichard Lowe 
22649d3bc91SRichard Lowe     /* set at creation of a Dwarf_Debug to say if form_string should be
22749d3bc91SRichard Lowe        checked for valid length at every call. 0 means do the check.
22849d3bc91SRichard Lowe        non-zero means do not do the check. */
22949d3bc91SRichard Lowe     Dwarf_Small de_assume_string_in_bounds;
23049d3bc91SRichard Lowe 
23149d3bc91SRichard Lowe     /*
23249d3bc91SRichard Lowe        Dwarf_Alloc_Hdr_s structs used to manage chunks that are
23349d3bc91SRichard Lowe        malloc'ed for each allocation type for structs. */
23449d3bc91SRichard Lowe     struct Dwarf_Alloc_Hdr_s de_alloc_hdr[ALLOC_AREA_REAL_TABLE_MAX];
23549d3bc91SRichard Lowe #ifdef DWARF_SIMPLE_MALLOC
23649d3bc91SRichard Lowe     struct simple_malloc_record_s *  de_simple_malloc_base;
23749d3bc91SRichard Lowe #endif
23849d3bc91SRichard Lowe 
23949d3bc91SRichard Lowe 
24049d3bc91SRichard Lowe     /*
24149d3bc91SRichard Lowe        These fields are used to process debug_frame section.  **Updated
24249d3bc91SRichard Lowe        by dwarf_get_fde_list in dwarf_frame.h */
24349d3bc91SRichard Lowe     /*
24449d3bc91SRichard Lowe        Points to contiguous block of pointers to Dwarf_Cie_s structs. */
24549d3bc91SRichard Lowe     Dwarf_Cie *de_cie_data;
24649d3bc91SRichard Lowe     /* Count of number of Dwarf_Cie_s structs. */
24749d3bc91SRichard Lowe     Dwarf_Signed de_cie_count;
248*07dc1947SRichard Lowe     /* Keep eh (GNU) separate!. */
249*07dc1947SRichard Lowe     Dwarf_Cie *de_cie_data_eh;
250*07dc1947SRichard Lowe     Dwarf_Signed de_cie_count_eh;
25149d3bc91SRichard Lowe     /*
25249d3bc91SRichard Lowe        Points to contiguous block of pointers to Dwarf_Fde_s structs. */
25349d3bc91SRichard Lowe     Dwarf_Fde *de_fde_data;
25449d3bc91SRichard Lowe     /* Count of number of Dwarf_Fde_s structs. */
25549d3bc91SRichard Lowe     Dwarf_Signed de_fde_count;
256*07dc1947SRichard Lowe     /* Keep eh (GNU) separate!. */
257*07dc1947SRichard Lowe     Dwarf_Fde *de_fde_data_eh;
258*07dc1947SRichard Lowe     Dwarf_Signed de_fde_count_eh;
25949d3bc91SRichard Lowe 
260*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_info;
261*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_abbrev;
262*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_line;
263*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_loc;
264*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_aranges;
265*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_macinfo;
266*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_pubnames;
267*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_str;
268*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_frame;
26949d3bc91SRichard Lowe 
270*07dc1947SRichard Lowe     /* gnu: the g++ eh_frame section */
271*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_frame_eh_gnu;
27249d3bc91SRichard Lowe 
273*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_pubtypes; /* DWARF3 .debug_pubtypes */
27449d3bc91SRichard Lowe 
275*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_funcnames;
276*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_typenames; /* SGI IRIX extension essentially
277*07dc1947SRichard Lowe 			identical to DWARF3 .debug_pubtypes. */
278*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_varnames;
279*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_weaknames;
280*07dc1947SRichard Lowe     struct Dwarf_Section_s de_debug_ranges;
28149d3bc91SRichard Lowe 
282*07dc1947SRichard Lowe     /* For non-elf, simply leave the following two structs zeroed and
283*07dc1947SRichard Lowe        they will be ignored. */
284*07dc1947SRichard Lowe     struct Dwarf_Section_s de_elf_symtab;
285*07dc1947SRichard Lowe     struct Dwarf_Section_s de_elf_strtab;
28649d3bc91SRichard Lowe 
28749d3bc91SRichard Lowe 
28849d3bc91SRichard Lowe     void *(*de_copy_word) (void *, const void *, size_t);
28949d3bc91SRichard Lowe     unsigned char de_same_endian;
29049d3bc91SRichard Lowe     unsigned char de_elf_must_close; /* if non-zero, then
29149d3bc91SRichard Lowe 	it was dwarf_init (not dwarf_elf_init)
29249d3bc91SRichard Lowe 	so must elf_end() */
29349d3bc91SRichard Lowe 
294*07dc1947SRichard Lowe     /* Default is DW_FRAME_INITIAL_VALUE from header. */
295*07dc1947SRichard Lowe     Dwarf_Half de_frame_rule_initial_value;
29649d3bc91SRichard Lowe 
297*07dc1947SRichard Lowe     /* Default is   DW_FRAME_LAST_REG_NUM. */
298*07dc1947SRichard Lowe     Dwarf_Half de_frame_reg_rules_entry_count;
29949d3bc91SRichard Lowe 
300*07dc1947SRichard Lowe     Dwarf_Half de_frame_cfa_col_number;
301*07dc1947SRichard Lowe     Dwarf_Half de_frame_same_value_number;
302*07dc1947SRichard Lowe     Dwarf_Half de_frame_undefined_value_number;
303*07dc1947SRichard Lowe 
30449d3bc91SRichard Lowe     unsigned char de_big_endian_object; /* non-zero if big-endian
30549d3bc91SRichard Lowe 		object opened. */
306*07dc1947SRichard Lowe 
307*07dc1947SRichard Lowe     struct Dwarf_Harmless_s de_harmless_errors;
30849d3bc91SRichard Lowe };
30949d3bc91SRichard Lowe 
31049d3bc91SRichard Lowe typedef struct Dwarf_Chain_s *Dwarf_Chain;
31149d3bc91SRichard Lowe struct Dwarf_Chain_s {
31249d3bc91SRichard Lowe     void *ch_item;
31349d3bc91SRichard Lowe     Dwarf_Chain ch_next;
31449d3bc91SRichard Lowe };
31549d3bc91SRichard Lowe 
316*07dc1947SRichard Lowe 
317*07dc1947SRichard Lowe #define CURRENT_VERSION_STAMP		2 /* DWARF2 */
318*07dc1947SRichard Lowe #define CURRENT_VERSION_STAMP3		3 /* DWARF3 */
319*07dc1947SRichard Lowe #define CURRENT_VERSION_STAMP4		4 /* DWARF4 */
32049d3bc91SRichard Lowe 
32149d3bc91SRichard Lowe     /* Size of cu header version stamp field. */
32249d3bc91SRichard Lowe #define CU_VERSION_STAMP_SIZE   sizeof(Dwarf_Half)
32349d3bc91SRichard Lowe 
32449d3bc91SRichard Lowe     /* Size of cu header address size field. */
32549d3bc91SRichard Lowe #define CU_ADDRESS_SIZE_SIZE	sizeof(Dwarf_Small)
32649d3bc91SRichard Lowe 
32749d3bc91SRichard Lowe void *_dwarf_memcpy_swap_bytes(void *s1, const void *s2, size_t len);
32849d3bc91SRichard Lowe 
32949d3bc91SRichard Lowe #define ORIGINAL_DWARF_OFFSET_SIZE  4
33049d3bc91SRichard Lowe #define DISTINGUISHED_VALUE  0xffffffff
33149d3bc91SRichard Lowe #define DISTINGUISHED_VALUE_OFFSET_SIZE 8
33249d3bc91SRichard Lowe 
33349d3bc91SRichard Lowe /*
33449d3bc91SRichard Lowe     We don't load the sections until they are needed. This function is
33549d3bc91SRichard Lowe     used to load the section.
33649d3bc91SRichard Lowe  */
33749d3bc91SRichard Lowe int _dwarf_load_section(Dwarf_Debug,
338*07dc1947SRichard Lowe     struct Dwarf_Section_s *,
33949d3bc91SRichard Lowe     Dwarf_Error *);
340