]> Git Repo - binutils.git/blob - gas/dwarf2dbg.c
[ gas/ChangeLog ]
[binutils.git] / gas / dwarf2dbg.c
1 /* dwarf2dbg.c - DWARF2 debug support
2    Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
3    Contributed by David Mosberger-Tang <[email protected]>
4
5    This file is part of GAS, the GNU Assembler.
6
7    GAS 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 2, or (at your option)
10    any later version.
11
12    GAS 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 GAS; see the file COPYING.  If not, write to the Free
19    Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20    02111-1307, USA.  */
21
22 /* Logical line numbers can be controlled by the compiler via the
23    following two directives:
24
25         .file FILENO "file.c"
26         .loc  FILENO LINENO [COLUMN]
27
28    FILENO is the filenumber.  */
29
30 #include "ansidecl.h"
31 #include "as.h"
32
33 #ifdef HAVE_LIMITS_H
34 #include <limits.h>
35 #else
36 #ifdef HAVE_SYS_PARAM_H
37 #include <sys/param.h>
38 #endif
39 #ifndef INT_MAX
40 #define INT_MAX (int) (((unsigned) (-1)) >> 1)
41 #endif
42 #endif
43
44 #include "dwarf2dbg.h"
45 #include <filenames.h>
46
47 #ifndef DWARF2_FORMAT
48 # define DWARF2_FORMAT() dwarf2_format_32bit
49 #endif
50
51 #ifndef DWARF2_ADDR_SIZE
52 # define DWARF2_ADDR_SIZE(bfd) (bfd_arch_bits_per_address (bfd) / 8);
53 #endif
54
55 #ifndef TC_DWARF2_EMIT_OFFSET
56 # define TC_DWARF2_EMIT_OFFSET  generic_dwarf2_emit_offset
57 #endif
58
59 #ifdef BFD_ASSEMBLER
60
61 #include "subsegs.h"
62
63 #include "elf/dwarf2.h"
64
65 /* Since we can't generate the prolog until the body is complete, we
66    use three different subsegments for .debug_line: one holding the
67    prolog, one for the directory and filename info, and one for the
68    body ("statement program").  */
69 #define DL_PROLOG       0
70 #define DL_FILES        1
71 #define DL_BODY         2
72
73 /* First special line opcde - leave room for the standard opcodes.
74    Note: If you want to change this, you'll have to update the
75    "standard_opcode_lengths" table that is emitted below in
76    dwarf2_finish().  */
77 #define DWARF2_LINE_OPCODE_BASE         10
78
79 #ifndef DWARF2_LINE_BASE
80   /* Minimum line offset in a special line info. opcode.  This value
81      was chosen to give a reasonable range of values.  */
82 # define DWARF2_LINE_BASE               -5
83 #endif
84
85 /* Range of line offsets in a special line info. opcode.  */
86 #ifndef DWARF2_LINE_RANGE
87 # define DWARF2_LINE_RANGE              14
88 #endif
89
90 #ifndef DWARF2_LINE_MIN_INSN_LENGTH
91   /* Define the architecture-dependent minimum instruction length (in
92      bytes).  This value should be rather too small than too big.  */
93 # define DWARF2_LINE_MIN_INSN_LENGTH    1
94 #endif
95
96 /* Flag that indicates the initial value of the is_stmt_start flag.
97    In the present implementation, we do not mark any lines as
98    the beginning of a source statement, because that information
99    is not made available by the GCC front-end.  */
100 #define DWARF2_LINE_DEFAULT_IS_STMT     1
101
102 /* Given a special op, return the line skip amount.  */
103 #define SPECIAL_LINE(op) \
104         (((op) - DWARF2_LINE_OPCODE_BASE)%DWARF2_LINE_RANGE + DWARF2_LINE_BASE)
105
106 /* Given a special op, return the address skip amount (in units of
107    DWARF2_LINE_MIN_INSN_LENGTH.  */
108 #define SPECIAL_ADDR(op) (((op) - DWARF2_LINE_OPCODE_BASE)/DWARF2_LINE_RANGE)
109
110 /* The maximum address skip amount that can be encoded with a special op.  */
111 #define MAX_SPECIAL_ADDR_DELTA          SPECIAL_ADDR(255)
112
113 struct line_entry {
114   struct line_entry *next;
115   fragS *frag;
116   addressT frag_ofs;
117   struct dwarf2_line_info loc;
118 };
119
120 struct line_subseg {
121   struct line_subseg *next;
122   subsegT subseg;
123   struct line_entry *head;
124   struct line_entry **ptail;
125 };
126
127 struct line_seg {
128   struct line_seg *next;
129   segT seg;
130   struct line_subseg *head;
131   symbolS *text_start;
132   symbolS *text_end;
133 };
134
135 /* Collects data for all line table entries during assembly.  */
136 static struct line_seg *all_segs;
137
138 struct file_entry {
139   const char *filename;
140   unsigned int dir;
141 };
142
143 /* Table of files used by .debug_line.  */
144 static struct file_entry *files;
145 static unsigned int files_in_use;
146 static unsigned int files_allocated;
147
148 /* Table of directories used by .debug_line.  */
149 static char **dirs;
150 static unsigned int dirs_in_use;
151 static unsigned int dirs_allocated;
152
153 /* TRUE when we've seen a .loc directive recently.  Used to avoid
154    doing work when there's nothing to do.  */
155 static bfd_boolean loc_directive_seen;
156
157 /* Current location as indicated by the most recent .loc directive.  */
158 static struct dwarf2_line_info current;
159
160 /* The size of an address on the target.  */
161 static unsigned int sizeof_address;
162 \f
163 static void generic_dwarf2_emit_offset PARAMS((symbolS *, unsigned int));
164 static struct line_subseg *get_line_subseg PARAMS ((segT, subsegT));
165 static unsigned int get_filenum PARAMS ((const char *, unsigned int));
166 static struct frag *first_frag_for_seg PARAMS ((segT));
167 static struct frag *last_frag_for_seg PARAMS ((segT));
168 static void out_byte PARAMS ((int));
169 static void out_opcode PARAMS ((int));
170 static void out_two PARAMS ((int));
171 static void out_four PARAMS ((int));
172 static void out_abbrev PARAMS ((int, int));
173 static void out_uleb128 PARAMS ((addressT));
174 static offsetT get_frag_fix PARAMS ((fragS *));
175 static void out_set_addr PARAMS ((segT, fragS *, addressT));
176 static int size_inc_line_addr PARAMS ((int, addressT));
177 static void emit_inc_line_addr PARAMS ((int, addressT, char *, int));
178 static void out_inc_line_addr PARAMS ((int, addressT));
179 static void relax_inc_line_addr PARAMS ((int, segT, fragS *, addressT,
180                                          fragS *, addressT));
181 static void process_entries PARAMS ((segT, struct line_entry *));
182 static void out_file_list PARAMS ((void));
183 static void out_debug_line PARAMS ((segT));
184 static void out_debug_aranges PARAMS ((segT, segT));
185 static void out_debug_abbrev PARAMS ((segT));
186 static void out_debug_info PARAMS ((segT, segT, segT));
187 \f
188 /* Create an offset to .dwarf2_*.  */
189
190 static void
191 generic_dwarf2_emit_offset (symbol, size)
192      symbolS *symbol;
193      unsigned int size;
194 {
195   expressionS expr;
196
197   expr.X_op = O_symbol;
198   expr.X_add_symbol = symbol;
199   expr.X_add_number = 0;
200   emit_expr (&expr, size);
201 }
202
203 /* Find or create an entry for SEG+SUBSEG in ALL_SEGS.  */
204
205 static struct line_subseg *
206 get_line_subseg (seg, subseg)
207      segT seg;
208      subsegT subseg;
209 {
210   static segT last_seg;
211   static subsegT last_subseg;
212   static struct line_subseg *last_line_subseg;
213
214   struct line_seg *s;
215   struct line_subseg **pss, *ss;
216
217   if (seg == last_seg && subseg == last_subseg)
218     return last_line_subseg;
219
220   for (s = all_segs; s; s = s->next)
221     if (s->seg == seg)
222       goto found_seg;
223
224   s = (struct line_seg *) xmalloc (sizeof (*s));
225   s->next = all_segs;
226   s->seg = seg;
227   s->head = NULL;
228   all_segs = s;
229
230  found_seg:
231   for (pss = &s->head; (ss = *pss) != NULL ; pss = &ss->next)
232     {
233       if (ss->subseg == subseg)
234         goto found_subseg;
235       if (ss->subseg > subseg)
236         break;
237     }
238
239   ss = (struct line_subseg *) xmalloc (sizeof (*ss));
240   ss->next = *pss;
241   ss->subseg = subseg;
242   ss->head = NULL;
243   ss->ptail = &ss->head;
244   *pss = ss;
245
246  found_subseg:
247   last_seg = seg;
248   last_subseg = subseg;
249   last_line_subseg = ss;
250
251   return ss;
252 }
253
254 /* Record an entry for LOC ocurring at OFS within the current fragment.  */
255
256 void
257 dwarf2_gen_line_info (ofs, loc)
258      addressT ofs;
259      struct dwarf2_line_info *loc;
260 {
261   struct line_subseg *ss;
262   struct line_entry *e;
263   static unsigned int line = -1;
264   static unsigned int filenum = -1;
265
266   /* Early out for as-yet incomplete location information.  */
267   if (loc->filenum == 0 || loc->line == 0)
268     return;
269
270   /* Don't emit sequences of line symbols for the same line when the
271      symbols apply to assembler code.  It is necessary to emit
272      duplicate line symbols when a compiler asks for them, because GDB
273      uses them to determine the end of the prologue.  */
274   if (debug_type == DEBUG_DWARF2
275       && line == loc->line && filenum == loc->filenum)
276     return;
277
278   line = loc->line;
279   filenum = loc->filenum;
280
281   e = (struct line_entry *) xmalloc (sizeof (*e));
282   e->next = NULL;
283   e->frag = frag_now;
284   e->frag_ofs = ofs;
285   e->loc = *loc;
286
287   ss = get_line_subseg (now_seg, now_subseg);
288   *ss->ptail = e;
289   ss->ptail = &e->next;
290 }
291
292 void
293 dwarf2_where (line)
294      struct dwarf2_line_info *line;
295 {
296   if (debug_type == DEBUG_DWARF2)
297     {
298       char *filename;
299       as_where (&filename, &line->line);
300       line->filenum = get_filenum (filename, 0);
301       line->column = 0;
302       line->flags = DWARF2_FLAG_BEGIN_STMT;
303     }
304   else
305     *line = current;
306 }
307
308 /* Called for each machine instruction, or relatively atomic group of
309    machine instructions (ie built-in macro).  The instruction or group
310    is SIZE bytes in length.  If dwarf2 line number generation is called
311    for, emit a line statement appropriately.  */
312
313 void
314 dwarf2_emit_insn (size)
315      int size;
316 {
317   struct dwarf2_line_info loc;
318
319   if (loc_directive_seen)
320     {
321       /* Use the last location established by a .loc directive, not
322          the value returned by dwarf2_where().  That calls as_where()
323          which will return either the logical input file name (foo.c)
324         or the physical input file name (foo.s) and not the file name
325         specified in the most recent .loc directive (eg foo.h).  */
326       loc = current;
327
328       /* Unless we generate DWARF2 debugging information for each
329          assembler line, we only emit one line symbol for one LOC.  */
330       if (debug_type != DEBUG_DWARF2)
331         loc_directive_seen = FALSE;
332     }
333   else if (debug_type != DEBUG_DWARF2)
334     return;
335   else
336     dwarf2_where (& loc);
337
338   dwarf2_gen_line_info (frag_now_fix () - size, &loc);
339 }
340
341 /* Get a .debug_line file number for FILENAME.  If NUM is nonzero,
342    allocate it on that file table slot, otherwise return the first
343    empty one.  */
344
345 static unsigned int
346 get_filenum (filename, num)
347      const char *filename;
348      unsigned int num;
349 {
350   static unsigned int last_used, last_used_dir_len;
351   const char *file;
352   size_t dir_len;
353   unsigned int i, dir;
354
355   if (num == 0 && last_used)
356     {
357       if (! files[last_used].dir
358           && strcmp (filename, files[last_used].filename) == 0)
359         return last_used;
360       if (files[last_used].dir
361           && strncmp (filename, dirs[files[last_used].dir],
362                       last_used_dir_len) == 0
363           && IS_DIR_SEPARATOR (filename [last_used_dir_len])
364           && strcmp (filename + last_used_dir_len + 1,
365                      files[last_used].filename) == 0)
366         return last_used;
367     }
368
369   file = lbasename (filename);
370   /* Don't make empty string from / or A: from A:/ .  */
371 #ifdef HAVE_DOS_BASED_FILE_SYSTEM
372   if (file <= filename + 3)
373     file = filename;
374 #else
375   if (file == filename + 1)
376     file = filename;
377 #endif
378   dir_len = file - filename;
379
380   dir = 0;
381   if (dir_len)
382     {
383       --dir_len;
384       for (dir = 1; dir < dirs_in_use; ++dir)
385         if (memcmp (filename, dirs[dir], dir_len) == 0
386             && dirs[dir][dir_len] == '\0')
387           break;
388
389       if (dir >= dirs_in_use)
390         {
391           if (dir >= dirs_allocated)
392             {
393               dirs_allocated = dir + 32;
394               dirs = (char **)
395                      xrealloc (dirs, (dir + 32) * sizeof (const char *));
396             }
397
398           dirs[dir] = xmalloc (dir_len + 1);
399           memcpy (dirs[dir], filename, dir_len);
400           dirs[dir][dir_len] = '\0';
401           dirs_in_use = dir + 1;
402         }
403     }
404
405   if (num == 0)
406     {
407       for (i = 1; i < files_in_use; ++i)
408         if (files[i].dir == dir
409             && files[i].filename
410             && strcmp (file, files[i].filename) == 0)
411           {
412             last_used = i;
413             last_used_dir_len = dir_len;
414             return i;
415           }
416     }
417   else
418     i = num;
419
420   if (i >= files_allocated)
421     {
422       unsigned int old = files_allocated;
423
424       files_allocated = i + 32;
425       files = (struct file_entry *)
426         xrealloc (files, (i + 32) * sizeof (struct file_entry));
427
428       memset (files + old, 0, (i + 32 - old) * sizeof (struct file_entry));
429     }
430
431   files[i].filename = num ? file : xstrdup (file);
432   files[i].dir = dir;
433   files_in_use = i + 1;
434   last_used = i;
435   last_used_dir_len = dir_len;
436
437   return i;
438 }
439
440 /* Handle two forms of .file directive:
441    - Pass .file "source.c" to s_app_file
442    - Handle .file 1 "source.c" by adding an entry to the DWARF-2 file table
443
444    If an entry is added to the file table, return a pointer to the filename. */
445
446 char *
447 dwarf2_directive_file (dummy)
448      int dummy ATTRIBUTE_UNUSED;
449 {
450   offsetT num;
451   char *filename;
452   int filename_len;
453
454   /* Continue to accept a bare string and pass it off.  */
455   SKIP_WHITESPACE ();
456   if (*input_line_pointer == '"')
457     {
458       s_app_file (0);
459       return NULL;
460     }
461
462   num = get_absolute_expression ();
463   filename = demand_copy_C_string (&filename_len);
464   demand_empty_rest_of_line ();
465
466   if (num < 1)
467     {
468       as_bad (_("file number less than one"));
469       return NULL;
470     }
471
472   if (num < (int) files_in_use && files[num].filename != 0)
473     {
474       as_bad (_("file number %ld already allocated"), (long) num);
475       return NULL;
476     }
477
478   get_filenum (filename, num);
479
480   return filename;
481 }
482
483 void
484 dwarf2_directive_loc (dummy)
485      int dummy ATTRIBUTE_UNUSED;
486 {
487   offsetT filenum, line, column;
488
489   filenum = get_absolute_expression ();
490   SKIP_WHITESPACE ();
491   line = get_absolute_expression ();
492   SKIP_WHITESPACE ();
493   column = get_absolute_expression ();
494   demand_empty_rest_of_line ();
495
496   if (filenum < 1)
497     {
498       as_bad (_("file number less than one"));
499       return;
500     }
501   if (filenum >= (int) files_in_use || files[filenum].filename == 0)
502     {
503       as_bad (_("unassigned file number %ld"), (long) filenum);
504       return;
505     }
506
507   current.filenum = filenum;
508   current.line = line;
509   current.column = column;
510   current.flags = DWARF2_FLAG_BEGIN_STMT;
511
512   loc_directive_seen = TRUE;
513
514 #ifndef NO_LISTING
515   if (listing)
516     {
517       if (files[filenum].dir)
518         {
519           size_t dir_len = strlen (dirs[files[filenum].dir]);
520           size_t file_len = strlen (files[filenum].filename);
521           char *cp = (char *) alloca (dir_len + 1 + file_len + 1);
522
523           memcpy (cp, dirs[files[filenum].dir], dir_len);
524           cp[dir_len] = '/';
525           memcpy (cp + dir_len + 1, files[filenum].filename, file_len);
526           cp[dir_len + file_len + 1] = '\0';
527           listing_source_file (cp);
528         }
529       else
530         listing_source_file (files[filenum].filename);
531       listing_source_line (line);
532     }
533 #endif
534 }
535 \f
536 static struct frag *
537 first_frag_for_seg (seg)
538      segT seg;
539 {
540   frchainS *f, *first = NULL;
541
542   for (f = frchain_root; f; f = f->frch_next)
543     if (f->frch_seg == seg
544         && (! first || first->frch_subseg > f->frch_subseg))
545       first = f;
546
547   return first ? first->frch_root : NULL;
548 }
549
550 static struct frag *
551 last_frag_for_seg (seg)
552      segT seg;
553 {
554   frchainS *f, *last = NULL;
555
556   for (f = frchain_root; f; f = f->frch_next)
557     if (f->frch_seg == seg
558         && (! last || last->frch_subseg < f->frch_subseg))
559       last= f;
560
561   return last ? last->frch_last : NULL;
562 }
563 \f
564 /* Emit a single byte into the current segment.  */
565
566 static inline void
567 out_byte (byte)
568      int byte;
569 {
570   FRAG_APPEND_1_CHAR (byte);
571 }
572
573 /* Emit a statement program opcode into the current segment.  */
574
575 static inline void
576 out_opcode (opc)
577      int opc;
578 {
579   out_byte (opc);
580 }
581
582 /* Emit a two-byte word into the current segment.  */
583
584 static inline void
585 out_two (data)
586      int data;
587 {
588   md_number_to_chars (frag_more (2), data, 2);
589 }
590
591 /* Emit a four byte word into the current segment.  */
592
593 static inline void
594 out_four (data)
595      int data;
596 {
597   md_number_to_chars (frag_more (4), data, 4);
598 }
599
600 /* Emit an unsigned "little-endian base 128" number.  */
601
602 static void
603 out_uleb128 (value)
604      addressT value;
605 {
606   output_leb128 (frag_more (sizeof_leb128 (value, 0)), value, 0);
607 }
608
609 /* Emit a tuple for .debug_abbrev.  */
610
611 static inline void
612 out_abbrev (name, form)
613      int name, form;
614 {
615   out_uleb128 (name);
616   out_uleb128 (form);
617 }
618
619 /* Get the size of a fragment.  */
620
621 static offsetT
622 get_frag_fix (frag)
623      fragS *frag;
624 {
625   frchainS *fr;
626
627   if (frag->fr_next)
628     return frag->fr_fix;
629
630   /* If a fragment is the last in the chain, special measures must be
631      taken to find its size before relaxation, since it may be pending
632      on some subsegment chain.  */
633   for (fr = frchain_root; fr; fr = fr->frch_next)
634     if (fr->frch_last == frag)
635       {
636         long align_mask = -1 << get_recorded_alignment (fr->frch_seg);
637         return (((char *) obstack_next_free (&fr->frch_obstack)
638                  - frag->fr_literal) + ~align_mask) & align_mask;
639       }
640
641   abort ();
642 }
643
644 /* Set an absolute address (may result in a relocation entry).  */
645
646 static void
647 out_set_addr (seg, frag, ofs)
648      segT seg;
649      fragS *frag;
650      addressT ofs;
651 {
652   expressionS expr;
653   symbolS *sym;
654
655   sym = symbol_temp_new (seg, ofs, frag);
656
657   out_opcode (DW_LNS_extended_op);
658   out_uleb128 (sizeof_address + 1);
659
660   out_opcode (DW_LNE_set_address);
661   expr.X_op = O_symbol;
662   expr.X_add_symbol = sym;
663   expr.X_add_number = 0;
664   emit_expr (&expr, sizeof_address);
665 }
666
667 #if DWARF2_LINE_MIN_INSN_LENGTH > 1
668 static void scale_addr_delta PARAMS ((addressT *));
669
670 static void
671 scale_addr_delta (addr_delta)
672      addressT *addr_delta;
673 {
674   static int printed_this = 0;
675   if (*addr_delta % DWARF2_LINE_MIN_INSN_LENGTH != 0)
676     {
677       if (!printed_this)
678         as_bad("unaligned opcodes detected in executable segment");
679       printed_this = 1;
680     }
681   *addr_delta /= DWARF2_LINE_MIN_INSN_LENGTH;
682 }
683 #else
684 #define scale_addr_delta(A)
685 #endif
686
687 /* Encode a pair of line and address skips as efficiently as possible.
688    Note that the line skip is signed, whereas the address skip is unsigned.
689
690    The following two routines *must* be kept in sync.  This is
691    enforced by making emit_inc_line_addr abort if we do not emit
692    exactly the expected number of bytes.  */
693
694 static int
695 size_inc_line_addr (line_delta, addr_delta)
696      int line_delta;
697      addressT addr_delta;
698 {
699   unsigned int tmp, opcode;
700   int len = 0;
701
702   /* Scale the address delta by the minimum instruction length.  */
703   scale_addr_delta (&addr_delta);
704
705   /* INT_MAX is a signal that this is actually a DW_LNE_end_sequence.
706      We cannot use special opcodes here, since we want the end_sequence
707      to emit the matrix entry.  */
708   if (line_delta == INT_MAX)
709     {
710       if (addr_delta == MAX_SPECIAL_ADDR_DELTA)
711         len = 1;
712       else
713         len = 1 + sizeof_leb128 (addr_delta, 0);
714       return len + 3;
715     }
716
717   /* Bias the line delta by the base.  */
718   tmp = line_delta - DWARF2_LINE_BASE;
719
720   /* If the line increment is out of range of a special opcode, we
721      must encode it with DW_LNS_advance_line.  */
722   if (tmp >= DWARF2_LINE_RANGE)
723     {
724       len = 1 + sizeof_leb128 (line_delta, 1);
725       line_delta = 0;
726       tmp = 0 - DWARF2_LINE_BASE;
727     }
728
729   /* Bias the opcode by the special opcode base.  */
730   tmp += DWARF2_LINE_OPCODE_BASE;
731
732   /* Avoid overflow when addr_delta is large.  */
733   if (addr_delta < 256 + MAX_SPECIAL_ADDR_DELTA)
734     {
735       /* Try using a special opcode.  */
736       opcode = tmp + addr_delta * DWARF2_LINE_RANGE;
737       if (opcode <= 255)
738         return len + 1;
739
740       /* Try using DW_LNS_const_add_pc followed by special op.  */
741       opcode = tmp + (addr_delta - MAX_SPECIAL_ADDR_DELTA) * DWARF2_LINE_RANGE;
742       if (opcode <= 255)
743         return len + 2;
744     }
745
746   /* Otherwise use DW_LNS_advance_pc.  */
747   len += 1 + sizeof_leb128 (addr_delta, 0);
748
749   /* DW_LNS_copy or special opcode.  */
750   len += 1;
751
752   return len;
753 }
754
755 static void
756 emit_inc_line_addr (line_delta, addr_delta, p, len)
757      int line_delta;
758      addressT addr_delta;
759      char *p;
760      int len;
761 {
762   unsigned int tmp, opcode;
763   int need_copy = 0;
764   char *end = p + len;
765
766   /* Scale the address delta by the minimum instruction length.  */
767   scale_addr_delta (&addr_delta);
768
769   /* INT_MAX is a signal that this is actually a DW_LNE_end_sequence.
770      We cannot use special opcodes here, since we want the end_sequence
771      to emit the matrix entry.  */
772   if (line_delta == INT_MAX)
773     {
774       if (addr_delta == MAX_SPECIAL_ADDR_DELTA)
775         *p++ = DW_LNS_const_add_pc;
776       else
777         {
778           *p++ = DW_LNS_advance_pc;
779           p += output_leb128 (p, addr_delta, 0);
780         }
781
782       *p++ = DW_LNS_extended_op;
783       *p++ = 1;
784       *p++ = DW_LNE_end_sequence;
785       goto done;
786     }
787
788   /* Bias the line delta by the base.  */
789   tmp = line_delta - DWARF2_LINE_BASE;
790
791   /* If the line increment is out of range of a special opcode, we
792      must encode it with DW_LNS_advance_line.  */
793   if (tmp >= DWARF2_LINE_RANGE)
794     {
795       *p++ = DW_LNS_advance_line;
796       p += output_leb128 (p, line_delta, 1);
797
798       /* Prettier, I think, to use DW_LNS_copy instead of a
799          "line +0, addr +0" special opcode.  */
800       if (addr_delta == 0)
801         {
802           *p++ = DW_LNS_copy;
803           goto done;
804         }
805
806       line_delta = 0;
807       tmp = 0 - DWARF2_LINE_BASE;
808       need_copy = 1;
809     }
810
811   /* Bias the opcode by the special opcode base.  */
812   tmp += DWARF2_LINE_OPCODE_BASE;
813
814   /* Avoid overflow when addr_delta is large.  */
815   if (addr_delta < 256 + MAX_SPECIAL_ADDR_DELTA)
816     {
817       /* Try using a special opcode.  */
818       opcode = tmp + addr_delta * DWARF2_LINE_RANGE;
819       if (opcode <= 255)
820         {
821           *p++ = opcode;
822           goto done;
823         }
824
825       /* Try using DW_LNS_const_add_pc followed by special op.  */
826       opcode = tmp + (addr_delta - MAX_SPECIAL_ADDR_DELTA) * DWARF2_LINE_RANGE;
827       if (opcode <= 255)
828         {
829           *p++ = DW_LNS_const_add_pc;
830           *p++ = opcode;
831           goto done;
832         }
833     }
834
835   /* Otherwise use DW_LNS_advance_pc.  */
836   *p++ = DW_LNS_advance_pc;
837   p += output_leb128 (p, addr_delta, 0);
838
839   if (need_copy)
840     *p++ = DW_LNS_copy;
841   else
842     *p++ = tmp;
843
844  done:
845   assert (p == end);
846 }
847
848 /* Handy routine to combine calls to the above two routines.  */
849
850 static void
851 out_inc_line_addr (line_delta, addr_delta)
852      int line_delta;
853      addressT addr_delta;
854 {
855   int len = size_inc_line_addr (line_delta, addr_delta);
856   emit_inc_line_addr (line_delta, addr_delta, frag_more (len), len);
857 }
858
859 /* Generate a variant frag that we can use to relax address/line
860    increments between fragments of the target segment.  */
861
862 static void
863 relax_inc_line_addr (line_delta, seg, to_frag, to_ofs, from_frag, from_ofs)
864      int line_delta;
865      segT seg;
866      fragS *to_frag, *from_frag;
867      addressT to_ofs, from_ofs;
868 {
869   symbolS *to_sym, *from_sym;
870   expressionS expr;
871   int max_chars;
872
873   to_sym = symbol_temp_new (seg, to_ofs, to_frag);
874   from_sym = symbol_temp_new (seg, from_ofs, from_frag);
875
876   expr.X_op = O_subtract;
877   expr.X_add_symbol = to_sym;
878   expr.X_op_symbol = from_sym;
879   expr.X_add_number = 0;
880
881   /* The maximum size of the frag is the line delta with a maximum
882      sized address delta.  */
883   max_chars = size_inc_line_addr (line_delta, -DWARF2_LINE_MIN_INSN_LENGTH);
884
885   frag_var (rs_dwarf2dbg, max_chars, max_chars, 1,
886             make_expr_symbol (&expr), line_delta, NULL);
887 }
888
889 /* The function estimates the size of a rs_dwarf2dbg variant frag
890    based on the current values of the symbols.  It is called before
891    the relaxation loop.  We set fr_subtype to the expected length.  */
892
893 int
894 dwarf2dbg_estimate_size_before_relax (frag)
895      fragS *frag;
896 {
897   offsetT addr_delta;
898   int size;
899
900   addr_delta = resolve_symbol_value (frag->fr_symbol);
901   size = size_inc_line_addr (frag->fr_offset, addr_delta);
902
903   frag->fr_subtype = size;
904
905   return size;
906 }
907
908 /* This function relaxes a rs_dwarf2dbg variant frag based on the
909    current values of the symbols.  fr_subtype is the current length
910    of the frag.  This returns the change in frag length.  */
911
912 int
913 dwarf2dbg_relax_frag (frag)
914      fragS *frag;
915 {
916   int old_size, new_size;
917
918   old_size = frag->fr_subtype;
919   new_size = dwarf2dbg_estimate_size_before_relax (frag);
920
921   return new_size - old_size;
922 }
923
924 /* This function converts a rs_dwarf2dbg variant frag into a normal
925    fill frag.  This is called after all relaxation has been done.
926    fr_subtype will be the desired length of the frag.  */
927
928 void
929 dwarf2dbg_convert_frag (frag)
930      fragS *frag;
931 {
932   offsetT addr_diff;
933
934   addr_diff = resolve_symbol_value (frag->fr_symbol);
935
936   /* fr_var carries the max_chars that we created the fragment with.
937      fr_subtype carries the current expected length.  We must, of
938      course, have allocated enough memory earlier.  */
939   assert (frag->fr_var >= (int) frag->fr_subtype);
940
941   emit_inc_line_addr (frag->fr_offset, addr_diff,
942                       frag->fr_literal + frag->fr_fix, frag->fr_subtype);
943
944   frag->fr_fix += frag->fr_subtype;
945   frag->fr_type = rs_fill;
946   frag->fr_var = 0;
947   frag->fr_offset = 0;
948 }
949
950 /* Generate .debug_line content for the chain of line number entries
951    beginning at E, for segment SEG.  */
952
953 static void
954 process_entries (seg, e)
955      segT seg;
956      struct line_entry *e;
957 {
958   unsigned filenum = 1;
959   unsigned line = 1;
960   unsigned column = 0;
961   unsigned flags = DWARF2_LINE_DEFAULT_IS_STMT ? DWARF2_FLAG_BEGIN_STMT : 0;
962   fragS *frag = NULL;
963   fragS *last_frag;
964   addressT frag_ofs = 0;
965   addressT last_frag_ofs;
966   struct line_entry *next;
967
968   while (e)
969     {
970       int changed = 0;
971
972       if (filenum != e->loc.filenum)
973         {
974           filenum = e->loc.filenum;
975           out_opcode (DW_LNS_set_file);
976           out_uleb128 (filenum);
977           changed = 1;
978         }
979
980       if (column != e->loc.column)
981         {
982           column = e->loc.column;
983           out_opcode (DW_LNS_set_column);
984           out_uleb128 (column);
985           changed = 1;
986         }
987
988       if ((e->loc.flags ^ flags) & DWARF2_FLAG_BEGIN_STMT)
989         {
990           flags = e->loc.flags;
991           out_opcode (DW_LNS_negate_stmt);
992           changed = 1;
993         }
994
995       if (e->loc.flags & DWARF2_FLAG_BEGIN_BLOCK)
996         {
997           out_opcode (DW_LNS_set_basic_block);
998           changed = 1;
999         }
1000
1001       /* Don't try to optimize away redundant entries; gdb wants two
1002          entries for a function where the code starts on the same line as
1003          the {, and there's no way to identify that case here.  Trust gcc
1004          to optimize appropriately.  */
1005       if (1 /* line != e->loc.line || changed */)
1006         {
1007           int line_delta = e->loc.line - line;
1008           if (frag == NULL)
1009             {
1010               out_set_addr (seg, e->frag, e->frag_ofs);
1011               out_inc_line_addr (line_delta, 0);
1012             }
1013           else if (frag == e->frag)
1014             out_inc_line_addr (line_delta, e->frag_ofs - frag_ofs);
1015           else
1016             relax_inc_line_addr (line_delta, seg, e->frag, e->frag_ofs,
1017                                  frag, frag_ofs);
1018
1019           frag = e->frag;
1020           frag_ofs = e->frag_ofs;
1021           line = e->loc.line;
1022         }
1023       else if (frag == NULL)
1024         {
1025           out_set_addr (seg, e->frag, e->frag_ofs);
1026           frag = e->frag;
1027           frag_ofs = e->frag_ofs;
1028         }
1029
1030       next = e->next;
1031       free (e);
1032       e = next;
1033     }
1034
1035   /* Emit a DW_LNE_end_sequence for the end of the section.  */
1036   last_frag = last_frag_for_seg (seg);
1037   last_frag_ofs = get_frag_fix (last_frag);
1038   if (frag == last_frag)
1039     out_inc_line_addr (INT_MAX, last_frag_ofs - frag_ofs);
1040   else
1041     relax_inc_line_addr (INT_MAX, seg, last_frag, last_frag_ofs,
1042                          frag, frag_ofs);
1043 }
1044
1045 /* Emit the directory and file tables for .debug_line.  */
1046
1047 static void
1048 out_file_list ()
1049 {
1050   size_t size;
1051   char *cp;
1052   unsigned int i;
1053
1054   /* Emit directory list.  */
1055   for (i = 1; i < dirs_in_use; ++i)
1056     {
1057       size = strlen (dirs[i]) + 1;
1058       cp = frag_more (size);
1059       memcpy (cp, dirs[i], size);
1060     }
1061   /* Terminate it.  */
1062   out_byte ('\0');
1063
1064   for (i = 1; i < files_in_use; ++i)
1065     {
1066       if (files[i].filename == NULL)
1067         {
1068           as_bad (_("unassigned file number %ld"), (long) i);
1069           /* Prevent a crash later, particularly for file 1.  */
1070           files[i].filename = "";
1071           continue;
1072         }
1073
1074       size = strlen (files[i].filename) + 1;
1075       cp = frag_more (size);
1076       memcpy (cp, files[i].filename, size);
1077
1078       out_uleb128 (files[i].dir);       /* directory number */
1079       out_uleb128 (0);                  /* last modification timestamp */
1080       out_uleb128 (0);                  /* filesize */
1081     }
1082
1083   /* Terminate filename list.  */
1084   out_byte (0);
1085 }
1086
1087 /* Emit the collected .debug_line data.  */
1088
1089 static void
1090 out_debug_line (line_seg)
1091      segT line_seg;
1092 {
1093   expressionS expr;
1094   symbolS *line_start;
1095   symbolS *prologue_end;
1096   symbolS *line_end;
1097   struct line_seg *s;
1098   enum dwarf2_format d2f;
1099   int sizeof_offset;
1100
1101   subseg_set (line_seg, 0);
1102
1103   line_start = symbol_temp_new_now ();
1104   prologue_end = symbol_temp_make ();
1105   line_end = symbol_temp_make ();
1106
1107   /* Total length of the information for this compilation unit.  */
1108   expr.X_op = O_subtract;
1109   expr.X_add_symbol = line_end;
1110   expr.X_op_symbol = line_start;
1111
1112   d2f = DWARF2_FORMAT ();
1113   if (d2f == dwarf2_format_32bit)
1114     {
1115       expr.X_add_number = -4;
1116       emit_expr (&expr, 4);
1117       sizeof_offset = 4;
1118     }
1119   else if (d2f == dwarf2_format_64bit)
1120     {
1121       expr.X_add_number = -12;
1122       out_four (-1);
1123       emit_expr (&expr, 8);
1124       sizeof_offset = 8;
1125     }
1126   else if (d2f == dwarf2_format_64bit_irix)
1127     {
1128       expr.X_add_number = -8;
1129       emit_expr (&expr, 8);
1130       sizeof_offset = 8;
1131     }
1132   else
1133     {
1134       as_fatal (_("internal error: unknown dwarf2 format"));
1135     }
1136
1137   /* Version.  */
1138   out_two (2);
1139
1140   /* Length of the prologue following this length.  */
1141   expr.X_op = O_subtract;
1142   expr.X_add_symbol = prologue_end;
1143   expr.X_op_symbol = line_start;
1144   expr.X_add_number = - (4 + 2 + 4);
1145   emit_expr (&expr, sizeof_offset);
1146
1147   /* Parameters of the state machine.  */
1148   out_byte (DWARF2_LINE_MIN_INSN_LENGTH);
1149   out_byte (DWARF2_LINE_DEFAULT_IS_STMT);
1150   out_byte (DWARF2_LINE_BASE);
1151   out_byte (DWARF2_LINE_RANGE);
1152   out_byte (DWARF2_LINE_OPCODE_BASE);
1153
1154   /* Standard opcode lengths.  */
1155   out_byte (0);                 /* DW_LNS_copy */
1156   out_byte (1);                 /* DW_LNS_advance_pc */
1157   out_byte (1);                 /* DW_LNS_advance_line */
1158   out_byte (1);                 /* DW_LNS_set_file */
1159   out_byte (1);                 /* DW_LNS_set_column */
1160   out_byte (0);                 /* DW_LNS_negate_stmt */
1161   out_byte (0);                 /* DW_LNS_set_basic_block */
1162   out_byte (0);                 /* DW_LNS_const_add_pc */
1163   out_byte (1);                 /* DW_LNS_fixed_advance_pc */
1164
1165   out_file_list ();
1166
1167   symbol_set_value_now (prologue_end);
1168
1169   /* For each section, emit a statement program.  */
1170   for (s = all_segs; s; s = s->next)
1171     process_entries (s->seg, s->head->head);
1172
1173   symbol_set_value_now (line_end);
1174 }
1175
1176 /* Emit data for .debug_aranges.  */
1177
1178 static void
1179 out_debug_aranges (aranges_seg, info_seg)
1180      segT aranges_seg;
1181      segT info_seg;
1182 {
1183   unsigned int addr_size = sizeof_address;
1184   addressT size, skip;
1185   struct line_seg *s;
1186   expressionS expr;
1187   char *p;
1188
1189   size = 4 + 2 + 4 + 1 + 1;
1190
1191   skip = 2 * addr_size - (size & (2 * addr_size - 1));
1192   if (skip == 2 * addr_size)
1193     skip = 0;
1194   size += skip;
1195
1196   for (s = all_segs; s; s = s->next)
1197     size += 2 * addr_size;
1198
1199   size += 2 * addr_size;
1200
1201   subseg_set (aranges_seg, 0);
1202
1203   /* Length of the compilation unit.  */
1204   out_four (size - 4);
1205
1206   /* Version.  */
1207   out_two (2);
1208
1209   /* Offset to .debug_info.  */
1210   /* ??? sizeof_offset */
1211   TC_DWARF2_EMIT_OFFSET (section_symbol (info_seg), 4);
1212
1213   /* Size of an address (offset portion).  */
1214   out_byte (addr_size);
1215
1216   /* Size of a segment descriptor.  */
1217   out_byte (0);
1218
1219   /* Align the header.  */
1220   if (skip)
1221     frag_align (ffs (2 * addr_size) - 1, 0, 0);
1222
1223   for (s = all_segs; s; s = s->next)
1224     {
1225       fragS *frag;
1226       symbolS *beg, *end;
1227
1228       frag = first_frag_for_seg (s->seg);
1229       beg = symbol_temp_new (s->seg, 0, frag);
1230       s->text_start = beg;
1231
1232       frag = last_frag_for_seg (s->seg);
1233       end = symbol_temp_new (s->seg, get_frag_fix (frag), frag);
1234       s->text_end = end;
1235
1236       expr.X_op = O_symbol;
1237       expr.X_add_symbol = beg;
1238       expr.X_add_number = 0;
1239       emit_expr (&expr, addr_size);
1240
1241       expr.X_op = O_subtract;
1242       expr.X_add_symbol = end;
1243       expr.X_op_symbol = beg;
1244       expr.X_add_number = 0;
1245       emit_expr (&expr, addr_size);
1246     }
1247
1248   p = frag_more (2 * addr_size);
1249   md_number_to_chars (p, 0, addr_size);
1250   md_number_to_chars (p + addr_size, 0, addr_size);
1251 }
1252
1253 /* Emit data for .debug_abbrev.  Note that this must be kept in
1254    sync with out_debug_info below.  */
1255
1256 static void
1257 out_debug_abbrev (abbrev_seg)
1258      segT abbrev_seg;
1259 {
1260   subseg_set (abbrev_seg, 0);
1261
1262   out_uleb128 (1);
1263   out_uleb128 (DW_TAG_compile_unit);
1264   out_byte (DW_CHILDREN_no);
1265   out_abbrev (DW_AT_stmt_list, DW_FORM_data4);
1266   if (all_segs->next == NULL)
1267     {
1268       out_abbrev (DW_AT_low_pc, DW_FORM_addr);
1269       out_abbrev (DW_AT_high_pc, DW_FORM_addr);
1270     }
1271   out_abbrev (DW_AT_name, DW_FORM_string);
1272   out_abbrev (DW_AT_comp_dir, DW_FORM_string);
1273   out_abbrev (DW_AT_producer, DW_FORM_string);
1274   out_abbrev (DW_AT_language, DW_FORM_data2);
1275   out_abbrev (0, 0);
1276
1277   /* Terminate the abbreviations for this compilation unit.  */
1278   out_byte (0);
1279 }
1280
1281 /* Emit a description of this compilation unit for .debug_info.  */
1282
1283 static void
1284 out_debug_info (info_seg, abbrev_seg, line_seg)
1285      segT info_seg;
1286      segT abbrev_seg;
1287      segT line_seg;
1288 {
1289   char producer[128];
1290   char *comp_dir;
1291   expressionS expr;
1292   symbolS *info_start;
1293   symbolS *info_end;
1294   char *p;
1295   int len;
1296   enum dwarf2_format d2f;
1297   int sizeof_offset;
1298
1299   subseg_set (info_seg, 0);
1300
1301   info_start = symbol_temp_new_now ();
1302   info_end = symbol_temp_make ();
1303
1304   /* Compilation Unit length.  */
1305   expr.X_op = O_subtract;
1306   expr.X_add_symbol = info_end;
1307   expr.X_op_symbol = info_start;
1308
1309   d2f = DWARF2_FORMAT ();
1310   if (d2f == dwarf2_format_32bit)
1311     {
1312       expr.X_add_number = -4;
1313       emit_expr (&expr, 4);
1314       sizeof_offset = 4;
1315     }
1316   else if (d2f == dwarf2_format_64bit)
1317     {
1318       expr.X_add_number = -12;
1319       out_four (-1);
1320       emit_expr (&expr, 8);
1321       sizeof_offset = 8;
1322     }
1323   else if (d2f == dwarf2_format_64bit_irix)
1324     {
1325       expr.X_add_number = -8;
1326       emit_expr (&expr, 8);
1327       sizeof_offset = 8;
1328     }
1329   else
1330     {
1331       as_fatal (_("internal error: unknown dwarf2 format"));
1332     }
1333
1334   /* DWARF version.  */
1335   out_two (2);
1336
1337   /* .debug_abbrev offset */
1338   TC_DWARF2_EMIT_OFFSET (section_symbol (abbrev_seg), sizeof_offset);
1339
1340   /* Target address size.  */
1341   out_byte (sizeof_address);
1342
1343   /* DW_TAG_compile_unit DIE abbrev */
1344   out_uleb128 (1);
1345
1346   /* DW_AT_stmt_list */
1347   /* ??? sizeof_offset */
1348   TC_DWARF2_EMIT_OFFSET (section_symbol (line_seg), 4);
1349
1350   /* These two attributes may only be emitted if all of the code is
1351      contiguous.  Multiple sections are not that.  */
1352   if (all_segs->next == NULL)
1353     {
1354       /* DW_AT_low_pc */
1355       expr.X_op = O_symbol;
1356       expr.X_add_symbol = all_segs->text_start;
1357       expr.X_add_number = 0;
1358       emit_expr (&expr, sizeof_address);
1359
1360       /* DW_AT_high_pc */
1361       expr.X_op = O_symbol;
1362       expr.X_add_symbol = all_segs->text_end;
1363       expr.X_add_number = 0;
1364       emit_expr (&expr, sizeof_address);
1365     }
1366
1367   /* DW_AT_name.  We don't have the actual file name that was present
1368      on the command line, so assume files[1] is the main input file.
1369      We're not supposed to get called unless at least one line number
1370      entry was emitted, so this should always be defined.  */
1371   if (!files || files_in_use < 1)
1372     abort ();
1373   if (files[1].dir)
1374     {
1375       len = strlen (dirs[files[1].dir]);
1376       p = frag_more (len + 1);
1377       memcpy (p, dirs[files[1].dir], len);
1378       p[len] = '/';
1379     }
1380   len = strlen (files[1].filename) + 1;
1381   p = frag_more (len);
1382   memcpy (p, files[1].filename, len);
1383
1384   /* DW_AT_comp_dir */
1385   comp_dir = getpwd ();
1386   len = strlen (comp_dir) + 1;
1387   p = frag_more (len);
1388   memcpy (p, comp_dir, len);
1389
1390   /* DW_AT_producer */
1391   sprintf (producer, "GNU AS %s", VERSION);
1392   len = strlen (producer) + 1;
1393   p = frag_more (len);
1394   memcpy (p, producer, len);
1395
1396   /* DW_AT_language.  Yes, this is probably not really MIPS, but the
1397      dwarf2 draft has no standard code for assembler.  */
1398   out_two (DW_LANG_Mips_Assembler);
1399
1400   symbol_set_value_now (info_end);
1401 }
1402
1403 void
1404 dwarf2_finish ()
1405 {
1406   segT line_seg;
1407   struct line_seg *s;
1408
1409   /* We don't need to do anything unless:
1410      - Some debug information was recorded via .file/.loc
1411      - or, we are generating DWARF2 information ourself (--gdwarf2)
1412      - or, there is a user-provided .debug_info section which could
1413        reference the file table in the .debug_line section we generate
1414        below.  */
1415   if (all_segs == NULL
1416       && debug_type != DEBUG_DWARF2
1417       && bfd_get_section_by_name (stdoutput, ".debug_info") == NULL)
1418     return;
1419
1420   /* Calculate the size of an address for the target machine.  */
1421   sizeof_address = DWARF2_ADDR_SIZE (stdoutput);
1422
1423   /* Create and switch to the line number section.  */
1424   line_seg = subseg_new (".debug_line", 0);
1425   bfd_set_section_flags (stdoutput, line_seg, SEC_READONLY);
1426
1427   /* For each subsection, chain the debug entries together.  */
1428   for (s = all_segs; s; s = s->next)
1429     {
1430       struct line_subseg *ss = s->head;
1431       struct line_entry **ptail = ss->ptail;
1432
1433       while ((ss = ss->next) != NULL)
1434         {
1435           *ptail = ss->head;
1436           ptail = ss->ptail;
1437         }
1438     }
1439
1440   out_debug_line (line_seg);
1441
1442   /* If this is assembler generated line info, we need .debug_info
1443      and .debug_abbrev sections as well.  */
1444   if (all_segs != NULL && debug_type == DEBUG_DWARF2)
1445     {
1446       segT abbrev_seg;
1447       segT info_seg;
1448       segT aranges_seg;
1449
1450       info_seg = subseg_new (".debug_info", 0);
1451       abbrev_seg = subseg_new (".debug_abbrev", 0);
1452       aranges_seg = subseg_new (".debug_aranges", 0);
1453
1454       bfd_set_section_flags (stdoutput, info_seg, SEC_READONLY);
1455       bfd_set_section_flags (stdoutput, abbrev_seg, SEC_READONLY);
1456       bfd_set_section_flags (stdoutput, aranges_seg, SEC_READONLY);
1457
1458       record_alignment (aranges_seg, ffs (2 * sizeof_address) - 1);
1459
1460       out_debug_aranges (aranges_seg, info_seg);
1461       out_debug_abbrev (abbrev_seg);
1462       out_debug_info (info_seg, abbrev_seg, line_seg);
1463     }
1464 }
1465
1466 #else
1467 void
1468 dwarf2_finish ()
1469 {
1470 }
1471
1472 int
1473 dwarf2dbg_estimate_size_before_relax (frag)
1474      fragS *frag ATTRIBUTE_UNUSED;
1475 {
1476   as_fatal (_("dwarf2 is not supported for this object file format"));
1477   return 0;
1478 }
1479
1480 int
1481 dwarf2dbg_relax_frag (frag)
1482      fragS *frag ATTRIBUTE_UNUSED;
1483 {
1484   as_fatal (_("dwarf2 is not supported for this object file format"));
1485   return 0;
1486 }
1487
1488 void
1489 dwarf2dbg_convert_frag (frag)
1490      fragS *frag ATTRIBUTE_UNUSED;
1491 {
1492   as_fatal (_("dwarf2 is not supported for this object file format"));
1493 }
1494
1495 void
1496 dwarf2_emit_insn (size)
1497      int size ATTRIBUTE_UNUSED;
1498 {
1499 }
1500
1501 char *
1502 dwarf2_directive_file (dummy)
1503      int dummy ATTRIBUTE_UNUSED;
1504 {
1505   s_app_file (0);
1506   return NULL;
1507 }
1508
1509 void
1510 dwarf2_directive_loc (dummy)
1511      int dummy ATTRIBUTE_UNUSED;
1512 {
1513   as_fatal (_("dwarf2 is not supported for this object file format"));
1514 }
1515 #endif /* BFD_ASSEMBLER */
This page took 0.106624 seconds and 4 git commands to generate.