Use bfd_alloc memory for read_debugging_info storage
[binutils-gdb.git] / binutils / rdcoff.c
1 /* stabs.c -- Parse COFF debugging information
2 Copyright (C) 1996-2023 Free Software Foundation, Inc.
3 Written by Ian Lance Taylor <ian@cygnus.com>.
4
5 This file is part of GNU Binutils.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
20 02110-1301, USA. */
21
22 /* This file contains code which parses COFF debugging information. */
23
24 #include "sysdep.h"
25 #include "bfd.h"
26 #include "coff/internal.h"
27 #include "libiberty.h"
28 #include "bucomm.h"
29 #include "debug.h"
30 #include "budbg.h"
31
32 /* FIXME: We should not need this BFD internal file. We need it for
33 the N_BTMASK, etc., values. */
34 #include "libcoff.h"
35
36 /* These macros extract the right mask and shifts for this BFD. They
37 assume that there is a local variable named ABFD. This is so that
38 macros like ISFCN and DECREF, from coff/internal.h, will work
39 without modification. */
40 #define N_BTMASK (coff_data (abfd)->local_n_btmask)
41 #define N_BTSHFT (coff_data (abfd)->local_n_btshft)
42 #define N_TMASK (coff_data (abfd)->local_n_tmask)
43 #define N_TSHIFT (coff_data (abfd)->local_n_tshift)
44
45 /* This structure is used to hold the symbols, as well as the current
46 location within the symbols. */
47
48 struct coff_symbols
49 {
50 /* The symbols. */
51 asymbol **syms;
52 /* The number of symbols. */
53 long symcount;
54 /* The index of the current symbol. */
55 long symno;
56 /* The index of the current symbol in the COFF symbol table (where
57 each auxent counts as a symbol). */
58 long coff_symno;
59 };
60
61 /* This structure is used to map symbol indices to types. */
62
63 struct coff_types
64 {
65 /* Next set of slots. */
66 struct coff_types *next;
67 /* Where the TYPES array starts. */
68 unsigned int base_index;
69 /* Slots. */
70 #define COFF_SLOTS (16)
71 debug_type types[COFF_SLOTS];
72 };
73
74 static debug_type parse_coff_base_type
75 (bfd *, struct coff_symbols *, struct coff_types **, long, int,
76 union internal_auxent *, void *);
77 static debug_type parse_coff_struct_type
78 (bfd *, struct coff_symbols *, struct coff_types **, int,
79 union internal_auxent *, void *);
80 static debug_type parse_coff_enum_type
81 (bfd *, struct coff_symbols *, struct coff_types **,
82 union internal_auxent *, void *);
83 \f
84 /* Return the slot for a type. */
85
86 static debug_type *
87 coff_get_slot (void *dhandle, struct coff_types **types, long indx)
88 {
89 unsigned int base_index;
90
91 base_index = indx / COFF_SLOTS * COFF_SLOTS;
92 indx -= base_index;
93
94 while (*types && (*types)->base_index < base_index)
95 types = &(*types)->next;
96
97 if (*types == NULL || (*types)->base_index != base_index)
98 {
99 struct coff_types *n = debug_xzalloc (dhandle, sizeof (*n));
100 n->next = *types;
101 n->base_index = base_index;
102 *types = n;
103 }
104
105 return (*types)->types + indx;
106 }
107
108 /* Parse a COFF type code in NTYPE. */
109
110 static debug_type
111 parse_coff_type (bfd *abfd, struct coff_symbols *symbols,
112 struct coff_types **types, long coff_symno, int ntype,
113 union internal_auxent *pauxent, bool useaux,
114 void *dhandle)
115 {
116 debug_type type;
117
118 if ((ntype & ~N_BTMASK) != 0)
119 {
120 int newtype;
121
122 newtype = DECREF (ntype);
123
124 if (ISPTR (ntype))
125 {
126 type = parse_coff_type (abfd, symbols, types, coff_symno, newtype,
127 pauxent, useaux, dhandle);
128 type = debug_make_pointer_type (dhandle, type);
129 }
130 else if (ISFCN (ntype))
131 {
132 type = parse_coff_type (abfd, symbols, types, coff_symno, newtype,
133 pauxent, useaux, dhandle);
134 type = debug_make_function_type (dhandle, type, (debug_type *) NULL,
135 false);
136 }
137 else if (ISARY (ntype))
138 {
139 int n;
140
141 if (pauxent == NULL)
142 n = 0;
143 else
144 {
145 unsigned short *dim;
146 int i;
147
148 /* FIXME: If pauxent->x_sym.x_tagndx.l == 0, gdb sets
149 the c_naux field of the syment to 0. */
150
151 /* Move the dimensions down, so that the next array
152 picks up the next one. */
153 dim = pauxent->x_sym.x_fcnary.x_ary.x_dimen;
154 n = dim[0];
155 for (i = 0; *dim != 0 && i < DIMNUM - 1; i++, dim++)
156 *dim = *(dim + 1);
157 *dim = 0;
158 }
159
160 type = parse_coff_type (abfd, symbols, types, coff_symno, newtype,
161 pauxent, false, dhandle);
162 type = debug_make_array_type (dhandle, type,
163 parse_coff_base_type (abfd, symbols,
164 types,
165 coff_symno,
166 T_INT,
167 NULL, dhandle),
168 0, n - 1, false);
169 }
170 else
171 {
172 non_fatal (_("parse_coff_type: Bad type code 0x%x"), ntype);
173 return DEBUG_TYPE_NULL;
174 }
175
176 return type;
177 }
178
179 if (pauxent != NULL && (int32_t) pauxent->x_sym.x_tagndx.u32 > 0)
180 {
181 debug_type *slot;
182
183 /* This is a reference to an existing type. FIXME: gdb checks
184 that the class is not C_STRTAG, nor C_UNTAG, nor C_ENTAG. */
185 slot = coff_get_slot (dhandle, types, pauxent->x_sym.x_tagndx.u32);
186 if (*slot != DEBUG_TYPE_NULL)
187 return *slot;
188 else
189 return debug_make_indirect_type (dhandle, slot, (const char *) NULL);
190 }
191
192 /* If the aux entry has already been used for something, useaux will
193 have been set to false, indicating that parse_coff_base_type
194 should not use it. We need to do it this way, rather than simply
195 passing pauxent as NULL, because we need to be able handle
196 multiple array dimensions while still discarding pauxent after
197 having handled all of them. */
198 if (! useaux)
199 pauxent = NULL;
200
201 return parse_coff_base_type (abfd, symbols, types, coff_symno, ntype,
202 pauxent, dhandle);
203 }
204
205 /* Parse a basic COFF type in NTYPE. */
206
207 static debug_type
208 parse_coff_base_type (bfd *abfd, struct coff_symbols *symbols,
209 struct coff_types **types, long coff_symno, int ntype,
210 union internal_auxent *pauxent, void *dhandle)
211 {
212 debug_type ret;
213 const char *name = NULL;
214
215 switch (ntype)
216 {
217 default:
218 ret = debug_make_void_type (dhandle);
219 break;
220
221 case T_NULL:
222 case T_VOID:
223 ret = debug_make_void_type (dhandle);
224 name = "void";
225 break;
226
227 case T_CHAR:
228 ret = debug_make_int_type (dhandle, 1, false);
229 name = "char";
230 break;
231
232 case T_SHORT:
233 ret = debug_make_int_type (dhandle, 2, false);
234 name = "short";
235 break;
236
237 case T_INT:
238 /* FIXME: Perhaps the size should depend upon the architecture. */
239 ret = debug_make_int_type (dhandle, 4, false);
240 name = "int";
241 break;
242
243 case T_LONG:
244 ret = debug_make_int_type (dhandle, 4, false);
245 name = "long";
246 break;
247
248 case T_FLOAT:
249 ret = debug_make_float_type (dhandle, 4);
250 name = "float";
251 break;
252
253 case T_DOUBLE:
254 ret = debug_make_float_type (dhandle, 8);
255 name = "double";
256 break;
257
258 case T_LNGDBL:
259 ret = debug_make_float_type (dhandle, 12);
260 name = "long double";
261 break;
262
263 case T_UCHAR:
264 ret = debug_make_int_type (dhandle, 1, true);
265 name = "unsigned char";
266 break;
267
268 case T_USHORT:
269 ret = debug_make_int_type (dhandle, 2, true);
270 name = "unsigned short";
271 break;
272
273 case T_UINT:
274 ret = debug_make_int_type (dhandle, 4, true);
275 name = "unsigned int";
276 break;
277
278 case T_ULONG:
279 ret = debug_make_int_type (dhandle, 4, true);
280 name = "unsigned long";
281 break;
282
283 case T_STRUCT:
284 if (pauxent == NULL)
285 ret = debug_make_struct_type (dhandle, true, 0,
286 (debug_field *) NULL);
287 else
288 ret = parse_coff_struct_type (abfd, symbols, types, ntype, pauxent,
289 dhandle);
290 break;
291
292 case T_UNION:
293 if (pauxent == NULL)
294 ret = debug_make_struct_type (dhandle, false, 0, (debug_field *) NULL);
295 else
296 ret = parse_coff_struct_type (abfd, symbols, types, ntype, pauxent,
297 dhandle);
298 break;
299
300 case T_ENUM:
301 if (pauxent == NULL)
302 ret = debug_make_enum_type (dhandle, (const char **) NULL,
303 (bfd_signed_vma *) NULL);
304 else
305 ret = parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle);
306 break;
307 }
308
309 if (name != NULL)
310 ret = debug_name_type (dhandle, name, ret);
311
312 debug_type *slot = coff_get_slot (dhandle, types, coff_symno);
313 *slot = ret;
314
315 return ret;
316 }
317
318 /* Parse a struct type. */
319
320 static debug_type
321 parse_coff_struct_type (bfd *abfd, struct coff_symbols *symbols,
322 struct coff_types **types, int ntype,
323 union internal_auxent *pauxent, void *dhandle)
324 {
325 long symend;
326 int alloc;
327 debug_field *fields, *xfields;
328 int count;
329 bool done;
330
331 symend = pauxent->x_sym.x_fcnary.x_fcn.x_endndx.u32;
332
333 alloc = 10;
334 fields = (debug_field *) xmalloc (alloc * sizeof *fields);
335 count = 0;
336
337 done = false;
338 while (! done
339 && symbols->coff_symno < symend
340 && symbols->symno < symbols->symcount)
341 {
342 asymbol *sym;
343 long this_coff_symno;
344 struct internal_syment syment;
345 union internal_auxent auxent;
346 union internal_auxent *psubaux;
347 bfd_vma bitpos = 0, bitsize = 0;
348
349 sym = symbols->syms[symbols->symno];
350
351 if (! bfd_coff_get_syment (abfd, sym, &syment))
352 {
353 non_fatal (_("bfd_coff_get_syment failed: %s"),
354 bfd_errmsg (bfd_get_error ()));
355 free (fields);
356 return DEBUG_TYPE_NULL;
357 }
358
359 this_coff_symno = symbols->coff_symno;
360
361 ++symbols->symno;
362 symbols->coff_symno += 1 + syment.n_numaux;
363
364 if (syment.n_numaux == 0)
365 psubaux = NULL;
366 else
367 {
368 if (! bfd_coff_get_auxent (abfd, sym, 0, &auxent))
369 {
370 non_fatal (_("bfd_coff_get_auxent failed: %s"),
371 bfd_errmsg (bfd_get_error ()));
372 free (fields);
373 return DEBUG_TYPE_NULL;
374 }
375 psubaux = &auxent;
376 }
377
378 switch (syment.n_sclass)
379 {
380 case C_MOS:
381 case C_MOU:
382 bitpos = 8 * bfd_asymbol_value (sym);
383 bitsize = 0;
384 break;
385
386 case C_FIELD:
387 bitpos = bfd_asymbol_value (sym);
388 bitsize = auxent.x_sym.x_misc.x_lnsz.x_size;
389 break;
390
391 case C_EOS:
392 done = true;
393 break;
394 }
395
396 if (! done)
397 {
398 debug_type ftype;
399 debug_field f;
400
401 ftype = parse_coff_type (abfd, symbols, types, this_coff_symno,
402 syment.n_type, psubaux, true, dhandle);
403 f = debug_make_field (dhandle, bfd_asymbol_name (sym), ftype,
404 bitpos, bitsize, DEBUG_VISIBILITY_PUBLIC);
405 if (f == DEBUG_FIELD_NULL)
406 {
407 free (fields);
408 return DEBUG_TYPE_NULL;
409 }
410
411 if (count + 1 >= alloc)
412 {
413 alloc += 10;
414 fields = ((debug_field *)
415 xrealloc (fields, alloc * sizeof *fields));
416 }
417
418 fields[count] = f;
419 ++count;
420 }
421 }
422
423 fields[count] = DEBUG_FIELD_NULL;
424 xfields = debug_xalloc (dhandle, (count + 1) * sizeof (*fields));
425 memcpy (xfields, fields, (count + 1) * sizeof (*fields));
426 free (fields);
427
428 return debug_make_struct_type (dhandle, ntype == T_STRUCT,
429 pauxent->x_sym.x_misc.x_lnsz.x_size,
430 xfields);
431 }
432
433 /* Parse an enum type. */
434
435 static debug_type
436 parse_coff_enum_type (bfd *abfd, struct coff_symbols *symbols,
437 struct coff_types **types ATTRIBUTE_UNUSED,
438 union internal_auxent *pauxent, void *dhandle)
439 {
440 long symend;
441 int alloc;
442 const char **names, **xnames;
443 bfd_signed_vma *vals, *xvals;
444 int count;
445 bool done;
446
447 symend = pauxent->x_sym.x_fcnary.x_fcn.x_endndx.u32;
448
449 alloc = 10;
450 names = (const char **) xmalloc (alloc * sizeof *names);
451 vals = (bfd_signed_vma *) xmalloc (alloc * sizeof *vals);
452 count = 0;
453
454 done = false;
455 while (! done
456 && symbols->coff_symno < symend
457 && symbols->symno < symbols->symcount)
458 {
459 asymbol *sym;
460 struct internal_syment syment;
461
462 sym = symbols->syms[symbols->symno];
463
464 if (! bfd_coff_get_syment (abfd, sym, &syment))
465 {
466 non_fatal (_("bfd_coff_get_syment failed: %s"),
467 bfd_errmsg (bfd_get_error ()));
468 free (names);
469 free (vals);
470 return DEBUG_TYPE_NULL;
471 }
472
473 ++symbols->symno;
474 symbols->coff_symno += 1 + syment.n_numaux;
475
476 switch (syment.n_sclass)
477 {
478 case C_MOE:
479 if (count + 1 >= alloc)
480 {
481 alloc += 10;
482 names = ((const char **)
483 xrealloc (names, alloc * sizeof *names));
484 vals = ((bfd_signed_vma *)
485 xrealloc (vals, alloc * sizeof *vals));
486 }
487
488 names[count] = bfd_asymbol_name (sym);
489 vals[count] = bfd_asymbol_value (sym);
490 ++count;
491 break;
492
493 case C_EOS:
494 done = true;
495 break;
496 }
497 }
498
499 names[count] = NULL;
500 vals[count] = 0;
501 xnames = debug_xalloc (dhandle, (count + 1) * sizeof (*names));
502 memcpy (xnames, names, (count + 1) * sizeof (*names));
503 free (names);
504 xvals = debug_xalloc (dhandle, (count + 1) * sizeof (*vals));
505 memcpy (xvals, vals, (count + 1) * sizeof (*vals));
506 free (vals);
507
508 return debug_make_enum_type (dhandle, xnames, xvals);
509 }
510
511 /* Handle a single COFF symbol. */
512
513 static bool
514 parse_coff_symbol (bfd *abfd ATTRIBUTE_UNUSED, struct coff_types **types,
515 asymbol *sym, long coff_symno,
516 struct internal_syment *psyment, void *dhandle,
517 debug_type type, bool within_function)
518 {
519 switch (psyment->n_sclass)
520 {
521 case C_NULL:
522 break;
523
524 case C_AUTO:
525 if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
526 DEBUG_LOCAL, bfd_asymbol_value (sym)))
527 return false;
528 break;
529
530 case C_WEAKEXT:
531 case C_EXT:
532 if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
533 DEBUG_GLOBAL, bfd_asymbol_value (sym)))
534 return false;
535 break;
536
537 case C_STAT:
538 if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
539 (within_function
540 ? DEBUG_LOCAL_STATIC
541 : DEBUG_STATIC),
542 bfd_asymbol_value (sym)))
543 return false;
544 break;
545
546 case C_REG:
547 /* FIXME: We may need to convert the register number. */
548 if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
549 DEBUG_REGISTER, bfd_asymbol_value (sym)))
550 return false;
551 break;
552
553 case C_LABEL:
554 break;
555
556 case C_ARG:
557 if (! debug_record_parameter (dhandle, bfd_asymbol_name (sym), type,
558 DEBUG_PARM_STACK, bfd_asymbol_value (sym)))
559 return false;
560 break;
561
562 case C_REGPARM:
563 /* FIXME: We may need to convert the register number. */
564 if (! debug_record_parameter (dhandle, bfd_asymbol_name (sym), type,
565 DEBUG_PARM_REG, bfd_asymbol_value (sym)))
566 return false;
567 break;
568
569 case C_TPDEF:
570 type = debug_name_type (dhandle, bfd_asymbol_name (sym), type);
571 if (type == DEBUG_TYPE_NULL)
572 return false;
573 break;
574
575 case C_STRTAG:
576 case C_UNTAG:
577 case C_ENTAG:
578 {
579 debug_type *slot;
580
581 type = debug_tag_type (dhandle, bfd_asymbol_name (sym), type);
582 if (type == DEBUG_TYPE_NULL)
583 return false;
584
585 /* Store the named type into the slot, so that references get
586 the name. */
587 slot = coff_get_slot (dhandle, types, coff_symno);
588 *slot = type;
589 }
590 break;
591
592 default:
593 break;
594 }
595
596 return true;
597 }
598
599 /* Determine if a symbol has external visibility. */
600
601 static bool
602 external_coff_symbol_p (int sym_class)
603 {
604 switch (sym_class)
605 {
606 case C_EXT:
607 case C_WEAKEXT:
608 return true;
609 default:
610 break;
611 }
612 return false;
613 }
614
615 /* This is the main routine. It looks through all the symbols and
616 handles them. */
617
618 bool
619 parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle)
620 {
621 struct coff_symbols symbols;
622 struct coff_types *types;
623 long next_c_file;
624 const char *fnname;
625 int fnclass;
626 int fntype;
627 bfd_vma fnend;
628 alent *linenos;
629 bool within_function;
630 long this_coff_symno;
631
632 symbols.syms = syms;
633 symbols.symcount = symcount;
634 symbols.symno = 0;
635 symbols.coff_symno = 0;
636
637 types= NULL;
638
639 next_c_file = -1;
640 fnname = NULL;
641 fnclass = 0;
642 fntype = 0;
643 fnend = 0;
644 linenos = NULL;
645 within_function = false;
646
647 while (symbols.symno < symcount)
648 {
649 asymbol *sym;
650 const char *name;
651 struct internal_syment syment;
652 union internal_auxent auxent;
653 union internal_auxent *paux;
654 debug_type type;
655
656 sym = syms[symbols.symno];
657
658 if (! bfd_coff_get_syment (abfd, sym, &syment))
659 {
660 non_fatal (_("bfd_coff_get_syment failed: %s"),
661 bfd_errmsg (bfd_get_error ()));
662 return false;
663 }
664
665 name = bfd_asymbol_name (sym);
666
667 this_coff_symno = symbols.coff_symno;
668
669 ++symbols.symno;
670 symbols.coff_symno += 1 + syment.n_numaux;
671
672 /* We only worry about the first auxent, because that is the
673 only one which is relevant for debugging information. */
674 if (syment.n_numaux == 0)
675 paux = NULL;
676 else
677 {
678 if (! bfd_coff_get_auxent (abfd, sym, 0, &auxent))
679 {
680 non_fatal (_("bfd_coff_get_auxent failed: %s"),
681 bfd_errmsg (bfd_get_error ()));
682 return false;
683 }
684 paux = &auxent;
685 }
686
687 if (this_coff_symno == next_c_file && syment.n_sclass != C_FILE)
688 {
689 /* The last C_FILE symbol points to the first external
690 symbol. */
691 if (! debug_set_filename (dhandle, "*globals*"))
692 return false;
693 }
694
695 switch (syment.n_sclass)
696 {
697 case C_EFCN:
698 case C_EXTDEF:
699 case C_ULABEL:
700 case C_USTATIC:
701 case C_LINE:
702 case C_ALIAS:
703 case C_HIDDEN:
704 /* Just ignore these classes. */
705 break;
706
707 case C_FILE:
708 next_c_file = syment.n_value;
709 if (! debug_set_filename (dhandle, name))
710 return false;
711 break;
712
713 case C_STAT:
714 /* Ignore static symbols with a type of T_NULL. These
715 represent section entries. */
716 if (syment.n_type == T_NULL)
717 break;
718 /* Fall through. */
719 case C_WEAKEXT:
720 case C_EXT:
721 if (ISFCN (syment.n_type))
722 {
723 fnname = name;
724 fnclass = syment.n_sclass;
725 fntype = syment.n_type;
726 if (syment.n_numaux > 0)
727 fnend = bfd_asymbol_value (sym) + auxent.x_sym.x_misc.x_fsize;
728 else
729 fnend = 0;
730 linenos = BFD_SEND (abfd, _get_lineno, (abfd, sym));
731 break;
732 }
733 type = parse_coff_type (abfd, &symbols, &types, this_coff_symno,
734 syment.n_type, paux, true, dhandle);
735 if (type == DEBUG_TYPE_NULL)
736 return false;
737 if (! parse_coff_symbol (abfd, &types, sym, this_coff_symno, &syment,
738 dhandle, type, within_function))
739 return false;
740 break;
741
742 case C_FCN:
743 if (strcmp (name, ".bf") == 0)
744 {
745 if (fnname == NULL)
746 {
747 non_fatal (_("%ld: .bf without preceding function"),
748 this_coff_symno);
749 return false;
750 }
751
752 type = parse_coff_type (abfd, &symbols, &types, this_coff_symno,
753 DECREF (fntype), paux, false, dhandle);
754 if (type == DEBUG_TYPE_NULL)
755 return false;
756
757 if (! debug_record_function (dhandle, fnname, type,
758 external_coff_symbol_p (fnclass),
759 bfd_asymbol_value (sym)))
760 return false;
761
762 if (linenos != NULL)
763 {
764 int base;
765 bfd_vma addr;
766
767 if (syment.n_numaux == 0)
768 base = 0;
769 else
770 base = auxent.x_sym.x_misc.x_lnsz.x_lnno - 1;
771
772 addr = bfd_section_vma (bfd_asymbol_section (sym));
773
774 ++linenos;
775
776 while (linenos->line_number != 0)
777 {
778 if (! debug_record_line (dhandle,
779 linenos->line_number + base,
780 linenos->u.offset + addr))
781 return false;
782 ++linenos;
783 }
784 }
785
786 fnname = NULL;
787 linenos = NULL;
788 fnclass = 0;
789 fntype = 0;
790
791 within_function = true;
792 }
793 else if (strcmp (name, ".ef") == 0)
794 {
795 if (! within_function)
796 {
797 non_fatal (_("%ld: unexpected .ef\n"), this_coff_symno);
798 return false;
799 }
800
801 if (bfd_asymbol_value (sym) > fnend)
802 fnend = bfd_asymbol_value (sym);
803 if (! debug_end_function (dhandle, fnend))
804 return false;
805
806 fnend = 0;
807 within_function = false;
808 }
809 break;
810
811 case C_BLOCK:
812 if (strcmp (name, ".bb") == 0)
813 {
814 if (! debug_start_block (dhandle, bfd_asymbol_value (sym)))
815 return false;
816 }
817 else if (strcmp (name, ".eb") == 0)
818 {
819 if (! debug_end_block (dhandle, bfd_asymbol_value (sym)))
820 return false;
821 }
822 break;
823
824 default:
825 type = parse_coff_type (abfd, &symbols, &types, this_coff_symno,
826 syment.n_type, paux, true, dhandle);
827 if (type == DEBUG_TYPE_NULL)
828 return false;
829 if (! parse_coff_symbol (abfd, &types, sym, this_coff_symno, &syment,
830 dhandle, type, within_function))
831 return false;
832 break;
833 }
834 }
835
836 return true;
837 }