OSDN Git Service

* dwarf2dbg.c (DWARF2_ADDR_SIZE): New macro.
authoraoliva <aoliva>
Wed, 25 Dec 2002 21:20:31 +0000 (21:20 +0000)
committeraoliva <aoliva>
Wed, 25 Dec 2002 21:20:31 +0000 (21:20 +0000)
(dwarf2_finish): Use it.
* doc/internals.texi (DWARF2_ADDR_SIZE): Document it.
* config/tc-mips.h (DWARF2_ADDR_SIZE): Override.

gas/ChangeLog
gas/config/tc-mips.h
gas/doc/internals.texi
gas/dwarf2dbg.c

index fbe346c..927d2fe 100644 (file)
@@ -1,3 +1,10 @@
+2002-12-25  Alexandre Oliva  <aoliva@redhat.com>
+
+       * dwarf2dbg.c (DWARF2_ADDR_SIZE): New macro.
+       (dwarf2_finish): Use it.
+       * doc/internals.texi (DWARF2_ADDR_SIZE): Document it.
+       * config/tc-mips.h (DWARF2_ADDR_SIZE): Override.
+
 2002-12-20  DJ Delorie  <dj@redhat.com>
 
        * config/tc-xstormy16.c (md_cgen_lookup_reloc): Support
index dd52a7f..a19c87d 100644 (file)
@@ -185,4 +185,7 @@ extern void mips_enable_auto_align PARAMS ((void));
 extern enum dwarf2_format mips_dwarf2_format PARAMS ((void));
 #define DWARF2_FORMAT() mips_dwarf2_format ()
 
+#define DWARF2_ADDR_SIZE(bfd) \
+  (DWARF2_FORMAT () == dwarf2_format_32bit ? 4 : 8)
+
 #endif /* TC_MIPS */
index 0d54d4f..f88e6b2 100644 (file)
@@ -1503,6 +1503,12 @@ This define only affects @code{.debug_info} and @code{.debug_line}
 sections generated by the assembler.  DWARF 2 sections generated by
 other tools will be unaffected by this setting.
 
+@item DWARF2_ADDR_SIZE (@var{bfd})
+@cindex DWARF2_ADDR_SIZE
+It should return the size of an address, as it should be represented in
+debugging info.  If you don't define this macro, the default definition uses
+the number of bits per address, as defined in @var{bfd}, divided by 8.
+
 @end table
 
 @node Object format backend
index 0d5c072..db6e0f0 100644 (file)
 #include "dwarf2dbg.h"
 
 #ifndef DWARF2_FORMAT
-#define DWARF2_FORMAT() dwarf2_format_32bit
+# define DWARF2_FORMAT() dwarf2_format_32bit
 #endif
 
+#ifndef DWARF2_ADDR_SIZE
+# define DWARF2_ADDR_SIZE(bfd) (bfd_arch_bits_per_address (bfd) / 8);
+#endif
+
+
 #ifdef BFD_ASSEMBLER
 
 #include "subsegs.h"
@@ -1341,7 +1346,7 @@ dwarf2_finish ()
     return;
 
   /* Calculate the size of an address for the target machine.  */
-  sizeof_address = bfd_arch_bits_per_address (stdoutput) / 8;
+  sizeof_address = DWARF2_ADDR_SIZE (stdoutput);
 
   /* Create and switch to the line number section.  */
   line_seg = subseg_new (".debug_line", 0);