Patch: Disable dwarf2 for none-BFD assembler (Re: Does dwarf2 really work with a.out?)

H . J . Lu hjl@valinux.com
Mon Dec 11 14:04:00 GMT 2000


On Mon, Dec 11, 2000 at 04:24:48PM -0500, Michael Meissner wrote:
> > one on the fly. Should I submit a patch to disable dwarf2 for a.out?
> 
> Sure that follows from the definition of a.out (also dwarf-1 for the same
> reason).  There are also some COFF varients (such as Mips ECOFF) where you
> either can't create new sections, or section names must be limited to 8
> characters.
> 

Ok. Here is a patch. It disables dwarf2 for none-BFD assemblers.
I tested it on i386/a.out. I don't have MIPS/ECOFF to test.


H.J.
----
2000-12-11  H.J. Lu  <hjl@gnu.org>

	* dwarf2dbg.c: Enabled only if BFD_ASSEMBLER is defined.

Index: dwarf2dbg.c
===================================================================
RCS file: /work/cvs/gnu/binutils/gas/dwarf2dbg.c,v
retrieving revision 1.16
diff -u -p -r1.16 dwarf2dbg.c
--- dwarf2dbg.c	2000/12/11 19:51:36	1.16
+++ dwarf2dbg.c	2000/12/11 21:55:49
@@ -31,6 +31,9 @@
 #include <limits.h>
 
 #include "as.h"
+
+#ifdef BFD_ASSEMBLER
+
 #include "dwarf2dbg.h"
 #include "subsegs.h"
 
@@ -1244,3 +1247,53 @@ dwarf2_finish ()
       out_debug_info (info_seg, abbrev_seg, line_seg);
     }
 }
+
+#else
+void
+dwarf2_finish ()
+{
+}
+
+int
+dwarf2dbg_estimate_size_before_relax (frag)
+     fragS *frag ATTRIBUTE_UNUSED;
+{
+  as_fatal (_("dwarf2 is not supported for this object file format"));
+  return 0;
+}
+
+int
+dwarf2dbg_relax_frag (frag)
+     fragS *frag ATTRIBUTE_UNUSED;
+{
+  as_fatal (_("dwarf2 is not supported for this object file format"));
+  return 0;
+}
+
+void
+dwarf2dbg_convert_frag (frag)
+     fragS *frag ATTRIBUTE_UNUSED;
+{
+  as_fatal (_("dwarf2 is not supported for this object file format"));
+}
+
+void
+dwarf2_emit_insn (size)
+     int size ATTRIBUTE_UNUSED;
+{
+}
+
+void
+dwarf2_directive_file (dummy)
+     int dummy ATTRIBUTE_UNUSED;
+{
+  as_fatal (_("dwarf2 is not supported for this object file format"));
+}
+
+void
+dwarf2_directive_loc (dummy)
+     int dummy ATTRIBUTE_UNUSED;
+{
+  as_fatal (_("dwarf2 is not supported for this object file format"));
+}
+#endif /* BFD_ASSEMBLER */


More information about the Binutils mailing list