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]

Misc cleanups


Hi,
in doing a binutils port I made some cleanups and tweaks to the common code.

1) If zeroes are not nops, then you don't want any SKIP_ZEROS stuff.

2) There was a spurious ';' on dwarf2dbg.h

3) SKIP_WHITESPACE didn't work in 'if (cond) SKIP_WHITESPACE(); else ...'

4) The IGNORE_OPCODE_CASE #define was always enabled. I replaced with a
TC_OPCODE_CASE that can be defined to 0 or 1 (or left undefined).

5) Some of the generic pseudos needed to be removed, I achieved this
by adding them to the md pseudo table with NULL handlers. Then tweaking
the pseudo handling code.

6) one of the macro tests had an uppercase ELSE, which this case
sensitive assembler barfed on.

ok?

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2004-02-05  Nathan Sidwell  <nathan@codesourcery.com>

	* objdump.c (disassemble_bytes): Allow SKIP_ZEROES to be zero.

2004-02-05  Nathan Sidwell  <nathan@codesourcery.com>

	* dwarf2dbg.c (DWARF2_ADDR_SIZE): Remove trailing ';'
	* read.h (SKIP_WHITESPACE): Turn into an expression.
	(IGNORE_OPCODE_CASE): Do not define. Replace with ...
	(TC_OPCODE_CASE): ... this.
	* read.c: Replace IGNORE_OPCODE_CASE with TC_OPCODE_CASE.
	(read_a_source_file): A pseudo is removed by having a NULL handler.

2004-02-05  Nathan Sidwell  <nathan@codesourcery.com>

	* gas/macros/test2.s: Lowercase it.

Index: binutils/objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.86
diff -c -3 -p -r1.86 objdump.c
*** binutils/objdump.c	22 Dec 2003 10:49:59 -0000	1.86
--- binutils/objdump.c	5 Feb 2004 17:05:58 -0000
*************** disassemble_bytes (struct disassemble_in
*** 1281,1290 ****
--- 1281,1293 ----
    addr_offset = start_offset;
    while (addr_offset < stop_offset)
      {
+ #if SKIP_ZEROES
        bfd_vma z;
+ #endif
        int octets = 0;
        bfd_boolean need_nl = FALSE;
  
+ #if SKIP_ZEROES
        /* If we see more than SKIP_ZEROES octets of zeroes, we just
  	 print `...'.  */
        for (z = addr_offset * opb; z < stop_offset * opb; z++)
*************** disassemble_bytes (struct disassemble_in
*** 1309,1314 ****
--- 1312,1318 ----
  	  octets = z - addr_offset * opb;
  	}
        else
+ #endif
  	{
  	  char buf[50];
  	  SFILE sfile;
Index: gas/dwarf2dbg.c
===================================================================
RCS file: /cvs/src/src/gas/dwarf2dbg.c,v
retrieving revision 1.67
diff -c -3 -p -r1.67 dwarf2dbg.c
*** gas/dwarf2dbg.c	6 Dec 2003 16:16:51 -0000	1.67
--- gas/dwarf2dbg.c	5 Feb 2004 17:05:59 -0000
***************
*** 49,55 ****
  #endif
  
  #ifndef DWARF2_ADDR_SIZE
! # define DWARF2_ADDR_SIZE(bfd) (bfd_arch_bits_per_address (bfd) / 8);
  #endif
  
  #ifdef BFD_ASSEMBLER
--- 49,55 ----
  #endif
  
  #ifndef DWARF2_ADDR_SIZE
! # define DWARF2_ADDR_SIZE(bfd) (bfd_arch_bits_per_address (bfd) / 8)
  #endif
  
  #ifdef BFD_ASSEMBLER
Index: gas/read.c
===================================================================
RCS file: /cvs/src/src/gas/read.c,v
retrieving revision 1.73
diff -c -3 -p -r1.73 read.c
*** gas/read.c	13 Dec 2003 08:59:24 -0000	1.73
--- gas/read.c	5 Feb 2004 17:06:09 -0000
*************** char is_end_of_line[256] = {
*** 155,161 ****
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0	/* */
  };
  
! #ifdef  IGNORE_OPCODE_CASE
  char original_case_string[128];
  #endif
  
--- 155,161 ----
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0	/* */
  };
  
! #if !(TC_OPCODE_CASE - 0)
  char original_case_string[128];
  #endif
  
*************** read_a_source_file (char *name)
*** 720,726 ****
  		  /* Expect pseudo-op or machine instruction.  */
  		  pop = NULL;
  
! #ifdef IGNORE_OPCODE_CASE
  		  {
  		    char *s2 = s;
  
--- 720,726 ----
  		  /* Expect pseudo-op or machine instruction.  */
  		  pop = NULL;
  
! #if !(TC_OPCODE_CASE - 0)
  		  {
  		    char *s2 = s;
  
*************** read_a_source_file (char *name)
*** 754,759 ****
--- 754,761 ----
  
  		      if (pop == NULL)
  			pop = (pseudo_typeS *) hash_find (po_hash, s + 1);
+ 		      if (pop && !pop->poc_handler)
+ 			pop = NULL;
  
  		      /* In MRI mode, we may need to insert an
  			 automatic alignment directive.  What a hack
Index: gas/read.h
===================================================================
RCS file: /cvs/src/src/gas/read.h,v
retrieving revision 1.21
diff -c -3 -p -r1.21 read.h
*** gas/read.h	13 Dec 2003 08:59:24 -0000	1.21
--- gas/read.h	5 Feb 2004 17:06:09 -0000
*************** extern char *input_line_pointer;	/* -> c
*** 30,39 ****
  
  #ifdef PERMIT_WHITESPACE
  #define SKIP_WHITESPACE()			\
!   {						\
!     if (* input_line_pointer == ' ')		\
!       ++ input_line_pointer;			\
!   }
  #else
  #define SKIP_WHITESPACE() know(*input_line_pointer != ' ' )
  #endif
--- 30,36 ----
  
  #ifdef PERMIT_WHITESPACE
  #define SKIP_WHITESPACE()			\
!   ((*input_line_pointer == ' ') ? ++input_line_pointer : 0)
  #else
  #define SKIP_WHITESPACE() know(*input_line_pointer != ' ' )
  #endif
*************** enum linkonce_type {
*** 93,100 ****
    LINKONCE_SAME_CONTENTS
  };
  
! #define IGNORE_OPCODE_CASE
! #ifdef  IGNORE_OPCODE_CASE
  extern char original_case_string[];
  #endif
  
--- 90,96 ----
    LINKONCE_SAME_CONTENTS
  };
  
! #if  !(TC_OPCODE_CASE - 0)
  extern char original_case_string[];
  #endif
  
Index: gas/testsuite/gas/macros/test2.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/macros/test2.s,v
retrieving revision 1.2
diff -c -3 -p -r1.2 test2.s
*** gas/testsuite/gas/macros/test2.s	10 Jun 1999 13:48:41 -0000	1.2
--- gas/testsuite/gas/macros/test2.s	5 Feb 2004 17:06:13 -0000
***************
*** 1,7 ****
  	.macro	m arg1 arg2 arg3
  	.long	\arg1
  	.ifc	,\arg2\arg3
! 	.ELSE
  	m	\arg2,\arg3
  	.endif
  	.endm
--- 1,7 ----
  	.macro	m arg1 arg2 arg3
  	.long	\arg1
  	.ifc	,\arg2\arg3
! 	.else
  	m	\arg2,\arg3
  	.endif
  	.endm

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