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]

Re: Misc cleanups


Ian Lance Taylor wrote:
Nathan Sidwell <nathan@codesourcery.com> writes:


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


That SKIP_ZEROES code in general looks bogus to me, although that is
not your fault.  It is setting a host macro based on the target.  That
does not make sense.  It would not work correctly with
--enable-target.

If you are going to add TC_OPCODE_CASE, you should define it in
gas/docs/internals.texi.
good point. This one?

(I must have had a thinko with the #if use of that macro, there's no need
to deal with it being #defined to nothing.)

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.
	* doc/internals.texi (TC_OPCOD_CASE): Document.

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	6 Feb 2004 09:15:19 -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	6 Feb 2004 09:15:21 -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	6 Feb 2004 09:15:30 -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
  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
  		  {
  		    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	6 Feb 2004 09:15:30 -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
  extern char original_case_string[];
  #endif
  
Index: gas/doc/internals.texi
===================================================================
RCS file: /cvs/src/src/gas/doc/internals.texi,v
retrieving revision 1.38
diff -c -3 -p -r1.38 internals.texi
*** gas/doc/internals.texi	23 Jan 2004 12:52:20 -0000	1.38
--- gas/doc/internals.texi	6 Feb 2004 09:15:36 -0000
*************** arguments, the character before the @kbd
*** 1033,1038 ****
--- 1033,1044 ----
  If you define this macro, it should return nonzero if the current input line
  pointer should be treated as the end of a line.
  
+ @item TC_OPCODE_CASE
+ @cindex TC_OPCODE_CASE
+ This macro controls whether mnemonics are case sensitive. Define it to 1 to
+ make them so. Leave it undefined or defined to 0 to make them insensitive.
+ The default is insensitive.
+ 
  @item md_parse_name
  @cindex md_parse_name
  If this macro is defined, GAS will call it for any symbol found in an
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	6 Feb 2004 09:15:40 -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]