NULL dereference read in som_write_object_contents
[binutils-gdb.git] / ld / pdb.h
1 /* pdb.h - header file for generating PDB CodeView debugging files.
2 Copyright (C) 2022 Free Software Foundation, Inc.
3
4 This file is part of the GNU Binutils.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
20
21 /* Header files referred to below can be found in Microsoft's PDB
22 repository: https://github.com/microsoft/microsoft-pdb. */
23
24 #ifndef PDB_H
25 #define PDB_H
26
27 #include "sysdep.h"
28 #include "bfd.h"
29 #include <stdbool.h>
30
31 /* PDBStream70 in pdb1.h */
32 struct pdb_stream_70
33 {
34 uint32_t version;
35 uint32_t signature;
36 uint32_t age;
37 uint8_t guid[16];
38 };
39
40 #define PDB_STREAM_VERSION_VC70 20000404
41 #define PDB_STREAM_VERSION_VC140 20140508
42
43 /* HDR in tpi.h */
44 struct pdb_tpi_stream_header
45 {
46 uint32_t version;
47 uint32_t header_size;
48 uint32_t type_index_begin;
49 uint32_t type_index_end;
50 uint32_t type_record_bytes;
51 uint16_t hash_stream_index;
52 uint16_t hash_aux_stream_index;
53 uint32_t hash_key_size;
54 uint32_t num_hash_buckets;
55 uint32_t hash_value_buffer_offset;
56 uint32_t hash_value_buffer_length;
57 uint32_t index_offset_buffer_offset;
58 uint32_t index_offset_buffer_length;
59 uint32_t hash_adj_buffer_offset;
60 uint32_t hash_adj_buffer_length;
61 };
62
63 #define TPI_STREAM_VERSION_80 20040203
64
65 #define TPI_FIRST_INDEX 0x1000
66
67 /* NewDBIHdr in dbi.h */
68 struct pdb_dbi_stream_header
69 {
70 uint32_t version_signature;
71 uint32_t version_header;
72 uint32_t age;
73 uint16_t global_stream_index;
74 uint16_t build_number;
75 uint16_t public_stream_index;
76 uint16_t pdb_dll_version;
77 uint16_t sym_record_stream;
78 uint16_t pdb_dll_rbld;
79 uint32_t mod_info_size;
80 uint32_t section_contribution_size;
81 uint32_t section_map_size;
82 uint32_t source_info_size;
83 uint32_t type_server_map_size;
84 uint32_t mfc_type_server_index;
85 uint32_t optional_dbg_header_size;
86 uint32_t ec_substream_size;
87 uint16_t flags;
88 uint16_t machine;
89 uint32_t padding;
90 };
91
92 #define DBI_STREAM_VERSION_70 19990903
93
94 struct optional_dbg_header
95 {
96 uint16_t fpo_stream;
97 uint16_t exception_stream;
98 uint16_t fixup_stream;
99 uint16_t omap_to_src_stream;
100 uint16_t omap_from_src_stream;
101 uint16_t section_header_stream;
102 uint16_t token_map_stream;
103 uint16_t xdata_stream;
104 uint16_t pdata_stream;
105 uint16_t new_fpo_stream;
106 uint16_t orig_section_header_stream;
107 };
108
109 extern bool create_pdb_file (bfd *, const char *, const unsigned char *);
110
111 #endif