OSDN Git Service

* defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New.
[pf3gnuchains/gcc-fork.git] / gcc / dwarf2asm.c
1 /* Dwarf2 assembler output helper routines.
2    Copyright (C) 2001 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC 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 2, or (at your option)
9 any later version.
10
11 GNU CC 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 GNU CC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21
22 #include "config.h"
23 #include "system.h"
24 #include "flags.h"
25 #include "tree.h"
26 #include "rtl.h"
27 #include "output.h"
28 #include "dwarf2asm.h"
29 #include "dwarf2.h"
30 #include "splay-tree.h"
31 #include "ggc.h"
32 #include "tm_p.h"
33
34
35 /* How to start an assembler comment.  */
36 #ifndef ASM_COMMENT_START
37 #define ASM_COMMENT_START ";#"
38 #endif
39
40 /* Definitions of defaults for assembler-dependent names of various
41    pseudo-ops and section names.  These may be overridden in the tm.h
42    file (if necessary) for a particular assembler.  */
43
44 #ifdef OBJECT_FORMAT_ELF
45 #ifndef UNALIGNED_SHORT_ASM_OP
46 #define UNALIGNED_SHORT_ASM_OP          "\t.2byte\t"
47 #endif
48 #ifndef UNALIGNED_INT_ASM_OP
49 #define UNALIGNED_INT_ASM_OP            "\t.4byte\t"
50 #endif
51 #ifndef UNALIGNED_DOUBLE_INT_ASM_OP
52 #define UNALIGNED_DOUBLE_INT_ASM_OP     "\t.8byte\t"
53 #endif
54 #endif /* OBJECT_FORMAT_ELF */
55
56 #ifndef ASM_BYTE_OP
57 #define ASM_BYTE_OP                     "\t.byte\t"
58 #endif
59
60 /* We don't have unaligned support, let's hope the normal output works for
61    .debug_frame.  But we know it won't work for .debug_info.  */
62 #if !defined(UNALIGNED_INT_ASM_OP) && defined(DWARF2_DEBUGGING_INFO)
63  #error DWARF2_DEBUGGING_INFO requires UNALIGNED_INT_ASM_OP.
64 #endif
65
66 \f
67 #ifdef UNALIGNED_INT_ASM_OP
68 static const char * unaligned_integer_asm_op  PARAMS ((int));
69
70 static inline const char *
71 unaligned_integer_asm_op (size)
72      int size;
73 {
74   const char *op;
75   switch (size)
76     {
77     case 1:
78       op = ASM_BYTE_OP;
79       break;
80     case 2:
81       op = UNALIGNED_SHORT_ASM_OP;
82       break;
83     case 4:
84       op = UNALIGNED_INT_ASM_OP;
85       break;
86     case 8:
87 #ifdef UNALIGNED_DOUBLE_INT_ASM_OP
88       op = UNALIGNED_DOUBLE_INT_ASM_OP;
89       break;
90 #endif
91     default:
92       abort ();
93     }
94   return op;
95 }
96 #endif /* UNALIGNED_INT_ASM_OP */
97
98 /* Output an immediate constant in a given size.  */
99
100 void
101 dw2_asm_output_data VPARAMS ((int size, unsigned HOST_WIDE_INT value,
102                               const char *comment, ...))
103 {
104 #ifndef ANSI_PROTOTYPES
105   int size;
106   unsigned HOST_WIDE_INT value;
107   const char *comment;
108 #endif
109   va_list ap;
110
111   VA_START (ap, comment);
112
113 #ifndef ANSI_PROTOTYPES
114   size = va_arg (ap, int);
115   value = va_arg (ap, unsigned HOST_WIDE_INT);
116   comment = va_arg (ap, const char *);
117 #endif
118
119   if (size * 8 < HOST_BITS_PER_WIDE_INT)
120     value &= ~(~(unsigned HOST_WIDE_INT)0 << (size * 8));
121
122 #ifdef UNALIGNED_INT_ASM_OP
123   fputs (unaligned_integer_asm_op (size), asm_out_file);
124   fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, value);
125 #else
126   assemble_integer (GEN_INT (value), size, 1);
127 #endif
128
129   if (flag_debug_asm && comment)
130     {
131       fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
132       vfprintf (asm_out_file, comment, ap);
133     }
134   fputc ('\n', asm_out_file);
135
136   va_end (ap);
137 }
138
139 /* Output the difference between two symbols in a given size.  */
140 /* ??? There appear to be assemblers that do not like such
141    subtraction, but do support ASM_SET_OP.  It's unfortunately
142    impossible to do here, since the ASM_SET_OP for the difference
143    symbol must appear after both symbols are defined.  */
144
145 void
146 dw2_asm_output_delta VPARAMS ((int size, const char *lab1, const char *lab2,
147                                const char *comment, ...))
148 {
149 #ifndef ANSI_PROTOTYPES
150   int size;
151   const char *lab1, *lab2;
152   const char *comment;
153 #endif
154   va_list ap;
155
156   VA_START (ap, comment);
157
158 #ifndef ANSI_PROTOTYPES
159   size = va_arg (ap, int);
160   lab1 = va_arg (ap, const char *);
161   lab2 = va_arg (ap, const char *);
162   comment = va_arg (ap, const char *);
163 #endif
164
165 #ifdef UNALIGNED_INT_ASM_OP
166   fputs (unaligned_integer_asm_op (size), asm_out_file);
167   assemble_name (asm_out_file, lab1);
168   fputc ('-', asm_out_file);
169   assemble_name (asm_out_file, lab2);
170 #else
171   assemble_integer (gen_rtx_MINUS (smallest_mode_for_size (size, MODE_INT),
172                                    gen_rtx_SYMBOL_REF (Pmode, lab1),
173                                    gen_rtx_SYMBOL_REF (Pmode, lab2)),
174                     size, 1);
175 #endif
176
177   if (flag_debug_asm && comment)
178     {
179       fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
180       vfprintf (asm_out_file, comment, ap);
181     }
182   fputc ('\n', asm_out_file);
183
184   va_end (ap);
185 }
186
187 /* Output a section-relative reference to a label.  In general this
188    can only be done for debugging symbols.  E.g. on most targets with
189    the GNU linker, this is accomplished with a direct reference and
190    the knowledge that the debugging section will be placed at VMA 0.
191    Some targets have special relocations for this that we must use.  */
192
193 void
194 dw2_asm_output_offset VPARAMS ((int size, const char *label,
195                                const char *comment, ...))
196 {
197 #ifndef ANSI_PROTOTYPES
198   int size;
199   const char *label;
200   const char *comment;
201 #endif
202   va_list ap;
203
204   VA_START (ap, comment);
205
206 #ifndef ANSI_PROTOTYPES
207   size = va_arg (ap, int);
208   label = va_arg (ap, const char *);
209   comment = va_arg (ap, const char *);
210 #endif
211
212 #ifdef ASM_OUTPUT_DWARF_OFFSET
213   ASM_OUTPUT_DWARF_OFFSET (asm_out_file, size, label);
214 #else
215 #ifdef UNALIGNED_INT_ASM_OP
216   fputs (unaligned_integer_asm_op (size), asm_out_file);
217   assemble_name (asm_out_file, label);
218 #else
219   assemble_integer (gen_rtx_SYMBOL_REF (Pmode, label), size, 1);
220 #endif
221 #endif
222
223   if (flag_debug_asm && comment)
224     {
225       fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
226       vfprintf (asm_out_file, comment, ap);
227     }
228   fputc ('\n', asm_out_file);
229
230   va_end (ap);
231 }
232
233 /* Output a self-relative reference to a label, possibly in a
234    different section or object file.  */
235
236 void
237 dw2_asm_output_pcrel VPARAMS ((int size, const char *label,
238                                const char *comment, ...))
239 {
240 #ifndef ANSI_PROTOTYPES
241   int size;
242   const char *label;
243   const char *comment;
244 #endif
245   va_list ap;
246
247   VA_START (ap, comment);
248
249 #ifndef ANSI_PROTOTYPES
250   size = va_arg (ap, int);
251   label = va_arg (ap, const char *);
252   comment = va_arg (ap, const char *);
253 #endif
254
255 #ifdef ASM_OUTPUT_DWARF_PCREL
256   ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, label);
257 #else
258 #ifdef UNALIGNED_INT_ASM_OP
259   fputs (unaligned_integer_asm_op (size), asm_out_file);
260   assemble_name (asm_out_file, label);
261   fputc ('-', asm_out_file);
262   fputc ('.', asm_out_file);
263 #else
264   abort ();
265 #endif
266 #endif
267
268   if (flag_debug_asm && comment)
269     {
270       fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
271       vfprintf (asm_out_file, comment, ap);
272     }
273   fputc ('\n', asm_out_file);
274
275   va_end (ap);
276 }
277
278 /* Output an absolute reference to a label.  */
279
280 void
281 dw2_asm_output_addr VPARAMS ((int size, const char *label,
282                               const char *comment, ...))
283 {
284 #ifndef ANSI_PROTOTYPES
285   int size;
286   const char *label;
287   const char *comment;
288 #endif
289   va_list ap;
290
291   VA_START (ap, comment);
292
293 #ifndef ANSI_PROTOTYPES
294   size = va_arg (ap, int);
295   label = va_arg (ap, const char *);
296   comment = va_arg (ap, const char *);
297 #endif
298
299 #ifdef UNALIGNED_INT_ASM_OP
300   fputs (unaligned_integer_asm_op (size), asm_out_file);
301   assemble_name (asm_out_file, label);
302 #else
303   assemble_integer (gen_rtx_SYMBOL_REF (Pmode, label), size, 1);
304 #endif
305
306   if (flag_debug_asm && comment)
307     {
308       fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
309       vfprintf (asm_out_file, comment, ap);
310     }
311   fputc ('\n', asm_out_file);
312
313   va_end (ap);
314 }
315
316 /* Similar, but use an RTX expression instead of a text label.  */
317
318 void
319 dw2_asm_output_addr_rtx VPARAMS ((int size, rtx addr,
320                                   const char *comment, ...))
321 {
322 #ifndef ANSI_PROTOTYPES
323   int size;
324   rtx addr;
325   const char *comment;
326 #endif
327   va_list ap;
328
329   VA_START (ap, comment);
330
331 #ifndef ANSI_PROTOTYPES
332   size = va_arg (ap, int);
333   addr = va_arg (ap, rtx);
334   comment = va_arg (ap, const char *);
335 #endif
336
337 #ifdef UNALIGNED_INT_ASM_OP
338   fputs (unaligned_integer_asm_op (size), asm_out_file);
339   output_addr_const (asm_out_file, addr);
340 #else
341   assemble_integer (addr, size, 1);
342 #endif
343
344   if (flag_debug_asm && comment)
345     {
346       fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
347       vfprintf (asm_out_file, comment, ap);
348     }
349   fputc ('\n', asm_out_file);
350
351   va_end (ap);
352 }
353
354 void
355 dw2_asm_output_nstring VPARAMS ((const char *str, size_t orig_len,
356                                  const char *comment, ...))
357 {
358 #ifndef ANSI_PROTOTYPES
359   const char *str;
360   size_t orig_len;
361   const char *comment;
362 #endif
363   va_list ap;
364   size_t i, len = orig_len;
365
366   VA_START (ap, comment);
367
368 #ifndef ANSI_PROTOTYPES
369   str = va_arg (ap, const char *);
370   len = va_arg (ap, size_t);
371   comment = va_arg (ap, const char *);
372 #endif
373
374   if (len == (size_t) -1)
375     len = strlen (str);
376
377   if (flag_debug_asm && comment)
378     {
379       fputs ("\t.ascii \"", asm_out_file);
380       for (i = 0; i < len; i++)
381         {
382           int c = str[i];
383           if (c == '\"' || c == '\\')
384             fputc ('\\', asm_out_file);
385           if (ISPRINT(c))
386             fputc (c, asm_out_file);
387           else
388             fprintf (asm_out_file, "\\%o", c);
389         }
390       fprintf (asm_out_file, "\\0\"\t%s ", ASM_COMMENT_START);
391       vfprintf (asm_out_file, comment, ap);
392       fputc ('\n', asm_out_file);
393     }
394   else
395     {
396       /* If an explicit length was given, we can't assume there
397          is a null termination in the string buffer.  */
398       if (orig_len == (size_t) -1)
399         len += 1;
400       ASM_OUTPUT_ASCII (asm_out_file, str, len);
401       if (orig_len != (size_t) -1)
402         fprintf (asm_out_file, "%s0\n", ASM_BYTE_OP);
403     }
404
405   va_end (ap);
406 }
407 \f
408
409 /* Return the size of an unsigned LEB128 quantity.  */
410
411 int
412 size_of_uleb128 (value)
413      unsigned HOST_WIDE_INT value;
414 {
415   int size = 0, byte;
416
417   do
418     {
419       byte = (value & 0x7f);
420       value >>= 7;
421       size += 1;
422     }
423   while (value != 0);
424
425   return size;
426 }
427
428 /* Return the size of a signed LEB128 quantity.  */
429
430 int
431 size_of_sleb128 (value)
432      HOST_WIDE_INT value;
433 {
434   int size = 0, byte;
435
436   do
437     {
438       byte = (value & 0x7f);
439       value >>= 7;
440       size += 1;
441     }
442   while (!((value == 0 && (byte & 0x40) == 0)
443            || (value == -1 && (byte & 0x40) != 0)));
444
445   return size;
446 }
447
448 /* Output an unsigned LEB128 quantity.  */
449
450 void
451 dw2_asm_output_data_uleb128 VPARAMS ((unsigned HOST_WIDE_INT value,
452                                       const char *comment, ...))
453 {
454 #ifndef ANSI_PROTOTYPES
455   unsigned HOST_WIDE_INT value;
456   const char *comment;
457 #endif
458   va_list ap;
459
460   VA_START (ap, comment);
461
462 #ifndef ANSI_PROTOTYPES
463   value = va_arg (ap, unsigned HOST_WIDE_INT);
464   comment = va_arg (ap, const char *);
465 #endif
466
467 #ifdef HAVE_AS_LEB128
468   fputs ("\t.uleb128 ", asm_out_file);
469   fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, value);
470
471   if (flag_debug_asm && comment)
472     {
473       fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
474       vfprintf (asm_out_file, comment, ap);
475     }
476 #else
477   {
478     unsigned HOST_WIDE_INT work = value;
479
480     fputs (ASM_BYTE_OP, asm_out_file);
481     do
482       {
483         int byte = (work & 0x7f);
484         work >>= 7;
485         if (work != 0)
486           /* More bytes to follow.  */
487           byte |= 0x80;
488
489         fprintf (asm_out_file, "0x%x", byte);
490         if (work != 0)
491           fputc (',', asm_out_file);
492       }
493     while (work != 0);
494
495   if (flag_debug_asm)
496     {
497       fprintf (asm_out_file, "\t%s uleb128 ", ASM_COMMENT_START);
498       fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, value);
499       if (comment)
500         {
501           fputs ("; ", asm_out_file);
502           vfprintf (asm_out_file, comment, ap);
503         }
504     }
505   }
506 #endif
507   fputc ('\n', asm_out_file);
508
509   va_end (ap);
510 }
511
512 /* Output an signed LEB128 quantity.  */
513
514 void
515 dw2_asm_output_data_sleb128 VPARAMS ((HOST_WIDE_INT value,
516                                       const char *comment, ...))
517 {
518 #ifndef ANSI_PROTOTYPES
519   HOST_WIDE_INT value;
520   const char *comment;
521 #endif
522   va_list ap;
523
524   VA_START (ap, comment);
525
526 #ifndef ANSI_PROTOTYPES
527   value = va_arg (ap, HOST_WIDE_INT);
528   comment = va_arg (ap, const char *);
529 #endif
530
531 #ifdef HAVE_AS_LEB128
532   fputs ("\t.sleb128 ", asm_out_file);
533   fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, value);
534
535   if (flag_debug_asm && comment)
536     {
537       fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
538       vfprintf (asm_out_file, comment, ap);
539     }
540 #else
541   {
542     HOST_WIDE_INT work = value;
543     int more, byte;
544
545     fputs (ASM_BYTE_OP, asm_out_file);
546     do
547       {
548         byte = (work & 0x7f);
549         /* arithmetic shift */
550         work >>= 7;
551         more = !((work == 0 && (byte & 0x40) == 0)
552                  || (work == -1 && (byte & 0x40) != 0));
553         if (more)
554           byte |= 0x80;
555
556         fprintf (asm_out_file, "0x%x", byte);
557         if (more)
558           fputc (',', asm_out_file);
559       }
560     while (more);
561
562   if (flag_debug_asm)
563     {
564       fprintf (asm_out_file, "\t%s sleb128 ", ASM_COMMENT_START);
565       fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, value);
566       if (comment)
567         {
568           fputs ("; ", asm_out_file);
569           vfprintf (asm_out_file, comment, ap);
570         }
571     }
572   }
573 #endif
574   fputc ('\n', asm_out_file);
575
576   va_end (ap);
577 }
578
579 void
580 dw2_asm_output_delta_uleb128 VPARAMS ((const char *lab1 ATTRIBUTE_UNUSED,
581                                        const char *lab2 ATTRIBUTE_UNUSED,
582                                        const char *comment, ...))
583 {
584 #ifndef ANSI_PROTOTYPES
585   const char *lab1, *lab2;
586   const char *comment;
587 #endif
588   va_list ap;
589
590   VA_START (ap, comment);
591
592 #ifndef ANSI_PROTOTYPES
593   lab1 = va_arg (ap, const char *);
594   lab2 = va_arg (ap, const char *);
595   comment = va_arg (ap, const char *);
596 #endif
597
598 #ifdef HAVE_AS_LEB128
599   fputs ("\t.uleb128 ", asm_out_file);
600   assemble_name (asm_out_file, lab1);
601   fputc ('-', asm_out_file);
602   assemble_name (asm_out_file, lab2);
603 #else
604   abort ();
605 #endif
606
607   if (flag_debug_asm && comment)
608     {
609       fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
610       vfprintf (asm_out_file, comment, ap);
611     }
612   fputc ('\n', asm_out_file);
613
614   va_end (ap);
615 }
616
617 void
618 dw2_asm_output_delta_sleb128 VPARAMS ((const char *lab1 ATTRIBUTE_UNUSED,
619                                        const char *lab2 ATTRIBUTE_UNUSED,
620                                        const char *comment, ...))
621 {
622 #ifndef ANSI_PROTOTYPES
623   const char *lab1, *lab2;
624   const char *comment;
625 #endif
626   va_list ap;
627
628   VA_START (ap, comment);
629
630 #ifndef ANSI_PROTOTYPES
631   lab1 = va_arg (ap, const char *);
632   lab2 = va_arg (ap, const char *);
633   comment = va_arg (ap, const char *);
634 #endif
635
636 #ifdef HAVE_AS_LEB128
637   fputs ("\t.sleb128 ", asm_out_file);
638   assemble_name (asm_out_file, lab1);
639   fputc ('-', asm_out_file);
640   assemble_name (asm_out_file, lab2);
641 #else
642   abort ();
643 #endif
644
645   if (flag_debug_asm && comment)
646     {
647       fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
648       vfprintf (asm_out_file, comment, ap);
649     }
650   fputc ('\n', asm_out_file);
651
652   va_end (ap);
653 }
654 \f
655 static rtx dw2_force_const_mem PARAMS ((rtx));
656 static int dw2_output_indirect_constant_1 PARAMS ((splay_tree_node, void *));
657
658 static splay_tree indirect_pool;
659
660 static rtx
661 dw2_force_const_mem (x)
662      rtx x;
663 {
664   splay_tree_node node;
665   const char *const_sym;
666
667   if (! indirect_pool)
668     indirect_pool = splay_tree_new (splay_tree_compare_pointers, NULL, NULL);
669
670   if (GET_CODE (x) != SYMBOL_REF)
671     abort ();
672   node = splay_tree_lookup (indirect_pool, (splay_tree_key) XSTR (x, 0));
673   if (node)
674     const_sym = (const char *) node->value;
675   else
676     {
677       extern int const_labelno;
678       char label[32];
679       tree id;
680
681       ASM_GENERATE_INTERNAL_LABEL (label, "LC", const_labelno);
682       ++const_labelno;
683       const_sym = ggc_strdup (label);
684
685       id = maybe_get_identifier (XSTR (x, 0));
686       if (id)
687         TREE_SYMBOL_REFERENCED (id) = 1;
688
689       splay_tree_insert (indirect_pool, (splay_tree_key) XSTR (x, 0),
690                          (splay_tree_value) const_sym);
691     }
692
693   return gen_rtx_SYMBOL_REF (Pmode, const_sym);
694 }
695
696 static int
697 dw2_output_indirect_constant_1 (node, data)
698      splay_tree_node node;
699      void* data ATTRIBUTE_UNUSED;
700 {
701   const char *label, *sym;
702   rtx sym_ref;
703
704   label = (const char *) node->value;
705   sym = (const char *) node->key;
706   sym_ref = gen_rtx_SYMBOL_REF (Pmode, sym);
707
708   ASM_OUTPUT_LABEL (asm_out_file, label);
709   assemble_integer (sym_ref, POINTER_SIZE / BITS_PER_UNIT, 1);
710
711   return 0;
712 }
713
714 void
715 dw2_output_indirect_constants ()
716 {
717   if (! indirect_pool)
718     return;
719
720   /* Assume that the whole reason we're emitting these symbol references
721      indirectly is that they contain dynamic relocations, and are thus
722      read-write.  If there was no possibility of a dynamic relocation, we
723      might as well have used a direct relocation.  */
724   data_section ();
725
726   /* Everything we're emitting is a pointer.  Align appropriately.  */
727   assemble_align (POINTER_SIZE);
728
729   splay_tree_foreach (indirect_pool, dw2_output_indirect_constant_1, NULL);
730 }
731
732 void
733 dw2_asm_output_encoded_addr_rtx (encoding, addr)
734      int encoding;
735      rtx addr;
736 {
737   int size;
738
739   switch (encoding & 0x07)
740     {
741     case DW_EH_PE_absptr:
742       size = POINTER_SIZE / BITS_PER_UNIT;
743       break;
744     case DW_EH_PE_udata2:
745       size = 2;
746       break;
747     case DW_EH_PE_udata4:
748       size = 4;
749       break;
750     case DW_EH_PE_udata8:
751       size = 8;
752       break;
753     default:
754       abort ();
755     }
756
757   /* NULL is _always_ represented as a plain zero.  */
758   if (addr == const0_rtx)
759     {
760       assemble_integer (addr, size, 1);
761       return;
762     }
763
764  restart:
765
766   /* Allow the target first crack at emitting this.  Some of the
767      special relocations require special directives instead of 
768      just ".4byte" or whatever.  */
769 #ifdef ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX
770   ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(asm_out_file, encoding, size, addr, done);
771 #endif
772
773   /* Indirection is used to get dynamic relocations out of a read-only
774      section.  */
775   if (encoding & DW_EH_PE_indirect)
776     {
777       /* It is very tempting to use force_const_mem so that we share data
778          with the normal constant pool.  However, we've already emitted
779          the constant pool for this function.  Moreover, we'd like to share
780          these constants across the entire unit of translation, or better,
781          across the entire application (or DSO).  */
782       addr = dw2_force_const_mem (addr);
783       encoding &= ~DW_EH_PE_indirect;
784       goto restart;
785     }
786
787   switch (encoding & 0xF0)
788     {
789     case DW_EH_PE_absptr:
790 #ifdef UNALIGNED_INT_ASM_OP
791       fputs (unaligned_integer_asm_op (size), asm_out_file);
792       output_addr_const (asm_out_file, addr);
793 #else
794       assemble_integer (addr, size, 1);
795 #endif
796       break;
797
798     case DW_EH_PE_pcrel:
799       if (GET_CODE (addr) != SYMBOL_REF)
800         abort ();
801 #ifdef ASM_OUTPUT_DWARF_PCREL
802       ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, XSTR (addr, 0));
803 #else
804 #ifdef UNALIGNED_INT_ASM_OP
805       fputs (unaligned_integer_asm_op (size), asm_out_file);
806       assemble_name (asm_out_file, XSTR (addr, 0));
807       fputc ('-', asm_out_file);
808       fputc ('.', asm_out_file);
809 #else
810       abort ();
811 #endif
812 #endif
813       break;
814
815     default:
816       /* Other encodings should have been handled by 
817          ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX.  */
818       abort ();
819     }
820
821 #ifdef ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX
822  done:
823 #endif
824   fputc ('\n', asm_out_file);
825 }