ld: Handle extended-length data structures in PDB types
[platform/upstream/binutils.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 #include <stddef.h>
31
32 #define LF_VTSHAPE                      0x000a
33 #define LF_MODIFIER                     0x1001
34 #define LF_POINTER                      0x1002
35 #define LF_PROCEDURE                    0x1008
36 #define LF_MFUNCTION                    0x1009
37 #define LF_ARGLIST                      0x1201
38 #define LF_FIELDLIST                    0x1203
39 #define LF_BITFIELD                     0x1205
40 #define LF_METHODLIST                   0x1206
41 #define LF_BCLASS                       0x1400
42 #define LF_VBCLASS                      0x1401
43 #define LF_IVBCLASS                     0x1402
44 #define LF_INDEX                        0x1404
45 #define LF_VFUNCTAB                     0x1409
46 #define LF_ENUMERATE                    0x1502
47 #define LF_ARRAY                        0x1503
48 #define LF_CLASS                        0x1504
49 #define LF_STRUCTURE                    0x1505
50 #define LF_UNION                        0x1506
51 #define LF_ENUM                         0x1507
52 #define LF_MEMBER                       0x150d
53 #define LF_STMEMBER                     0x150e
54 #define LF_METHOD                       0x150f
55 #define LF_NESTTYPE                     0x1510
56 #define LF_ONEMETHOD                    0x1511
57 #define LF_FUNC_ID                      0x1601
58 #define LF_MFUNC_ID                     0x1602
59 #define LF_BUILDINFO                    0x1603
60 #define LF_SUBSTR_LIST                  0x1604
61 #define LF_STRING_ID                    0x1605
62 #define LF_UDT_SRC_LINE                 0x1606
63 #define LF_UDT_MOD_SRC_LINE             0x1607
64
65 #define LF_CHAR                         0x8000
66 #define LF_SHORT                        0x8001
67 #define LF_USHORT                       0x8002
68 #define LF_LONG                         0x8003
69 #define LF_ULONG                        0x8004
70 #define LF_QUADWORD                     0x8009
71 #define LF_UQUADWORD                    0x800a
72
73 #define S_END                           0x0006
74 #define S_FRAMEPROC                     0x1012
75 #define S_OBJNAME                       0x1101
76 #define S_THUNK32                       0x1102
77 #define S_BLOCK32                       0x1103
78 #define S_LABEL32                       0x1105
79 #define S_REGISTER                      0x1106
80 #define S_CONSTANT                      0x1107
81 #define S_UDT                           0x1108
82 #define S_BPREL32                       0x110b
83 #define S_LDATA32                       0x110c
84 #define S_GDATA32                       0x110d
85 #define S_PUB32                         0x110e
86 #define S_LPROC32                       0x110f
87 #define S_GPROC32                       0x1110
88 #define S_REGREL32                      0x1111
89 #define S_LTHREAD32                     0x1112
90 #define S_GTHREAD32                     0x1113
91 #define S_UNAMESPACE                    0x1124
92 #define S_PROCREF                       0x1125
93 #define S_LPROCREF                      0x1127
94 #define S_FRAMECOOKIE                   0x113a
95 #define S_COMPILE3                      0x113c
96 #define S_ENVBLOCK                      0x113d
97 #define S_LOCAL                         0x113e
98 #define S_DEFRANGE_REGISTER             0x1141
99 #define S_DEFRANGE_FRAMEPOINTER_REL     0x1142
100 #define S_DEFRANGE_SUBFIELD_REGISTER    0x1143
101 #define S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE  0x1144
102 #define S_DEFRANGE_REGISTER_REL         0x1145
103 #define S_LPROC32_ID                    0x1146
104 #define S_GPROC32_ID                    0x1147
105 #define S_BUILDINFO                     0x114c
106 #define S_INLINESITE                    0x114d
107 #define S_INLINESITE_END                0x114e
108 #define S_PROC_ID_END                   0x114f
109 #define S_HEAPALLOCSITE                 0x115e
110
111 /* PDBStream70 in pdb1.h */
112 struct pdb_stream_70
113 {
114   uint32_t version;
115   uint32_t signature;
116   uint32_t age;
117   uint8_t guid[16];
118 };
119
120 #define PDB_STREAM_VERSION_VC70         20000404
121 #define PDB_STREAM_VERSION_VC140        20140508
122
123 /* HDR in tpi.h */
124 struct pdb_tpi_stream_header
125 {
126   uint32_t version;
127   uint32_t header_size;
128   uint32_t type_index_begin;
129   uint32_t type_index_end;
130   uint32_t type_record_bytes;
131   uint16_t hash_stream_index;
132   uint16_t hash_aux_stream_index;
133   uint32_t hash_key_size;
134   uint32_t num_hash_buckets;
135   uint32_t hash_value_buffer_offset;
136   uint32_t hash_value_buffer_length;
137   uint32_t index_offset_buffer_offset;
138   uint32_t index_offset_buffer_length;
139   uint32_t hash_adj_buffer_offset;
140   uint32_t hash_adj_buffer_length;
141 };
142
143 #define TPI_STREAM_VERSION_80           20040203
144
145 #define TPI_FIRST_INDEX                 0x1000
146 #define NUM_TPI_HASH_BUCKETS            0x3ffff
147
148 #define NUM_GLOBALS_HASH_BUCKETS        4096
149
150 /* NewDBIHdr in dbi.h */
151 struct pdb_dbi_stream_header
152 {
153   uint32_t version_signature;
154   uint32_t version_header;
155   uint32_t age;
156   uint16_t global_stream_index;
157   uint16_t build_number;
158   uint16_t public_stream_index;
159   uint16_t pdb_dll_version;
160   uint16_t sym_record_stream;
161   uint16_t pdb_dll_rbld;
162   uint32_t mod_info_size;
163   uint32_t section_contribution_size;
164   uint32_t section_map_size;
165   uint32_t source_info_size;
166   uint32_t type_server_map_size;
167   uint32_t mfc_type_server_index;
168   uint32_t optional_dbg_header_size;
169   uint32_t ec_substream_size;
170   uint16_t flags;
171   uint16_t machine;
172   uint32_t padding;
173 };
174
175 #define DBI_STREAM_VERSION_70           19990903
176
177 /* PSGSIHDR in gsi.h */
178 struct publics_header
179 {
180   uint32_t sym_hash_size;
181   uint32_t addr_map_size;
182   uint32_t num_thunks;
183   uint32_t thunks_size;
184   uint32_t thunk_table;
185   uint32_t thunk_table_offset;
186   uint32_t num_sects;
187 };
188
189 /* GSIHashHdr in gsi.h */
190 struct globals_hash_header
191 {
192   uint32_t signature;
193   uint32_t version;
194   uint32_t entries_size;
195   uint32_t buckets_size;
196 };
197
198 /* HRFile in gsi.h */
199 struct hash_record
200 {
201   uint32_t offset;
202   uint32_t reference;
203 };
204
205 #define GLOBALS_HASH_SIGNATURE          0xffffffff
206 #define GLOBALS_HASH_VERSION_70         0xf12f091a
207
208 /* PUBSYM32 in cvinfo.h */
209 struct pubsym
210 {
211   uint16_t record_length;
212   uint16_t record_type;
213   uint32_t flags;
214   uint32_t offset;
215   uint16_t section;
216   /* followed by null-terminated string */
217 } ATTRIBUTE_PACKED;
218
219 /* see bitset CV_PUBSYMFLAGS in cvinfo.h */
220 #define PUBSYM_FUNCTION                 0x2
221
222 struct optional_dbg_header
223 {
224   uint16_t fpo_stream;
225   uint16_t exception_stream;
226   uint16_t fixup_stream;
227   uint16_t omap_to_src_stream;
228   uint16_t omap_from_src_stream;
229   uint16_t section_header_stream;
230   uint16_t token_map_stream;
231   uint16_t xdata_stream;
232   uint16_t pdata_stream;
233   uint16_t new_fpo_stream;
234   uint16_t orig_section_header_stream;
235 };
236
237 #define CV_SIGNATURE_C13                4
238
239 #define DEBUG_S_SYMBOLS                 0xf1
240 #define DEBUG_S_LINES                   0xf2
241 #define DEBUG_S_STRINGTABLE             0xf3
242 #define DEBUG_S_FILECHKSMS              0xf4
243
244 #define STRING_TABLE_SIGNATURE          0xeffeeffe
245 #define STRING_TABLE_VERSION            1
246
247 /* VHdr in nmt.h */
248 struct string_table_header
249 {
250   uint32_t signature;
251   uint32_t version;
252 };
253
254 #define SECTION_CONTRIB_VERSION_60      0xf12eba2d
255
256 /* SC in dbicommon.h */
257 struct section_contribution
258 {
259   uint16_t section;
260   uint16_t padding1;
261   uint32_t offset;
262   uint32_t size;
263   uint32_t characteristics;
264   uint16_t module_index;
265   uint16_t padding2;
266   uint32_t data_crc;
267   uint32_t reloc_crc;
268 };
269
270 /* MODI_60_Persist in dbi.h */
271 struct module_info
272 {
273   uint32_t unused1;
274   struct section_contribution sc;
275   uint16_t flags;
276   uint16_t module_sym_stream;
277   uint32_t sym_byte_size;
278   uint32_t c11_byte_size;
279   uint32_t c13_byte_size;
280   uint16_t source_file_count;
281   uint16_t padding;
282   uint32_t unused2;
283   uint32_t source_file_name_index;
284   uint32_t pdb_file_path_name_index;
285 };
286
287 /* filedata in dumpsym7.cpp */
288 struct file_checksum
289 {
290   uint32_t file_id;
291   uint8_t checksum_length;
292   uint8_t checksum_type;
293 } ATTRIBUTE_PACKED;
294
295 /* lfModifier in cvinfo.h */
296 struct lf_modifier
297 {
298   uint16_t size;
299   uint16_t kind;
300   uint32_t base_type;
301   uint16_t modifier;
302   uint16_t padding;
303 } ATTRIBUTE_PACKED;
304
305 /* lfPointer in cvinfo.h */
306 struct lf_pointer
307 {
308   uint16_t size;
309   uint16_t kind;
310   uint32_t base_type;
311   uint32_t attributes;
312 } ATTRIBUTE_PACKED;
313
314 /* lfArgList in cvinfo.h (used for both LF_ARGLIST and LF_SUBSTR_LIST) */
315 struct lf_arglist
316 {
317   uint16_t size;
318   uint16_t kind;
319   uint32_t num_entries;
320   uint32_t args[];
321 } ATTRIBUTE_PACKED;
322
323 /* lfProc in cvinfo.h */
324 struct lf_procedure
325 {
326   uint16_t size;
327   uint16_t kind;
328   uint32_t return_type;
329   uint8_t calling_convention;
330   uint8_t attributes;
331   uint16_t num_parameters;
332   uint32_t arglist;
333 } ATTRIBUTE_PACKED;
334
335 /* lfMFunc in cvinfo.h */
336 struct lf_mfunction
337 {
338   uint16_t size;
339   uint16_t kind;
340   uint32_t return_type;
341   uint32_t containing_class_type;
342   uint32_t this_type;
343   uint8_t calling_convention;
344   uint8_t attributes;
345   uint16_t num_parameters;
346   uint32_t arglist;
347   int32_t this_adjustment;
348 } ATTRIBUTE_PACKED;
349
350 /* lfArray in cvinfo.h */
351 struct lf_array
352 {
353   uint16_t size;
354   uint16_t kind;
355   uint32_t element_type;
356   uint32_t index_type;
357   uint16_t length_in_bytes;
358   char name[];
359 } ATTRIBUTE_PACKED;
360
361 /* lfBitfield in cvinfo.h */
362 struct lf_bitfield
363 {
364   uint16_t size;
365   uint16_t kind;
366   uint32_t base_type;
367   uint8_t length;
368   uint8_t position;
369 } ATTRIBUTE_PACKED;
370
371 /* lfMember in cvinfo.h */
372 struct lf_member
373 {
374   uint16_t kind;
375   uint16_t attributes;
376   uint32_t type;
377   uint16_t offset;
378   char name[];
379 } ATTRIBUTE_PACKED;
380
381 /* from bitfield structure CV_prop_t in cvinfo.h */
382 #define CV_PROP_FORWARD_REF     0x80
383 #define CV_PROP_SCOPED          0x100
384 #define CV_PROP_HAS_UNIQUE_NAME 0x200
385
386 /* lfClass in cvinfo.h */
387 struct lf_class
388 {
389   uint16_t size;
390   uint16_t kind;
391   uint16_t num_members;
392   uint16_t properties;
393   uint32_t field_list;
394   uint32_t derived_from;
395   uint32_t vshape;
396   uint16_t length;
397   char name[];
398 } ATTRIBUTE_PACKED;
399
400 /* lfUnion in cvinfo.h */
401 struct lf_union
402 {
403   uint16_t size;
404   uint16_t kind;
405   uint16_t num_members;
406   uint16_t properties;
407   uint32_t field_list;
408   uint16_t length;
409   char name[];
410 } ATTRIBUTE_PACKED;
411
412 /* lfEnumerate in cvinfo.h */
413 struct lf_enumerate
414 {
415   uint16_t kind;
416   uint16_t attributes;
417   uint16_t value;
418   /* then actual value if value >= 0x8000 */
419   char name[];
420 } ATTRIBUTE_PACKED;
421
422 /* lfEnum in cvinfo.h */
423 struct lf_enum
424 {
425   uint16_t size;
426   uint16_t kind;
427   uint16_t num_elements;
428   uint16_t properties;
429   uint32_t underlying_type;
430   uint32_t field_list;
431   char name[];
432 } ATTRIBUTE_PACKED;
433
434 /* lfIndex in cvinfo.h */
435 struct lf_index
436 {
437   uint16_t kind;
438   uint16_t padding;
439   uint32_t index;
440 } ATTRIBUTE_PACKED;
441
442 /* lfOneMethod in cvinfo.h */
443 struct lf_onemethod
444 {
445   uint16_t kind;
446   uint16_t method_attribute;
447   uint32_t method_type;
448   char name[];
449 } ATTRIBUTE_PACKED;
450
451 /* mlMethod in cvinfo.h */
452 struct lf_methodlist_entry
453 {
454   uint16_t method_attribute;
455   uint16_t padding;
456   uint32_t method_type;
457 } ATTRIBUTE_PACKED;
458
459 /* lfMethodList in cvinfo.h */
460 struct lf_methodlist
461 {
462   uint16_t size;
463   uint16_t kind;
464   struct lf_methodlist_entry entries[];
465 } ATTRIBUTE_PACKED;
466
467 /* lfMethod in cvinfo.h */
468 struct lf_method
469 {
470   uint16_t kind;
471   uint16_t count;
472   uint32_t method_list;
473   char name[];
474 } ATTRIBUTE_PACKED;
475
476 /* lfBClass in cvinfo.h */
477 struct lf_bclass
478 {
479   uint16_t kind;
480   uint16_t attributes;
481   uint32_t base_class_type;
482   uint16_t offset;
483 } ATTRIBUTE_PACKED;
484
485 /* lfVFuncTab in cvinfo.h */
486 struct lf_vfunctab
487 {
488   uint16_t kind;
489   uint16_t padding;
490   uint32_t type;
491 } ATTRIBUTE_PACKED;
492
493 /* lfVBClass in cvinfo.h */
494 struct lf_vbclass
495 {
496   uint16_t kind;
497   uint16_t attributes;
498   uint32_t base_class_type;
499   uint32_t virtual_base_pointer_type;
500   uint16_t virtual_base_pointer_offset;
501   uint16_t virtual_base_vbtable_offset;
502 } ATTRIBUTE_PACKED;
503
504 /* lfSTMember in cvinfo.h */
505 struct lf_static_member
506 {
507   uint16_t kind;
508   uint16_t attributes;
509   uint32_t type;
510   char name[];
511 } ATTRIBUTE_PACKED;
512
513 /* lfNestType in cvinfo.h */
514 struct lf_nest_type
515 {
516   uint16_t kind;
517   uint16_t padding;
518   uint32_t type;
519   char name[];
520 } ATTRIBUTE_PACKED;
521
522 /* lfStringId in cvinfo.h */
523 struct lf_string_id
524 {
525   uint16_t size;
526   uint16_t kind;
527   uint32_t substring;
528   char string[];
529 } ATTRIBUTE_PACKED;
530
531 /* lfBuildInfo in cvinfo.h */
532 struct lf_build_info
533 {
534   uint16_t size;
535   uint16_t kind;
536   uint16_t count;
537   uint32_t strings[];
538 } ATTRIBUTE_PACKED;
539
540 /* lfFuncId in cvinfo.h */
541 struct lf_func_id
542 {
543   uint16_t size;
544   uint16_t kind;
545   uint32_t parent_scope;
546   uint32_t function_type;
547   char name[];
548 } ATTRIBUTE_PACKED;
549
550 /* lfMFuncId in cvinfo.h */
551 struct lf_mfunc_id
552 {
553   uint16_t size;
554   uint16_t kind;
555   uint32_t parent_type;
556   uint32_t function_type;
557   char name[];
558 } ATTRIBUTE_PACKED;
559
560 /* lfUdtSrcLine in cvinfo.h */
561 struct lf_udt_src_line
562 {
563   uint16_t size;
564   uint16_t kind;
565   uint32_t type;
566   uint32_t source_file_type;
567   uint32_t line_no;
568 } ATTRIBUTE_PACKED;
569
570 /* lfUdtModSrcLine in cvinfo.h */
571 struct lf_udt_mod_src_line
572 {
573   uint16_t size;
574   uint16_t kind;
575   uint32_t type;
576   uint32_t source_file_string;
577   uint32_t line_no;
578   uint16_t module_no;
579 } ATTRIBUTE_PACKED;
580
581 /* DATASYM32 in cvinfo.h */
582 struct datasym
583 {
584   uint16_t size;
585   uint16_t kind;
586   uint32_t type;
587   uint32_t offset;
588   uint16_t section;
589   char name[];
590 } ATTRIBUTE_PACKED;
591
592 /* PROCSYM32 in cvinfo.h */
593 struct procsym
594 {
595   uint16_t size;
596   uint16_t kind;
597   uint32_t parent;
598   uint32_t end;
599   uint32_t next;
600   uint32_t proc_len;
601   uint32_t debug_start;
602   uint32_t debug_end;
603   uint32_t type;
604   uint32_t offset;
605   uint16_t section;
606   uint8_t flags;
607   char name[];
608 } ATTRIBUTE_PACKED;
609
610 /* REFSYM2 in cvinfo.h */
611 struct refsym
612 {
613   uint16_t size;
614   uint16_t kind;
615   uint32_t sum_name;
616   uint32_t symbol_offset;
617   uint16_t mod;
618   char name[];
619 } ATTRIBUTE_PACKED;
620
621 /* UDTSYM in cvinfo.h */
622 struct udtsym
623 {
624   uint16_t size;
625   uint16_t kind;
626   uint32_t type;
627   char name[];
628 } ATTRIBUTE_PACKED;
629
630 /* CONSTSYM in cvinfo.h */
631 struct constsym
632 {
633   uint16_t size;
634   uint16_t kind;
635   uint32_t type;
636   uint16_t value;
637   /* then actual value if value >= 0x8000 */
638   char name[];
639 } ATTRIBUTE_PACKED;
640
641 /* BUILDINFOSYM in cvinfo.h */
642 struct buildinfosym
643 {
644   uint16_t size;
645   uint16_t kind;
646   uint32_t type;
647 } ATTRIBUTE_PACKED;
648
649 /* BLOCKSYM32 in cvinfo.h */
650 struct blocksym
651 {
652   uint16_t size;
653   uint16_t kind;
654   uint32_t parent;
655   uint32_t end;
656   uint32_t len;
657   uint32_t offset;
658   uint16_t section;
659   char name[];
660 } ATTRIBUTE_PACKED;
661
662 /* BPRELSYM32 in cvinfo.h */
663 struct bprelsym
664 {
665   uint16_t size;
666   uint16_t kind;
667   uint32_t bp_offset;
668   uint32_t type;
669   char name[];
670 } ATTRIBUTE_PACKED;
671
672 /* REGSYM in cvinfo.h */
673 struct regsym
674 {
675   uint16_t size;
676   uint16_t kind;
677   uint32_t type;
678   uint16_t reg;
679   char name[];
680 } ATTRIBUTE_PACKED;
681
682 /* REGREL32 in cvinfo.h */
683 struct regrel
684 {
685   uint16_t size;
686   uint16_t kind;
687   uint32_t offset;
688   uint32_t type;
689   uint16_t reg;
690   char name[];
691 } ATTRIBUTE_PACKED;
692
693 /* LOCALSYM in cvinfo.h */
694 struct localsym
695 {
696   uint16_t size;
697   uint16_t kind;
698   uint32_t type;
699   uint16_t flags;
700   char name[];
701 } ATTRIBUTE_PACKED;
702
703 /* CV_LVAR_ADDR_RANGE in cvinfo.h */
704 struct lvar_addr_range
705 {
706   uint32_t offset;
707   uint16_t section;
708   uint16_t length;
709 } ATTRIBUTE_PACKED;
710
711 /* CV_LVAR_ADDR_GAP in cvinfo.h */
712 struct lvar_addr_gap {
713   uint16_t offset;
714   uint16_t length;
715 } ATTRIBUTE_PACKED;
716
717 /* DEFRANGESYMREGISTERREL in cvinfo.h */
718 struct defrange_register_rel
719 {
720   uint16_t size;
721   uint16_t kind;
722   uint16_t reg;
723   uint16_t offset_parent;
724   uint32_t offset_register;
725   struct lvar_addr_range range;
726   struct lvar_addr_gap gaps[];
727 } ATTRIBUTE_PACKED;
728
729 /* DEFRANGESYMFRAMEPOINTERREL in cvinfo.h */
730 struct defrange_framepointer_rel
731 {
732   uint16_t size;
733   uint16_t kind;
734   uint32_t offset;
735   struct lvar_addr_range range;
736   struct lvar_addr_gap gaps[];
737 } ATTRIBUTE_PACKED;
738
739 /* DEFRANGESYMSUBFIELDREGISTER in cvinfo.h */
740 struct defrange_subfield_register
741 {
742   uint16_t size;
743   uint16_t kind;
744   uint16_t reg;
745   uint16_t attributes;
746   uint32_t offset_parent;
747   struct lvar_addr_range range;
748   struct lvar_addr_gap gaps[];
749 } ATTRIBUTE_PACKED;
750
751 /* DEFRANGESYMREGISTER in cvinfo.h */
752 struct defrange_register
753 {
754   uint16_t size;
755   uint16_t kind;
756   uint16_t reg;
757   uint16_t attributes;
758   struct lvar_addr_range range;
759   struct lvar_addr_gap gaps[];
760 } ATTRIBUTE_PACKED;
761
762 /* INLINESITESYM in cvinfo.h */
763 struct inline_site
764 {
765   uint16_t size;
766   uint16_t kind;
767   uint32_t parent;
768   uint32_t end;
769   uint32_t inlinee;
770   uint8_t binary_annotations[];
771 } ATTRIBUTE_PACKED;
772
773 /* THUNKSYM32 in cvinfo.h */
774 struct thunk
775 {
776   uint16_t size;
777   uint16_t kind;
778   uint32_t parent;
779   uint32_t end;
780   uint32_t next;
781   uint32_t offset;
782   uint16_t section;
783   uint16_t length;
784   uint8_t thunk_type;
785   char name[];
786 } ATTRIBUTE_PACKED;
787
788 /* HEAPALLOCSITE in cvinfo.h */
789 struct heap_alloc_site
790 {
791   uint16_t size;
792   uint16_t kind;
793   uint32_t offset;
794   uint16_t section;
795   uint16_t length;
796   uint32_t type;
797 } ATTRIBUTE_PACKED;
798
799 /* OBJNAMESYM in cvinfo.h */
800 struct objname
801 {
802   uint16_t size;
803   uint16_t kind;
804   uint32_t signature;
805   char name[];
806 } ATTRIBUTE_PACKED;
807
808 #define CV_CFL_80386                    0x03
809 #define CV_CFL_X64                      0xD0
810
811 #define CV_CFL_LINK                     0x07
812
813 /* COMPILESYM3 in cvinfo.h */
814 struct compile3
815 {
816   uint16_t size;
817   uint16_t kind;
818   uint32_t flags;
819   uint16_t machine;
820   uint16_t frontend_major;
821   uint16_t frontend_minor;
822   uint16_t frontend_build;
823   uint16_t frontend_qfe;
824   uint16_t backend_major;
825   uint16_t backend_minor;
826   uint16_t backend_build;
827   uint16_t backend_qfe;
828   char compiler[];
829 } ATTRIBUTE_PACKED;
830
831 /* ENVBLOCKSYM in cvinfo.h */
832 struct envblock
833 {
834   uint16_t size;
835   uint16_t kind;
836   uint8_t flags;
837   char strings[];
838 } ATTRIBUTE_PACKED;
839
840 extern bool create_pdb_file (bfd *, const char *, const unsigned char *);
841
842 #endif