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]
Other format: [Raw text]

Define .file and .loc pseudo ops for all ELF targets.


Hi Guys,

  Alan Modra pointed out that it is silly adding the .file and .loc
  pseudo ops to individual md_pseudo_op[] arrays, we might as well
  define them for all ELF targets.  So here is a patch to do just
  this.  Applied to the mainline, but not the branch.  There were no
  regressions in any of the gas, ld or binutils testsuites for this
  patch.

  Note - The definitions have been left in tc-i386.c because this
  backend supports the generation of dwarf2 line number information in
  non-ELF targeted ports.
  
Cheers
        Nick

2003-05-21  Nick Clifton  <nickc@redhat.com>

        * config/obj-elf.c: Include dwarf2dbg.h.
        (elf_pseudo_tab): Add .file and .loc.
        * config/tc-arc.c (md_pseudo_table): Remove .file and .loc.
        * config/tc-arm.c: Likewise.
        * config/tc-h8300.c: Likewise.
        * config/tc-hppa.c: Likewise.
        * config/tc-ia64.c: Likewise.
        * config/tc-m68hc11.c: Likewise.
        * config/tc-m68k.c: Likewise.
        * config/tc-mmix.c: Likewise.
        * config/tc-mn10300.c: Likewise.
        * config/tc-ppc.c: Likewise.
        * config/tc-sh.c: Likewise.
        * config/tc-sparc.c: Likewise.
        * config/tc-v850.c: Likewise.
        * config/tc-frv.c: Likewise, and remove redundant inclusion of
        dwarf2dbg.h.
        * config/tc-ip2k.c: Likewise.
        * config/tc-iq2000.c: Likewise.
        * config/tc-xstormy16.c: Likewise.
        * config/tc-xtensa.c: Likewise.
	* Makefile.am: Regenerate dependencies.
        * Makefile.in: Regenerate.
        * aclocal.m4: Regenerate.
        * config.in: Regenerate.
        * configure: Regenerate.
        * po/POTFILES.in: Regenerate.
        * po/gas.pot: Regenerate.
               
Index: config/obj-elf.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.c,v
retrieving revision 1.66
diff -c -3 -p -w -r1.66 obj-elf.c
*** config/obj-elf.c	3 May 2003 16:04:11 -0000	1.66
--- config/obj-elf.c	21 May 2003 11:21:34 -0000
***************
*** 25,30 ****
--- 25,31 ----
  #include "subsegs.h"
  #include "obstack.h"
  #include "struc-symbol.h"
+ #include "dwarf2dbg.h"
  
  #ifndef ECOFF_DEBUGGING
  #define ECOFF_DEBUGGING 0
*************** static const pseudo_typeS elf_pseudo_tab
*** 126,131 ****
--- 127,135 ----
    {"2byte", cons, 2},
    {"4byte", cons, 4},
    {"8byte", cons, 8},
+   /* These are used for dwarf2.  */
+   { "file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
+   { "loc",  dwarf2_directive_loc,  0 },
  
    /* We need to trap the section changing calls to handle .previous.  */
    {"data", obj_elf_data, 0},

Index: config/tc-arc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arc.c,v
retrieving revision 1.21
diff -c -3 -p -w -r1.21 tc-arc.c
*** config/tc-arc.c	5 Sep 2002 00:01:16 -0000	1.21
--- config/tc-arc.c	21 May 2003 11:21:37 -0000
*************** const pseudo_typeS md_pseudo_table[] = {
*** 94,101 ****
    { "option", arc_option, 0 },
    { "cpu", arc_option, 0 },
    { "block", s_space, 0 },
-   { "file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
-   { "loc", dwarf2_directive_loc, 0 },
    { "extcondcode", arc_extoper, 0 },
    { "extcoreregister", arc_extoper, 1 },
    { "extauxregister", arc_extoper, 2 },
--- 94,99 ----

Index: config/tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.140
diff -c -3 -p -w -r1.140 tc-arm.c
*** config/tc-arm.c	2 Apr 2003 23:31:25 -0000	1.140
--- config/tc-arm.c	21 May 2003 11:21:48 -0000
*************** const pseudo_typeS md_pseudo_table[] =
*** 2345,2352 ****
  #ifdef OBJ_ELF
    { "word",        s_arm_elf_cons, 4 },
    { "long",        s_arm_elf_cons, 4 },
-   { "file",        (void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
-   { "loc",         dwarf2_directive_loc,  0 },
  #else
    { "word",        cons, 4},
  #endif
--- 2345,2350 ----

Index: config/tc-h8300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-h8300.c,v
retrieving revision 1.27
diff -c -3 -p -w -r1.27 tc-h8300.c
*** config/tc-h8300.c	24 Apr 2003 12:47:32 -0000	1.27
--- config/tc-h8300.c	21 May 2003 11:21:51 -0000
*************** const pseudo_typeS md_pseudo_table[] =
*** 151,161 ****
    {"sbranch", sbranch, L_8},
    {"lbranch", sbranch, L_16},
  
- #ifdef BFD_ASSEMBLER
-   {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
-   {"loc", dwarf2_directive_loc, 0 },
- #endif
- 
    {"int", pint, 0},
    {"data.b", cons, 1},
    {"data.w", cons, 2},
--- 151,156 ----

Index: config/tc-hppa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-hppa.c,v
retrieving revision 1.103
diff -c -3 -p -w -r1.103 tc-hppa.c
*** config/tc-hppa.c	28 Apr 2003 08:35:06 -0000	1.103
--- config/tc-hppa.c	21 May 2003 11:21:58 -0000
*************** const pseudo_typeS md_pseudo_table[] =
*** 670,678 ****
    {"equ", pa_equ, 0},
    {"exit", pa_exit, 0},
    {"export", pa_export, 0},
- #ifdef OBJ_ELF
-   {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
- #endif
    {"fill", pa_fill, 0},
    {"float", pa_float_cons, 'f'},
    {"half", pa_cons, 2},
--- 670,675 ----
*************** const pseudo_typeS md_pseudo_table[] =
*** 682,690 ****
    {"lcomm", pa_lcomm, 0},
    {"leave", pa_leave, 0},
    {"level", pa_level, 0},
- #ifdef OBJ_ELF
-   {"loc", dwarf2_directive_loc, 0 },
- #endif
    {"long", pa_cons, 4},
    {"lsym", pa_lsym, 0},
  #ifdef OBJ_SOM
--- 679,684 ----

Index: config/tc-ia64.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.c,v
retrieving revision 1.88
diff -c -3 -p -w -r1.88 tc-ia64.c
*** config/tc-ia64.c	7 May 2003 19:31:10 -0000	1.88
--- config/tc-ia64.c	21 May 2003 11:22:12 -0000
*************** const pseudo_typeS md_pseudo_table[] =
*** 4874,4881 ****
      { "body", dot_body, 0 },
      { "prologue", dot_prologue, 0 },
      { "endp", dot_endp, 0 },
-     { "file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
-     { "loc", dwarf2_directive_loc, 0 },
  
      { "fframe", dot_fframe, 0 },
      { "vframe", dot_vframe, 0 },
--- 4874,4879 ----

Index: config/tc-m68hc11.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m68hc11.c,v
retrieving revision 1.39
diff -c -3 -p -w -r1.39 tc-m68hc11.c
*** config/tc-m68hc11.c	5 Apr 2003 12:43:45 -0000	1.39
--- config/tc-m68hc11.c	21 May 2003 11:22:17 -0000
*************** const pseudo_typeS md_pseudo_table[] = {
*** 268,277 ****
    {"fcc", stringer, 1},
    {"rmb", s_space, 0},
  
-   /* Dwarf2 support for Gcc.  */
-   {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0},
-   {"loc", dwarf2_directive_loc, 0},
- 
    /* Motorola ALIS.  */
    {"xrefb", s_ignore, 0}, /* Same as xref  */
  
--- 268,273 ----

Index: config/tc-m68k.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m68k.c,v
retrieving revision 1.43
diff -c -3 -p -w -r1.43 tc-m68k.c
*** config/tc-m68k.c	12 Dec 2002 22:16:16 -0000	1.43
--- config/tc-m68k.c	21 May 2003 11:22:22 -0000
*************** const pseudo_typeS md_pseudo_table[] =
*** 554,565 ****
    {"extend", float_cons, 'x'},
    {"ldouble", float_cons, 'x'},
  
- #ifdef OBJ_ELF
-   /* Dwarf2 support for Gcc.  */
-   {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0},
-   {"loc", dwarf2_directive_loc, 0},
- #endif
- 
    /* The following pseudo-ops are supported for MRI compatibility.  */
    {"chip", s_chip, 0},
    {"comline", s_space, 1},
--- 554,559 ----

Index: config/tc-mmix.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mmix.c,v
retrieving revision 1.13
diff -c -3 -p -w -r1.13 tc-mmix.c
*** config/tc-mmix.c	23 Jan 2003 12:51:05 -0000	1.13
--- config/tc-mmix.c	21 May 2003 11:22:26 -0000
*************** const pseudo_typeS md_pseudo_table[] =
*** 343,352 ****
     /* Support " .local $45" syntax.  */
     {"local", mmix_s_local, 1},
  
-    /* Support DWARF2 debugging info.  */
-    {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0},
-    {"loc", dwarf2_directive_loc, 0},
- 
     {NULL, 0, 0}
   };
  
--- 343,348 ----

Index: config/tc-mn10300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mn10300.c,v
retrieving revision 1.41
diff -c -3 -p -w -r1.41 tc-mn10300.c
*** config/tc-mn10300.c	23 Jan 2003 12:51:05 -0000	1.41
--- config/tc-mn10300.c	21 May 2003 11:22:28 -0000
*************** size_t md_longopts_size = sizeof (md_lon
*** 125,132 ****
  /* The target specific pseudo-ops which we support.  */
  const pseudo_typeS md_pseudo_table[] =
  {
-   { "file",     (void (*) PARAMS ((int))) dwarf2_directive_file,  0 },
-   { "loc",      dwarf2_directive_loc,   0 },
    { "am30",	set_arch_mach,		AM30 },
    { "am33",	set_arch_mach,		AM33 },
    { "mn10300",	set_arch_mach,		MN103 },
--- 125,130 ----

Index: config/tc-ppc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ppc.c,v
retrieving revision 1.70
diff -c -3 -p -w -r1.70 tc-ppc.c
*** config/tc-ppc.c	3 May 2003 16:04:11 -0000	1.70
--- config/tc-ppc.c	21 May 2003 11:22:33 -0000
*************** const pseudo_typeS md_pseudo_table[] =
*** 237,244 ****
    { "rdata",	ppc_elf_rdata,	0 },
    { "rodata",	ppc_elf_rdata,	0 },
    { "lcomm",	ppc_elf_lcomm,	0 },
-   { "file",	(void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
-   { "loc",	dwarf2_directive_loc, 0 },
  #endif
  
  #ifdef TE_PE
--- 237,242 ----

Index: config/tc-sh.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sh.c,v
retrieving revision 1.83
diff -c -3 -p -w -r1.83 tc-sh.c
*** config/tc-sh.c	23 Apr 2003 21:09:03 -0000	1.83
--- config/tc-sh.c	21 May 2003 11:22:37 -0000
*************** const pseudo_typeS md_pseudo_table[] =
*** 136,145 ****
    {"2byte", s_uacons, 2},
    {"4byte", s_uacons, 4},
    {"8byte", s_uacons, 8},
- #ifdef BFD_ASSEMBLER
-   {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
-   {"loc", dwarf2_directive_loc, 0 },
- #endif
  #ifdef HAVE_SH64
    {"mode", s_sh64_mode, 0 },
  
--- 136,141 ----

Index: config/tc-sparc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sparc.c,v
retrieving revision 1.46
diff -c -3 -p -w -r1.46 tc-sparc.c
*** config/tc-sparc.c	24 Jan 2003 23:44:44 -0000	1.46
--- config/tc-sparc.c	21 May 2003 11:22:44 -0000
*************** const pseudo_typeS md_pseudo_table[] =
*** 161,168 ****
    {"uaword", s_uacons, 4},
    {"uaxword", s_uacons, 8},
  #ifdef OBJ_ELF
-   {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0},
-   {"loc", dwarf2_directive_loc, 0},
    /* These are specific to sparc/svr4.  */
    {"2byte", s_uacons, 2},
    {"4byte", s_uacons, 4},
--- 161,166 ----

Index: config/tc-v850.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-v850.c,v
retrieving revision 1.31
diff -c -3 -p -w -r1.31 tc-v850.c
*** config/tc-v850.c	21 Feb 2003 12:33:34 -0000	1.31
--- config/tc-v850.c	21 May 2003 11:22:44 -0000
*************** const pseudo_typeS md_pseudo_table[] =
*** 539,546 ****
    { "call_table_data",	v850_seg,		CALL_TABLE_DATA_SECTION	},
    { "call_table_text",	v850_seg,		CALL_TABLE_TEXT_SECTION	},
    { "v850e",		set_machine,		bfd_mach_v850e		},
-   { "file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
-   { "loc",		dwarf2_directive_loc,	0			},
    { "longcall",         v850_longcode,          1                       },
    { "longjump",         v850_longcode,          2                       },
    { NULL,		NULL,			0			}
--- 539,544 ----

Index: config/tc-frv.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-frv.c,v
retrieving revision 1.6
diff -c -3 -p -w -r1.6 tc-frv.c
*** config/tc-frv.c	23 Jan 2003 12:51:04 -0000	1.6
--- config/tc-frv.c	21 May 2003 11:21:50 -0000
***************
*** 20,26 ****
  
  #include <stdio.h>
  #include "as.h"
- #include "dwarf2dbg.h"
  #include "subsegs.h"     
  #include "symcat.h"
  #include "opcodes/frv-desc.h"
--- 20,25 ----
*************** const pseudo_typeS md_pseudo_table[] =
*** 185,192 ****
    { "eflags",	frv_set_flags,		0 },
    { "word",	cons,			4 },
    { "picptr",	frv_pic_ptr,		4 },
-   { "file",	(void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
-   { "loc",	dwarf2_directive_loc,	0 },
    { NULL, 	NULL,			0 }
  };
  
--- 184,189 ----

Index: config/tc-ip2k.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ip2k.c,v
retrieving revision 1.5
diff -c -3 -p -w -r1.5 tc-ip2k.c
*** config/tc-ip2k.c	23 Jan 2003 12:51:05 -0000	1.5
--- config/tc-ip2k.c	21 May 2003 11:22:13 -0000
***************
*** 22,28 ****
  #include <ctype.h>
  
  #include "as.h"
- #include "dwarf2dbg.h"
  #include "subsegs.h"     
  #include "symcat.h"
  #include "opcodes/ip2k-desc.h"
--- 22,27 ----
*************** static void ip2k_elf_section_rtn (int);
*** 66,73 ****
  /* The target specific pseudo-ops which we support.  */
  const pseudo_typeS md_pseudo_table[] =
  {
-     { "file",	(void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
-     { "loc",	dwarf2_directive_loc,	0 },
      { "text",   ip2k_elf_section_text,  0 },
      { "sect",   ip2k_elf_section_rtn,   0 },
      { NULL, 	NULL,			0 }
--- 65,70 ----

Index: config/tc-iq2000.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-iq2000.c,v
retrieving revision 1.1
diff -c -3 -p -w -r1.1 tc-iq2000.c
*** config/tc-iq2000.c	3 Jan 2003 21:47:21 -0000	1.1
--- config/tc-iq2000.c	21 May 2003 11:22:14 -0000
***************
*** 21,27 ****
  #include <stdio.h>
  #include "as.h"
  #include "safe-ctype.h"
- #include "dwarf2dbg.h"
  #include "subsegs.h"     
  #include "symcat.h"
  #include "opcodes/iq2000-desc.h"
--- 21,26 ----
*************** const pseudo_typeS md_pseudo_table[] =
*** 103,110 ****
  {
      { "align",  s_align_bytes,           0 },
      { "word",   cons,                    4 },
-     { "file",	dwarf2_directive_file,	 0 },
-     { "loc",	dwarf2_directive_loc,	 0 },
      { "rdata",  s_change_sec, 		'r'},
      { "sdata",  s_change_sec, 		's'},
      { "set",	s_iq2000_set,		 0 },
--- 102,107 ----

Index: config/tc-xstormy16.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xstormy16.c,v
retrieving revision 1.12
diff -c -3 -p -w -r1.12 tc-xstormy16.c
*** config/tc-xstormy16.c	20 May 2003 11:58:20 -0000	1.12
--- config/tc-xstormy16.c	21 May 2003 11:22:44 -0000
***************
*** 25,31 ****
  #include "opcodes/xstormy16-desc.h"
  #include "opcodes/xstormy16-opc.h"
  #include "cgen.h"
- #include "dwarf2dbg.h"
  
  /* Structure to hold all of the different components describing
     an individual instruction.  */
--- 25,30 ----
*************** md_show_usage (stream)
*** 85,92 ****
  const pseudo_typeS md_pseudo_table[] =
  {
    { "word",	cons,		4 },
-   { "file",     (void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
-   { "loc",      dwarf2_directive_loc,  0 },
    { NULL, 	NULL, 		0 }
  };
  
--- 84,89 ----

Index: config/tc-xtensa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v
retrieving revision 1.1
diff -c -3 -p -w -r1.1 tc-xtensa.c
*** config/tc-xtensa.c	1 Apr 2003 15:50:29 -0000	1.1
--- config/tc-xtensa.c	21 May 2003 11:22:53 -0000
***************
*** 27,33 ****
  #include "subsegs.h"
  #include "xtensa-relax.h"
  #include "xtensa-istack.h"
- #include "dwarf2dbg.h"
  #include "struc-symbol.h"
  #include "xtensa-config.h"
  
--- 27,32 ----
*************** const pseudo_typeS md_pseudo_table[] =
*** 1115,1122 ****
    {"word", cons, 4},
    {"begin", xtensa_begin_directive, 0},
    {"end", xtensa_end_directive, 0},
-   {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0},
-   {"loc", dwarf2_directive_loc, 0},
    {"literal", xtensa_literal_pseudo, 0},
    {NULL, 0, 0},
  };
--- 1114,1119 ----
*************** xg_emit_insn (t_insn, record_fix)
*** 4077,4084 ****
      }
  
    xtensa_insnbuf_to_chars (isa, insnbuf, f);
- 
-   /* dwarf2_emit_insn (byte_count); */
  
    /* Now spit out the opcode fixup.... */
    if (!has_fixup)
--- 4074,4079 ----


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