This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] gas v850 dwarf2



I can split this into two separate patches if there are problems with
either part, but the cons bug was triggered by the dwarf2 support.

2000-11-14  DJ Delorie  <dj@redhat.com>

	* config/tc-v850.c: support dwarf2
	* config/tc-v850.h: ditto

	* config/tc-v850.c (cons_fix_new_v850): don't rely on
	parse_cons_expression_v850 to initialize hold_cons_reloc.
	

Index: config/tc-v850.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-v850.c,v
retrieving revision 1.9
diff -p -2 -r1.9  config/tc-v850.c
*** config/tc-v850.c	2000/08/01 19:02:49	1.9
--- config/tc-v850.c	2000/11/15 02:27:40
***************
*** 1,4 ****
  /* tc-v850.c -- Assembler code for the NEC V850
!    Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation.
  
     This file is part of GAS, the GNU Assembler.
--- 1,4 ----
  /* tc-v850.c -- Assembler code for the NEC V850
!    Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation.
  
     This file is part of GAS, the GNU Assembler.
***************
*** 24,27 ****
--- 24,28 ----
  #include "subsegs.h"
  #include "opcode/v850.h"
+ #include "dwarf2dbg.h"
  
  #define AREA_ZDA 0
***************
*** 33,37 ****
  
  /* Temporarily holds the reloc in a cons expression.  */
! static bfd_reloc_code_real_type hold_cons_reloc;
  
  /* Set to TRUE if we want to be pedantic about signed overflows.  */
--- 34,38 ----
  
  /* Temporarily holds the reloc in a cons expression.  */
! static bfd_reloc_code_real_type hold_cons_reloc = BFD_RELOC_UNUSED;
  
  /* Set to TRUE if we want to be pedantic about signed overflows.  */
*************** const pseudo_typeS md_pseudo_table[] =
*** 608,611 ****
--- 609,614 ----
    {"v850e",           set_machine,          bfd_mach_v850e},
    {"v850ea",          set_machine,          bfd_mach_v850ea},
+   {"file",    dwarf2_directive_file },
+   {"loc",     dwarf2_directive_loc },
    { NULL,     NULL,         0}
  };
*************** md_assemble (str)
*** 1709,1712 ****
--- 1712,1716 ----
    unsigned long insn;
    unsigned long insn_size;
+   unsigned long total_insn_size = 0;
    char *f;
    int i;
*************** md_assemble (str)
*** 2184,2187 ****
--- 2188,2192 ----
  	  md_number_to_chars (f + 2, 0, 4);
  	}
+       total_insn_size = insn_size;
      }
    else
*************** md_assemble (str)
*** 2198,2201 ****
--- 2203,2207 ----
  
        f = frag_more (insn_size);
+       total_insn_size = insn_size;
  
        md_number_to_chars (f, insn, insn_size);
*************** md_assemble (str)
*** 2204,2207 ****
--- 2210,2214 ----
  	{
  	  f = frag_more (extra_data_len);
+ 	  total_insn_size += extra_data_len;
  
  	  md_number_to_chars (f, extra_data, extra_data_len);
*************** md_assemble (str)
*** 2277,2280 ****
--- 2284,2290 ----
  
    input_line_pointer = saved_input_line_pointer;
+ 
+   if (debug_type == DEBUG_DWARF2)
+     dwarf2_generate_asm_lineno (total_insn_size);
  }
  
*************** cons_fix_new_v850 (frag, where, size, ex
*** 2490,2493 ****
--- 2500,2505 ----
    else
      fix_new (frag, where, size, NULL, 0, 0, hold_cons_reloc);
+ 
+   hold_cons_reloc = BFD_RELOC_UNUSED;
  }
  
*************** v850_force_relocation (fixP)
*** 2531,2533 ****
--- 2543,2552 ----
  
    return 0;
+ }
+ 
+ void
+ v850_finalize ()
+ {
+   if (debug_type == DEBUG_DWARF2)
+     dwarf2_finish ();
  }
Index: config/tc-v850.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-v850.h,v
retrieving revision 1.4
diff -p -2 -r1.4  config/tc-v850.h
*** config/tc-v850.h	2000/09/26 07:09:19	1.4
--- config/tc-v850.h	2000/11/15 02:27:40
*************** extern const struct relax_type md_relax_
*** 90,91 ****
--- 90,96 ----
  #define MD_PCREL_FROM_SECTION(fixP,section) v850_pcrel_from_section (fixP, section)
  extern long v850_pcrel_from_section ();
+ 
+ #define md_end() v850_finalize ()
+ extern void v850_finalize PARAMS ((void));
+ 
+ #define DWARF2_LINE_MIN_INSN_LENGTH 2

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]