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]

[revised patch] ns32k gas/bfd cleanup


Ian Dall writes:
 > Matt Thomas writes:
 >  > At 07:45 AM 7/28/2002, Ian Dall wrote:
 >  > [patch for displacement overflows]
 >  >
 >  > I strongly believe these should as_fatal errors since they result in
 >  > an incorrect object being generated.
 > Probably what it should be is as_bad rather than as_fatal. That way
 > you get to see all such errors rather than just the first one.

Here is a revised patch.

bfd/ChangeLog entries:

2002-07-27  Ian Dall  <ian@sibyl.beware.dropbear.id.au>

	* cpu-ns32k.c (_bfd_ns32k_put_immdeiate, _bfd_ns32k_get_immediate):
	There is no 8 byte relocation type for this architecture.
	(do_ns32k_reloc): Use bfd_vma instead of native types.

2002-07-26  Ian Dall  <ian@sibyl.beware.dropbear.id.au>

	* aout-ns32k.c (howto_table): Add appropriate overflow detection
	to all table entries.
	(_bfd_ns32k_relocate_contents): put_data returns void.

	* cpu-ns32k.c (do_ns32k_reloc, bfd_ns32k_put_displacement)
	(bfd_ns32k_put_immediate, _bfd_ns32k_relocate_contents) put_data
	returns void.
	(_bfd_ns32k_put_displacement): Don't check for
	overflow. We can rely on generic code to do that.

	* ns32k.h: (_bfd_ns32k_put_displacement, _bfd_ns32k_put_immediate)
	(_bfd_do_ns32k_reloc_contents): Fix prototypes. put data functions
	return void.

gas/ChangeLog entries:

2002-07-27  Ian Dall  <ian@sibyl.beware.dropbear.id.au>

	* config/tc-ns32k.h (md_pcrel_adjust): Supply prototype.

	* config/tc-ns32k.c (convert_iif, md_parse_option, md_show_usage):
	Allow default displacement size to be an option	"--disp-size-default".

	* config/tc-ns32k.c (md_number_to_disp): Make error messages
	include value. Use %d to print integers, not %s.
	(fix_new_ns32k): conditionally set fx_no_overflow so we don't
	get duplicate messages sometimes.

	* config/tc-ns32k.c (convert_iif): Grow frag to max possible
	instruction size. Avoid creating unnecessary fixes.
	

	* config/tc-ns32k.c(md_number_to_field) Add prototype
	(addr_mode, optlist, list_search, encode_operands)
	(encode_operand, parse, convert_iif, md_fix_pcrel_adjust): Add
	prototypes and make static.
	(struct addr_mode): Make mode and scaled_mode explicitly signed.
	(evaluate_expr): Use resultP argument instead of exprP global.
	(get_addr_mode): Quiten compiler warnings.
	(encode_operand): eliminate unused variables. Quiten compiler
	warnings. Eliminate nul character in format strings.
	(parse): argc is unsigned.
	(reloc): Type cast index to quieten compiler.
	(md_pcrel_adjust, md_apply_fix3): Remove unused variable.
	(md_convert_frag): Note unused parameters. Remove unused
	variables.
	(md_create_long_jump, md_create_short_jump,
	md_undefined_symbol_name, md_section_align, tc_gen_reloc): Note
	unused parameters.
	

Index: bfd/aout-ns32k.c
===================================================================
RCS file: /cvs/src/src/bfd/aout-ns32k.c,v
retrieving revision 1.8
diff -c -r1.8 aout-ns32k.c
*** bfd/aout-ns32k.c	2 Oct 2001 05:58:41 -0000	1.8
--- bfd/aout-ns32k.c	29 Jul 2002 12:53:39 -0000
***************
*** 1,5 ****
  /* BFD back-end for ns32k a.out-ish binaries.
!    Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 2000, 2001
     Free Software Foundation, Inc.
     Contributed by Ian Dall (idall@eleceng.adelaide.edu.au).
  
--- 1,5 ----
  /* BFD back-end for ns32k a.out-ish binaries.
!    Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002
     Free Software Foundation, Inc.
     Contributed by Ian Dall (idall@eleceng.adelaide.edu.au).
  
***************
*** 98,140 ****
  
  reloc_howto_type MY(howto_table)[] =
    {
      /* ns32k immediate operands.  */
!     HOWTO (BFD_RELOC_NS32K_IMM_8, 0, 0, 8, false, 0, true,
  	   _bfd_ns32k_reloc_imm, "NS32K_IMM_8",
  	   true, 0x000000ff,0x000000ff, false),
!     HOWTO (BFD_RELOC_NS32K_IMM_16, 0, 1, 16, false, 0, true,
  	   _bfd_ns32k_reloc_imm,  "NS32K_IMM_16",
  	   true, 0x0000ffff,0x0000ffff, false),
!     HOWTO (BFD_RELOC_NS32K_IMM_32, 0, 2, 32, false, 0, true,
  	   _bfd_ns32k_reloc_imm, "NS32K_IMM_32",
  	   true, 0xffffffff,0xffffffff, false),
!     HOWTO (BFD_RELOC_NS32K_IMM_8_PCREL, 0, 0, 8, true, 0, false,
  	   _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_8",
  	   true, 0x000000ff, 0x000000ff, false),
!     HOWTO (BFD_RELOC_NS32K_IMM_16_PCREL, 0, 1, 16, true, 0, false,
  	   _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_16",
  	   true, 0x0000ffff,0x0000ffff, false),
!     HOWTO (BFD_RELOC_NS32K_IMM_32_PCREL, 0, 2, 32, true, 0, false,
  	   _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_32",
  	   true, 0xffffffff,0xffffffff, false),
  
      /* ns32k displacements.  */
!     HOWTO (BFD_RELOC_NS32K_DISP_8, 0, 0, 8, false, 0, true,
  	   _bfd_ns32k_reloc_disp, "NS32K_DISP_8",
  	   true, 0x000000ff,0x000000ff, false),
!     HOWTO (BFD_RELOC_NS32K_DISP_16, 0, 1, 16, false, 0, true,
  	   _bfd_ns32k_reloc_disp, "NS32K_DISP_16",
  	   true, 0x0000ffff, 0x0000ffff, false),
!     HOWTO (BFD_RELOC_NS32K_DISP_32, 0, 2, 32, false, 0, true,
  	   _bfd_ns32k_reloc_disp, "NS32K_DISP_32",
  	   true, 0xffffffff, 0xffffffff, false),
!     HOWTO (BFD_RELOC_NS32K_DISP_8_PCREL, 0, 0, 8, true, 0, false,
  	   _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_8",
  	   true, 0x000000ff,0x000000ff, false),
!     HOWTO (BFD_RELOC_NS32K_DISP_16_PCREL, 0, 1, 16, true, 0, false,
  	   _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_16",
  	   true, 0x0000ffff,0x0000ffff, false),
!     HOWTO (BFD_RELOC_NS32K_DISP_32_PCREL, 0, 2, 32, true, 0, false,
  	   _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_32",
  	   true, 0xffffffff,0xffffffff, false),
  
--- 98,141 ----
  
  reloc_howto_type MY(howto_table)[] =
    {
+     /* type           rs   size bsz  pcrel bitpos ovrf                  sf name          part_inpl readmask setmask pcdone */
      /* ns32k immediate operands.  */
!     HOWTO (BFD_RELOC_NS32K_IMM_8, 0, 0, 8, false, 0, complain_overflow_signed,
  	   _bfd_ns32k_reloc_imm, "NS32K_IMM_8",
  	   true, 0x000000ff,0x000000ff, false),
!     HOWTO (BFD_RELOC_NS32K_IMM_16, 0, 1, 16, false, 0, complain_overflow_signed,
  	   _bfd_ns32k_reloc_imm,  "NS32K_IMM_16",
  	   true, 0x0000ffff,0x0000ffff, false),
!     HOWTO (BFD_RELOC_NS32K_IMM_32, 0, 2, 32, false, 0, complain_overflow_signed,
  	   _bfd_ns32k_reloc_imm, "NS32K_IMM_32",
  	   true, 0xffffffff,0xffffffff, false),
!     HOWTO (BFD_RELOC_NS32K_IMM_8_PCREL, 0, 0, 8, true, 0, complain_overflow_signed,
  	   _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_8",
  	   true, 0x000000ff, 0x000000ff, false),
!     HOWTO (BFD_RELOC_NS32K_IMM_16_PCREL, 0, 1, 16, true, 0, complain_overflow_signed,
  	   _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_16",
  	   true, 0x0000ffff,0x0000ffff, false),
!     HOWTO (BFD_RELOC_NS32K_IMM_32_PCREL, 0, 2, 32, true, 0, complain_overflow_signed,
  	   _bfd_ns32k_reloc_imm, "PCREL_NS32K_IMM_32",
  	   true, 0xffffffff,0xffffffff, false),
  
      /* ns32k displacements.  */
!     HOWTO (BFD_RELOC_NS32K_DISP_8, 0, 0, 7, false, 0, complain_overflow_signed,
  	   _bfd_ns32k_reloc_disp, "NS32K_DISP_8",
  	   true, 0x000000ff,0x000000ff, false),
!     HOWTO (BFD_RELOC_NS32K_DISP_16, 0, 1, 14, false, 0, complain_overflow_signed,
  	   _bfd_ns32k_reloc_disp, "NS32K_DISP_16",
  	   true, 0x0000ffff, 0x0000ffff, false),
!     HOWTO (BFD_RELOC_NS32K_DISP_32, 0, 2, 30, false, 0, complain_overflow_signed,
  	   _bfd_ns32k_reloc_disp, "NS32K_DISP_32",
  	   true, 0xffffffff, 0xffffffff, false),
!     HOWTO (BFD_RELOC_NS32K_DISP_8_PCREL, 0, 0, 7, true, 0, complain_overflow_signed,
  	   _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_8",
  	   true, 0x000000ff,0x000000ff, false),
!     HOWTO (BFD_RELOC_NS32K_DISP_16_PCREL, 0, 1, 14, true, 0, complain_overflow_signed,
  	   _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_16",
  	   true, 0x0000ffff,0x0000ffff, false),
!     HOWTO (BFD_RELOC_NS32K_DISP_32_PCREL, 0, 2, 30, true, 0, complain_overflow_signed,
  	   _bfd_ns32k_reloc_disp, "PCREL_NS32K_DISP_32",
  	   true, 0xffffffff,0xffffffff, false),
  
***************
*** 355,361 ****
  {
    int r_ns32k_type = (howto - MY(howto_table)) / 6;
    bfd_vma (*get_data) PARAMS ((bfd_byte *, int));
!   int (*put_data) PARAMS ((bfd_vma, bfd_byte *, int));
  
    switch (r_ns32k_type)
      {
--- 356,362 ----
  {
    int r_ns32k_type = (howto - MY(howto_table)) / 6;
    bfd_vma (*get_data) PARAMS ((bfd_byte *, int));
!   void (*put_data) PARAMS ((bfd_vma, bfd_byte *, int));
  
    switch (r_ns32k_type)
      {
Index: bfd/cpu-ns32k.c
===================================================================
RCS file: /cvs/src/src/bfd/cpu-ns32k.c,v
retrieving revision 1.8
diff -c -r1.8 cpu-ns32k.c
*** bfd/cpu-ns32k.c	25 Jun 2002 06:21:50 -0000	1.8
--- bfd/cpu-ns32k.c	29 Jul 2002 12:53:43 -0000
***************
*** 40,46 ****
    PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *,
  	   bfd *, char **,
  	   bfd_vma (*) (bfd_byte *, int),
! 	   int (*) (bfd_vma, bfd_byte *, int)));
  
  bfd_vma
  _bfd_ns32k_get_displacement (buffer, size)
--- 40,46 ----
    PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *,
  	   bfd *, char **,
  	   bfd_vma (*) (bfd_byte *, int),
! 	   void (*) (bfd_vma, bfd_byte *, int)));
  
  bfd_vma
  _bfd_ns32k_get_displacement (buffer, size)
***************
*** 73,79 ****
    return value;
  }
  
! int
  _bfd_ns32k_put_displacement (value, buffer, size)
       bfd_vma value;
       bfd_byte *buffer;
--- 73,79 ----
    return value;
  }
  
! void
  _bfd_ns32k_put_displacement (value, buffer, size)
       bfd_vma value;
       bfd_byte *buffer;
***************
*** 82,96 ****
    switch (size)
      {
      case 1:
-       if (value + 0x40 > 0x7f)
- 	return -1;
        value &= 0x7f;
        *buffer++ = value;
        break;
  
      case 2:
-       if (value + 0x2000 > 0x3fff)
- 	return -1;
        value &= 0x3fff;
        value |= 0x8000;
        *buffer++ = (value >> 8);
--- 82,92 ----
***************
*** 98,116 ****
        break;
  
      case 4:
-       /* FIXME: is this correct?  -0x1f000000 <= value < 0x2000000 */
-       if (value + 0x1f000000 > 0x3effffff)
- 	return -1;
        value |= (bfd_vma) 0xc0000000;
        *buffer++ = (value >> 24);
        *buffer++ = (value >> 16);
        *buffer++ = (value >> 8);
        *buffer++ = value;
        break;
-     default:
-       return -1;
    }
!   return 0;
  }
  
  bfd_vma
--- 94,107 ----
        break;
  
      case 4:
        value |= (bfd_vma) 0xc0000000;
        *buffer++ = (value >> 24);
        *buffer++ = (value >> 16);
        *buffer++ = (value >> 8);
        *buffer++ = value;
        break;
    }
!   return;
  }
  
  bfd_vma
***************
*** 121,131 ****
    bfd_vma value = 0;
    switch (size)
      {
-     case 8:
-       value = (value << 8) | (*buffer++ & 0xff);
-       value = (value << 8) | (*buffer++ & 0xff);
-       value = (value << 8) | (*buffer++ & 0xff);
-       value = (value << 8) | (*buffer++ & 0xff);
      case 4:
        value = (value << 8) | (*buffer++ & 0xff);
        value = (value << 8) | (*buffer++ & 0xff);
--- 112,117 ----
***************
*** 133,143 ****
        value = (value << 8) | (*buffer++ & 0xff);
      case 1:
        value = (value << 8) | (*buffer++ & 0xff);
      }
    return value;
  }
  
! int
  _bfd_ns32k_put_immediate (value, buffer, size)
       bfd_vma value;
       bfd_byte *buffer;
--- 119,132 ----
        value = (value << 8) | (*buffer++ & 0xff);
      case 1:
        value = (value << 8) | (*buffer++ & 0xff);
+       break;
+     default:
+       abort ();
      }
    return value;
  }
  
! void
  _bfd_ns32k_put_immediate (value, buffer, size)
       bfd_vma value;
       bfd_byte *buffer;
***************
*** 146,156 ****
    buffer += size - 1;
    switch (size)
      {
-     case 8:
-       *buffer-- = (value & 0xff); value >>= 8;
-       *buffer-- = (value & 0xff); value >>= 8;
-       *buffer-- = (value & 0xff); value >>= 8;
-       *buffer-- = (value & 0xff); value >>= 8;
      case 4:
        *buffer-- = (value & 0xff); value >>= 8;
        *buffer-- = (value & 0xff); value >>= 8;
--- 135,140 ----
***************
*** 159,165 ****
      case 1:
        *buffer-- = (value & 0xff); value >>= 8;
      }
-   return 0;
  }
  
  /* This is just like the standard perform_relocation except we
--- 143,148 ----
***************
*** 178,184 ****
       bfd *output_bfd;
       char **error_message ATTRIBUTE_UNUSED;
       bfd_vma (*get_data) PARAMS ((bfd_byte *, int));
!      int (*put_data) PARAMS ((bfd_vma, bfd_byte *, int));
  {
    int overflow = 0;
    bfd_vma relocation;
--- 161,167 ----
       bfd *output_bfd;
       char **error_message ATTRIBUTE_UNUSED;
       bfd_vma (*get_data) PARAMS ((bfd_byte *, int));
!      void (*put_data) PARAMS ((bfd_vma, bfd_byte *, int));
  {
    int overflow = 0;
    bfd_vma relocation;
***************
*** 538,571 ****
      {
      case 0:
        {
! 	char x = get_data (location, 1);
  	DOIT (x);
! 	overflow = put_data ((bfd_vma) x, location, 1);
        }
        break;
  
      case 1:
        if (relocation)
  	{
! 	  short x = get_data (location, 2);
  	  DOIT (x);
! 	  overflow = put_data ((bfd_vma) x, location, 2);
  	}
        break;
      case 2:
        if (relocation)
  	{
! 	  long x = get_data (location, 4);
  	  DOIT (x);
! 	  overflow = put_data ((bfd_vma) x, location, 4);
  	}
        break;
      case -2:
        {
! 	long x = get_data (location, 4);
  	relocation = -relocation;
  	DOIT(x);
! 	overflow = put_data ((bfd_vma) x, location, 4);
        }
        break;
  
--- 521,554 ----
      {
      case 0:
        {
! 	bfd_vma x = get_data (location, 1);
  	DOIT (x);
! 	put_data ((bfd_vma) x, location, 1);
        }
        break;
  
      case 1:
        if (relocation)
  	{
! 	  bfd_vma x = get_data (location, 2);
  	  DOIT (x);
! 	  put_data ((bfd_vma) x, location, 2);
  	}
        break;
      case 2:
        if (relocation)
  	{
! 	  bfd_vma x = get_data (location, 4);
  	  DOIT (x);
! 	  put_data ((bfd_vma) x, location, 4);
  	}
        break;
      case -2:
        {
! 	bfd_vma x = get_data (location, 4);
  	relocation = -relocation;
  	DOIT(x);
! 	put_data ((bfd_vma) x, location, 4);
        }
        break;
  
***************
*** 579,585 ****
  	{
  	  bfd_vma x = get_data (location, 8);
  	  DOIT (x);
! 	  overflow = put_data (x, location, 8);
  	}
  #else
        abort ();
--- 562,568 ----
  	{
  	  bfd_vma x = get_data (location, 8);
  	  DOIT (x);
! 	  put_data (x, location, 8);
  	}
  #else
        abort ();
***************
*** 604,610 ****
       bfd_vma relocation;
       bfd_byte *location;
       bfd_vma (*get_data) PARAMS ((bfd_byte *, int));
!      int (*put_data) PARAMS ((bfd_vma, bfd_byte *, int));
  {
    int size;
    bfd_vma x;
--- 587,593 ----
       bfd_vma relocation;
       bfd_byte *location;
       bfd_vma (*get_data) PARAMS ((bfd_byte *, int));
!      void (*put_data) PARAMS ((bfd_vma, bfd_byte *, int));
  {
    int size;
    bfd_vma x;
Index: bfd/ns32k.h
===================================================================
RCS file: /cvs/src/src/bfd/ns32k.h,v
retrieving revision 1.2
diff -c -r1.2 ns32k.h
*** bfd/ns32k.h	18 Sep 2001 09:57:25 -0000	1.2
--- bfd/ns32k.h	29 Jul 2002 12:53:43 -0000
***************
*** 1,5 ****
  /* Header file for ns32k routines.
!    Copyright 1996, 2001 Free Software Foundation, Inc.
     Written by Cygnus Support.
  
  This file is part of BFD, the Binary File Descriptor library.
--- 1,5 ----
  /* Header file for ns32k routines.
!    Copyright 1996, 2001, 2002 Free Software Foundation, Inc.
     Written by Cygnus Support.
  
  This file is part of BFD, the Binary File Descriptor library.
***************
*** 24,30 ****
  extern bfd_reloc_status_type _bfd_do_ns32k_reloc_contents
    PARAMS ((reloc_howto_type *, bfd *, bfd_vma, bfd_byte *,
  	   bfd_vma (*) (bfd_byte *, int),
! 	   int (*) (bfd_vma, bfd_byte *, int)));
  
  extern bfd_reloc_status_type _bfd_ns32k_final_link_relocate
    PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma,
--- 24,30 ----
  extern bfd_reloc_status_type _bfd_do_ns32k_reloc_contents
    PARAMS ((reloc_howto_type *, bfd *, bfd_vma, bfd_byte *,
  	   bfd_vma (*) (bfd_byte *, int),
! 	   void (*) (bfd_vma, bfd_byte *, int)));
  
  extern bfd_reloc_status_type _bfd_ns32k_final_link_relocate
    PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma,
***************
*** 32,39 ****
  
  extern bfd_vma _bfd_ns32k_get_displacement PARAMS ((bfd_byte *, int));
  extern bfd_vma _bfd_ns32k_get_immediate PARAMS ((bfd_byte *, int));
! extern int _bfd_ns32k_put_displacement PARAMS ((bfd_vma, bfd_byte *, int));
! extern int _bfd_ns32k_put_immediate PARAMS ((bfd_vma, bfd_byte *, int));
  
  extern bfd_reloc_status_type _bfd_ns32k_reloc_disp
    PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
--- 32,39 ----
  
  extern bfd_vma _bfd_ns32k_get_displacement PARAMS ((bfd_byte *, int));
  extern bfd_vma _bfd_ns32k_get_immediate PARAMS ((bfd_byte *, int));
! extern void _bfd_ns32k_put_displacement PARAMS ((bfd_vma, bfd_byte *, int));
! extern void _bfd_ns32k_put_immediate PARAMS ((bfd_vma, bfd_byte *, int));
  
  extern bfd_reloc_status_type _bfd_ns32k_reloc_disp
    PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
Index: gas/config/tc-ns32k.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ns32k.c,v
retrieving revision 1.15
diff -c -r1.15 tc-ns32k.c
*** gas/config/tc-ns32k.c	8 Jun 2002 07:37:15 -0000	1.15
--- gas/config/tc-ns32k.c	29 Jul 2002 12:53:52 -0000
***************
*** 63,68 ****
--- 63,69 ----
  const char comment_chars[] = "#";
  const char line_comment_chars[] = LINE_COMMENT_CHARS;
  const char line_separator_chars[] = ";";
+ static int default_disp_size = 4; /* Displacement size for external refs */
  
  #if !defined(ABSOLUTE_PREFIX) && !defined(IMMEDIATE_PREFIX)
  #define ABSOLUTE_PREFIX '@'	/* One or the other MUST be defined */
***************
*** 70,77 ****
  
  struct addr_mode
    {
!     char mode;			/* addressing mode of operand (0-31) */
!     char scaled_mode;		/* mode combined with scaled mode */
      char scaled_reg;		/* register used in scaled+1 (1-8) */
      char float_flag;		/* set if R0..R7 was F0..F7 ie a
  				   floating-point-register */
--- 71,78 ----
  
  struct addr_mode
    {
!     signed char mode;		/* addressing mode of operand (0-31) */
!     signed char scaled_mode;	/* mode combined with scaled mode */
      char scaled_reg;		/* register used in scaled+1 (1-8) */
      char float_flag;		/* set if R0..R7 was F0..F7 ie a
  				   floating-point-register */
***************
*** 370,375 ****
--- 371,377 ----
  static void evaluate_expr PARAMS ((expressionS * resultP, char *ptr));
  static void md_number_to_disp PARAMS ((char *buf, long val, int n));
  static void md_number_to_imm PARAMS ((char *buf, long val, int n));
+ static void md_number_to_field PARAMS ((char *, long val, bit_fixS *));
  
  /* Parse a general operand into an addressingmode struct
  
***************
*** 379,385 ****
  
     Out: data in addr_mode struct.  */
  
! int
  addr_mode (operand, addr_modeP, recursive_level)
       char *operand;
       register addr_modeS *addr_modeP;
--- 381,389 ----
  
     Out: data in addr_mode struct.  */
  
! static int addr_mode PARAMS ((char *, addr_modeS *, int recursive_level));
! 
! static int
  addr_mode (operand, addr_modeP, recursive_level)
       char *operand;
       register addr_modeS *addr_modeP;
***************
*** 443,449 ****
  		  return -1;
  		}
  	    default:
! 	      as_warn (_("Invalid syntax in PC-relative addressing mode"));
  	      return 0;
  	    }
  	}
--- 447,453 ----
  		  return -1;
  		}
  	    default:
! 	      as_bad (_("Invalid syntax in PC-relative addressing mode"));
  	      return 0;
  	    }
  	}
***************
*** 467,473 ****
  	      while (j < strl && i != 0);
  	      if (i != 0 || !(str[j + 1] == '-' || str[j + 1] == '+'))
  		{
! 		  as_warn (_("Invalid syntax in External addressing mode"));
  		  return (0);
  		}
  	      str[j] = '\000';		/* null terminate disp[0] */
--- 471,477 ----
  	      while (j < strl && i != 0);
  	      if (i != 0 || !(str[j + 1] == '-' || str[j + 1] == '+'))
  		{
! 		  as_bad (_("Invalid syntax in External addressing mode"));
  		  return (0);
  		}
  	      str[j] = '\000';		/* null terminate disp[0] */
***************
*** 547,553 ****
  
  		  if (i != 0)
  		    {
! 		      as_warn (_("Invalid syntax in Memory Relative addressing mode"));
  		      return (0);
  		    }
  
--- 551,557 ----
  
  		  if (i != 0)
  		    {
! 		      as_bad (_("Invalid syntax in Memory Relative addressing mode"));
  		      return (0);
  		    }
  
***************
*** 614,630 ****
  	      mode = 31;
  	      break;
  	    default:
! 	      as_warn (_("Invalid scaled-indexed mode, use (b,w,d,q)"));
  
  	      if (str[strl - 3] != ':' || str[strl - 6] != '['
  		  || str[strl - 5] == 'r' || str[strl - 4] < '0'
  		  || str[strl - 4] > '7')
! 		as_warn (_("Syntax in scaled-indexed mode, use [Rn:m] where n=[0..7] m={b,w,d,q}"));
  	    } /* Scaled index.  */
  
  	  if (recursive_level > 0)
  	    {
! 	      as_warn (_("Scaled-indexed addressing mode combined with scaled-index"));
  	      return 0;
  	    }
  
--- 618,634 ----
  	      mode = 31;
  	      break;
  	    default:
! 	      as_bad (_("Invalid scaled-indexed mode, use (b,w,d,q)"));
  
  	      if (str[strl - 3] != ':' || str[strl - 6] != '['
  		  || str[strl - 5] == 'r' || str[strl - 4] < '0'
  		  || str[strl - 4] > '7')
! 		as_bad (_("Syntax in scaled-indexed mode, use [Rn:m] where n=[0..7] m={b,w,d,q}"));
  	    } /* Scaled index.  */
  
  	  if (recursive_level > 0)
  	    {
! 	      as_bad (_("Scaled-indexed addressing mode combined with scaled-index"));
  	      return 0;
  	    }
  
***************
*** 635,641 ****
  
  	  if (!i || addr_modeP->mode == 20)
  	    {
! 	      as_warn (_("Invalid or illegal addressing mode combined with scaled-index"));
  	      return 0;
  	    }
  
--- 639,645 ----
  
  	  if (!i || addr_modeP->mode == 20)
  	    {
! 	      as_bad (_("Invalid or illegal addressing mode combined with scaled-index"));
  	      return 0;
  	    }
  
***************
*** 659,665 ****
     specifying suffixes and determines size of immediate mode via
     ns32k-opcode.  Also builds index bytes if needed.  */
  
! int
  get_addr_mode (ptr, addr_modeP)
       char *ptr;
       addr_modeS *addr_modeP;
--- 663,670 ----
     specifying suffixes and determines size of immediate mode via
     ns32k-opcode.  Also builds index bytes if needed.  */
  
! static int get_addr_mode PARAMS ((char *, addr_modeS *));
! static int
  get_addr_mode (ptr, addr_modeP)
       char *ptr;
       addr_modeS *addr_modeP;
***************
*** 700,706 ****
       case.  Think it does so with local labels too, not optimum, pcrel
       is better.  When I have time I will make gas check this and
       select pcrel when possible Actually that is trivial.  */
!   if (tmp = addr_modeP->scaled_reg)
      {				/* Build indexbyte.  */
        tmp--;			/* Remember regnumber comes incremented for
  				   flagpurpose.  */
--- 705,711 ----
       case.  Think it does so with local labels too, not optimum, pcrel
       is better.  When I have time I will make gas check this and
       select pcrel when possible Actually that is trivial.  */
!   if ((tmp = addr_modeP->scaled_reg))
      {				/* Build indexbyte.  */
        tmp--;			/* Remember regnumber comes incremented for
  				   flagpurpose.  */
***************
*** 709,715 ****
        addr_modeP->am_size += 1;
      }
  
!   if (disp_test[addr_modeP->mode])
      {
        register char c;
        register char suffix;
--- 714,721 ----
        addr_modeP->am_size += 1;
      }
  
!   assert (addr_modeP->mode >= 0); 
!   if (disp_test[(unsigned int) addr_modeP->mode])
      {
        register char c;
        register char suffix;
***************
*** 721,727 ****
        /* There was a displacement, probe for length  specifying suffix.  */
        addr_modeP->pcrel = 0;
  
!       if (disp_test[addr_modeP->mode])
  	{
  	  /* There is a displacement.  */
  	  if (addr_modeP->mode == 27 || addr_modeP->scaled_mode == 27)
--- 727,734 ----
        /* There was a displacement, probe for length  specifying suffix.  */
        addr_modeP->pcrel = 0;
  
!       assert(addr_modeP->mode >= 0);
!       if (disp_test[(unsigned int) addr_modeP->mode])
  	{
  	  /* There is a displacement.  */
  	  if (addr_modeP->mode == 27 || addr_modeP->scaled_mode == 27)
***************
*** 734,745 ****
  	    {
  	      suffix_sub = suffix = 0;
  
! 	      if (toP = addr_modeP->disp[i])
  		{
  		  /* Suffix of expression, the largest size rules.  */
  		  fromP = toP;
  
! 		  while (c = *fromP++)
  		    {
  		      *toP++ = c;
  		      if (c == ':')
--- 741,752 ----
  	    {
  	      suffix_sub = suffix = 0;
  
! 	      if ((toP = addr_modeP->disp[i]))
  		{
  		  /* Suffix of expression, the largest size rules.  */
  		  fromP = toP;
  
! 		  while ((c = *fromP++))
  		    {
  		      *toP++ = c;
  		      if (c == ':')
***************
*** 794,800 ****
  
  /* Read an optionlist.  */
  
! void
  optlist (str, optionP, default_map)
       char *str;			/* The string to extract options from.  */
       struct ns32k_option *optionP;	/* How to search the string.  */
--- 801,808 ----
  
  /* Read an optionlist.  */
  
! static void optlist PARAMS ((char *, struct ns32k_option *, unsigned long *));
! static void
  optlist (str, optionP, default_map)
       char *str;			/* The string to extract options from.  */
       struct ns32k_option *optionP;	/* How to search the string.  */
***************
*** 837,843 ****
     the instructions lmr, smr, lpr, spr return true if str is found in
     list.  */
  
! int
  list_search (str, optionP, default_map)
       char *str;				/* The string to match.  */
       struct ns32k_option *optionP;	/* List to search.  */
--- 845,852 ----
     the instructions lmr, smr, lpr, spr return true if str is found in
     list.  */
  
! static int list_search PARAMS ((char *, struct ns32k_option *, unsigned long *));
! static int
  list_search (str, optionP, default_map)
       char *str;				/* The string to match.  */
       struct ns32k_option *optionP;	/* List to search.  */
***************
*** 857,863 ****
  	}
      }
  
!   as_warn (_("No such entry in list. (cpu/mmu register)"));
    return 0;
  }
  
--- 866,872 ----
  	}
      }
  
!   as_bad (_("No such entry in list. (cpu/mmu register)"));
    return 0;
  }
  
***************
*** 870,876 ****
  
    tmp_line = input_line_pointer;
    input_line_pointer = ptr;
!   expression (&exprP);
    input_line_pointer = tmp_line;
  }
  
--- 879,885 ----
  
    tmp_line = input_line_pointer;
    input_line_pointer = ptr;
!   expression (resultP);
    input_line_pointer = tmp_line;
  }
  
***************
*** 880,897 ****
     opcode.
     Be carefull not to put to objects in the same iif-slot.  */
  
! void
  encode_operand (argc, argv, operandsP, suffixP, im_size, opcode_bit_ptr)
       int argc;
       char **argv;
       char *operandsP;
       char *suffixP;
!      char im_size;
       char opcode_bit_ptr;
  {
    register int i, j;
    char d;
!   int pcrel, tmp, b, loop, pcrel_adjust;
  
    for (loop = 0; loop < argc; loop++)
      {
--- 889,908 ----
     opcode.
     Be carefull not to put to objects in the same iif-slot.  */
  
! static void encode_operand PARAMS ((int argc, char **argv, char *operandsP, char *, char, char));
! static void
  encode_operand (argc, argv, operandsP, suffixP, im_size, opcode_bit_ptr)
       int argc;
       char **argv;
       char *operandsP;
       char *suffixP;
!      char im_size ATTRIBUTE_UNUSED;
       char opcode_bit_ptr;
  {
    register int i, j;
    char d;
!   int pcrel, b, loop, pcrel_adjust;
!   unsigned long tmp;
  
    for (loop = 0; loop < argc; loop++)
      {
***************
*** 963,969 ****
  
  	case 'b':		/* multiple instruction disp */
  	  freeptr++;		/* OVE:this is an useful hack */
! 	  sprintf (freeptr, "((%s-1)*%d)\000", argv[i], desc->im_size);
  	  argv[i] = freeptr;
  	  pcrel -= 1;		/* make pcrel 0 inspite of what case 'p':
  				   wants */
--- 974,980 ----
  
  	case 'b':		/* multiple instruction disp */
  	  freeptr++;		/* OVE:this is an useful hack */
! 	  sprintf (freeptr, "((%s-1)*%d)", argv[i], desc->im_size);
  	  argv[i] = freeptr;
  	  pcrel -= 1;		/* make pcrel 0 inspite of what case 'p':
  				   wants */
***************
*** 1065,1078 ****
     Return-value = recursive_level.    */
  /* Build iif of one assembly text line.  */
  
! int
  parse (line, recursive_level)
       char *line;
       int recursive_level;
  {
    register char *lineptr, c, suffix_separator;
    register int i;
!   int argc, arg_type;
    char sqr, sep;
    char suffix[MAX_ARGS], *argv[MAX_ARGS];	/* No more than 4 operands.  */
  
--- 1076,1091 ----
     Return-value = recursive_level.    */
  /* Build iif of one assembly text line.  */
  
! static int parse PARAMS ((char *, int));
! static int
  parse (line, recursive_level)
       char *line;
       int recursive_level;
  {
    register char *lineptr, c, suffix_separator;
    register int i;
!   unsigned int argc;
!   int arg_type;
    char sqr, sep;
    char suffix[MAX_ARGS], *argv[MAX_ARGS];	/* No more than 4 operands.  */
  
***************
*** 1257,1263 ****
     objects not part of an instruction, the pointer to the opcode frag
     is always zero.  */
  
! void
  convert_iif ()
  {
    int i;
--- 1270,1277 ----
     objects not part of an instruction, the pointer to the opcode frag
     is always zero.  */
  
! static void convert_iif PARAMS((void));
! static void
  convert_iif ()
  {
    int i;
***************
*** 1270,1277 ****
    int k;
    char type;
    char size = 0;
-   int size_so_far;
  
    memP = frag_more (0);
    inst_opcode = memP;
    inst_offset = (memP - frag_now->fr_literal);
--- 1284,1291 ----
    int k;
    char type;
    char size = 0;
  
+   frag_grow(iif.instr_size);	/* This is important */
    memP = frag_more (0);
    inst_opcode = memP;
    inst_offset = (memP - frag_now->fr_literal);
***************
*** 1279,1285 ****
  
    for (i = 0; i < IIF_ENTRIES; i++)
      {
!       if (type = iif.iifP[i].type)
  	{
  	  /* The object exist, so handle it.  */
  	  switch (size = iif.iifP[i].size)
--- 1293,1299 ----
  
    for (i = 0; i < IIF_ENTRIES; i++)
      {
!       if ((type = iif.iifP[i].type))
  	{
  	  /* The object exist, so handle it.  */
  	  switch (size = iif.iifP[i].size)
***************
*** 1304,1310 ****
  	      switch (type)
  		{
  		case 1:	/* The object is pure binary.  */
! 		  if (j || iif.iifP[i].pcrel)
  		    {
  		      fix_new_ns32k (frag_now,
  				     (long) (memP - frag_now->fr_literal),
--- 1318,1328 ----
  	      switch (type)
  		{
  		case 1:	/* The object is pure binary.  */
! 		  if (j)
! 		    {
! 		      md_number_to_field(memP, exprP.X_add_number, j);
! 		    }
! 		  else if (iif.iifP[i].pcrel)
  		    {
  		      fix_new_ns32k (frag_now,
  				     (long) (memP - frag_now->fr_literal),
***************
*** 1313,1319 ****
  				     iif.iifP[i].object,
  				     iif.iifP[i].pcrel,
  				     iif.iifP[i].im_disp,
! 				     j,
  				     iif.iifP[i].bsr,	/* sequent hack */
  				     inst_frag, inst_offset);
  		    }
--- 1331,1337 ----
  				     iif.iifP[i].object,
  				     iif.iifP[i].pcrel,
  				     iif.iifP[i].im_disp,
! 				     0,
  				     iif.iifP[i].bsr,	/* sequent hack */
  				     inst_frag, inst_offset);
  		    }
***************
*** 1346,1352 ****
  			  /* We have a bignum ie a quad. This can only
                               happens in a long suffixed instruction.  */
  			  if (k * 2 > size)
! 			    as_warn (_("Bignum too big for long"));
  
  			  if (k == 3)
  			    memP += 2;
--- 1364,1370 ----
  			  /* We have a bignum ie a quad. This can only
                               happens in a long suffixed instruction.  */
  			  if (k * 2 > size)
! 			    as_bad (_("Bignum too big for long"));
  
  			  if (k == 3)
  			    memP += 2;
***************
*** 1393,1400 ****
  			}
  		      break;
  		    }
! 		  if (j ||
! 		      exprP.X_add_symbol ||
  		      exprP.X_op_symbol ||
  		      iif.iifP[i].pcrel)
  		    {
--- 1411,1417 ----
  			}
  		      break;
  		    }
! 		  if (exprP.X_add_symbol ||
  		      exprP.X_op_symbol ||
  		      iif.iifP[i].pcrel)
  		    {
***************
*** 1412,1417 ****
--- 1429,1438 ----
  					 iif.iifP[i].bsr,
  					 inst_frag, inst_offset);
  		    }
+ 		  else if (j)
+ 		    {
+ 		      md_number_to_field(memP, exprP.X_add_number, j);
+ 		    }
  		  else
  		    {
  		      /* Good, just put them bytes out.  */
***************
*** 1445,1453 ****
  		if ((exprP.X_add_symbol || exprP.X_op_symbol) &&
  		    !iif.iifP[i].pcrel)
  		  {
! 		    /* Size is unknown until link time so have to
!                        allow 4 bytes.  */
! 		    size = 4;
  		    memP = frag_more (size);
  		    fix_new_ns32k_exp (frag_now,
  				       (long) (memP - frag_now->fr_literal),
--- 1466,1473 ----
  		if ((exprP.X_add_symbol || exprP.X_op_symbol) &&
  		    !iif.iifP[i].pcrel)
  		  {
! 		    /* Size is unknown until link time so have to default */
! 		    size = default_disp_size; /* Normally 4 bytes */
  		    memP = frag_more (size);
  		    fix_new_ns32k_exp (frag_now,
  				       (long) (memP - frag_now->fr_literal),
***************
*** 1515,1521 ****
  			      }
  			    else
  			      {
! 				as_warn (_("Displacement to large for :d"));
  				size = 4;
  			      }
  			  }
--- 1535,1541 ----
  			      }
  			    else
  			      {
! 				as_bad (_("Displacement to large for :d"));
  				size = 4;
  			      }
  			  }
***************
*** 1584,1590 ****
  
    index = length + 3 * pcrel + 6 * type;
  
!   if (index >= 0 && index < sizeof (relocs) / sizeof (relocs[0]))
      return relocs[index];
  
    if (pcrel)
--- 1604,1610 ----
  
    index = length + 3 * pcrel + 6 * type;
  
!   if (index >= 0 && (unsigned int) index < sizeof (relocs) / sizeof (relocs[0]))
      return relocs[index];
  
    if (pcrel)
***************
*** 1711,1717 ****
      {
      case 1:
        if (val < -64 || val > 63)
! 	as_warn (_("Byte displacement out of range.  line number not valid"));
        val &= 0x7f;
  #ifdef SHOW_NUM
        printf ("%x ", val & 0xff);
--- 1731,1737 ----
      {
      case 1:
        if (val < -64 || val > 63)
! 	as_bad (_("value of %ld out of byte displacement range."), val);
        val &= 0x7f;
  #ifdef SHOW_NUM
        printf ("%x ", val & 0xff);
***************
*** 1720,1726 ****
        break;
      case 2:
        if (val < -8192 || val > 8191)
! 	as_warn (_("Word displacement out of range.  line number not valid"));
        val &= 0x3fff;
        val |= 0x8000;
  #ifdef SHOW_NUM
--- 1740,1746 ----
        break;
      case 2:
        if (val < -8192 || val > 8191)
! 	as_bad (_("value of %ld out of word displacement range."), val);
        val &= 0x3fff;
        val |= 0x8000;
  #ifdef SHOW_NUM
***************
*** 1734,1740 ****
        break;
      case 4:
        if (val < -0x20000000 || val >= 0x20000000)
! 	as_warn (_("Double word displacement out of range"));
        val |= 0xc0000000;
  #ifdef SHOW_NUM
        printf ("%x ", val >> 24 & 0xff);
--- 1754,1760 ----
        break;
      case 4:
        if (val < -0x20000000 || val >= 0x20000000)
! 	as_bad (_("value of %ld out of double word displacement range."), val);
        val |= 0xc0000000;
  #ifdef SHOW_NUM
        printf ("%x ", val >> 24 & 0xff);
***************
*** 1754,1760 ****
        *buf++ = val;
        break;
      default:
!       as_fatal (_("Internal logic error.  line %s, file \"%s\""),
  		__LINE__, __FILE__);
      }
  }
--- 1774,1780 ----
        *buf++ = val;
        break;
      default:
!       as_fatal (_("Internal logic error.  line %d, file \"%s\""),
  		__LINE__, __FILE__);
      }
  }
***************
*** 1802,1808 ****
        *buf++ = val;
        break;
      default:
!       as_fatal (_("Internal logic error. line %s, file \"%s\""),
  		__LINE__, __FILE__);
      }
  }
--- 1822,1828 ----
        *buf++ = val;
        break;
      default:
!       as_fatal (_("Internal logic error. line %d, file \"%s\""),
  		__LINE__, __FILE__);
      }
  }
***************
*** 1906,1912 ****
      }
    else
      {
!       as_warn (_("Bit field out of range"));
      }
  }
  
--- 1926,1932 ----
      }
    else
      {
!       as_bad (_("Bit field out of range"));
      }
  }
  
***************
*** 1928,1938 ****
    return fragP->fr_address + fragP->fr_fix - opcode_address;
  }
  
! int
  md_fix_pcrel_adjust (fixP)
       fixS *fixP;
  {
-   fragS *fragP = fixP->fx_frag;
    fragS *opcode_frag;
    addressT opcode_address;
    unsigned int offset;
--- 1948,1958 ----
    return fragP->fr_address + fragP->fr_fix - opcode_address;
  }
  
! static int md_fix_pcrel_adjust PARAMS ((fixS *fixP));
! static int
  md_fix_pcrel_adjust (fixP)
       fixS *fixP;
  {
    fragS *opcode_frag;
    addressT opcode_address;
    unsigned int offset;
***************
*** 1961,1973 ****
       segT seg ATTRIBUTE_UNUSED;
  {
    long val = * (long *) valP;
-   fragS *fragP = fixP->fx_frag;
    char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
  
    if (fix_bit_fixP (fixP))
!     /* Bitfields to fix, sigh.  */
!     md_number_to_field (buf, val, fix_bit_fixP (fixP));
! 
    else switch (fix_im_disp (fixP))
      {
      case 0:
--- 1981,1993 ----
       segT seg ATTRIBUTE_UNUSED;
  {
    long val = * (long *) valP;
    char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;
  
    if (fix_bit_fixP (fixP))
!     {
!       /* Bitfields to fix, sigh.  */
!       md_number_to_field (buf, val, fix_bit_fixP (fixP));
!     }
    else switch (fix_im_disp (fixP))
      {
      case 0:
***************
*** 2004,2011 ****
  #else
  void
  md_convert_frag (abfd, sec, fragP)
!      bfd *abfd;
!      segT sec;
       register fragS *fragP;
  #endif
  {
--- 2024,2031 ----
  #else
  void
  md_convert_frag (abfd, sec, fragP)
!      bfd *abfd ATTRIBUTE_UNUSED;
!      segT sec ATTRIBUTE_UNUSED;
       register fragS *fragP;
  #endif
  {
***************
*** 2017,2024 ****
    /* Address in object code of the displacement.  */
    int object_address;
  
-   fragS *opcode_frag;
- 
    switch (fragP->fr_subtype)
      {
      case IND (BRANCH, BYTE):
--- 2037,2042 ----
***************
*** 2101,2108 ****
  md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol)
       char *ptr;
       addressT from_addr, to_addr;
!      fragS *frag;
!      symbolS *to_symbol;
  {
    valueT offset;
  
--- 2119,2126 ----
  md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol)
       char *ptr;
       addressT from_addr, to_addr;
!      fragS *frag ATTRIBUTE_UNUSED;
!      symbolS *to_symbol ATTRIBUTE_UNUSED;
  {
    valueT offset;
  
***************
*** 2115,2122 ****
  md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol)
       char *ptr;
       addressT from_addr, to_addr;
!      fragS *frag;
!      symbolS *to_symbol;
  {
    valueT offset;
  
--- 2133,2140 ----
  md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol)
       char *ptr;
       addressT from_addr, to_addr;
!      fragS *frag ATTRIBUTE_UNUSED;
!      symbolS *to_symbol ATTRIBUTE_UNUSED;
  {
    valueT offset;
  
***************
*** 2129,2134 ****
--- 2147,2154 ----
  
  struct option md_longopts[] =
  {
+ #define OPTION_DISP_SIZE (OPTION_MD_BASE)
+   {"disp-size-default", required_argument , NULL, OPTION_DISP_SIZE},
    {NULL, no_argument, NULL, 0}
  };
  
***************
*** 2154,2163 ****
  	}
        else
  	{
! 	  as_bad (_("invalid architecture option -m%s"), arg);
  	  return 0;
  	}
        break;
  
      default:
        return 0;
--- 2174,2197 ----
  	}
        else
  	{
! 	  as_warn (_("invalid architecture option -m%s, ignored"), arg);
  	  return 0;
  	}
        break;
+     case OPTION_DISP_SIZE:
+       {
+ 	int size = atoi(arg);
+ 	switch (size)
+ 	  {
+ 	  case 1: case 2: case 4:
+ 	    default_disp_size = size;
+ 	    break;
+ 	  default:
+ 	    as_warn (_("invalid default displacement size \"%s\". Defaulting to %d."),
+ 		     arg, default_disp_size);
+ 	  }
+ 	break;
+       }
  
      default:
        return 0;
***************
*** 2172,2178 ****
  {
    fprintf (stream, _("\
  NS32K options:\n\
! -m32032 | -m32532	select variant of NS32K architecture\n"));
  }
  
  /* Create a bit_fixS in obstack 'notes'.
--- 2206,2213 ----
  {
    fprintf (stream, _("\
  NS32K options:\n\
! -m32032 | -m32532	select variant of NS32K architecture\n\
! --disp-size-default=<1|2|4>\n"));
  }
  
  /* Create a bit_fixS in obstack 'notes'.
***************
*** 2237,2242 ****
--- 2272,2279 ----
    fix_im_disp (fixP) = im_disp;
    fix_bsr (fixP) = bsr;
    fix_bit_fixP (fixP) = bit_fixP;
+   /* We have a MD overflow check for displacements */
+   fixP->fx_no_overflow = (im_disp != 0);
  }
  
  void
***************
*** 2269,2274 ****
--- 2306,2313 ----
    fix_im_disp (fixP) = im_disp;
    fix_bsr (fixP) = bsr;
    fix_bit_fixP (fixP) = bit_fixP;
+   /* We have a MD overflow check for displacements */
+   fixP->fx_no_overflow = (im_disp != 0);
  }
  
  /* This is TC_CONS_FIX_NEW, called by emit_expr in read.c.  */
***************
*** 2288,2294 ****
  
  symbolS *
  md_undefined_symbol (name)
!      char *name;
  {
    return 0;
  }
--- 2327,2333 ----
  
  symbolS *
  md_undefined_symbol (name)
!      char *name ATTRIBUTE_UNUSED;
  {
    return 0;
  }
***************
*** 2297,2303 ****
  
  valueT
  md_section_align (segment, size)
!      segT segment;
       valueT size;
  {
    return size;			/* Byte alignment is fine.  */
--- 2336,2342 ----
  
  valueT
  md_section_align (segment, size)
!      segT segment ATTRIBUTE_UNUSED;
       valueT size;
  {
    return size;			/* Byte alignment is fine.  */
***************
*** 2323,2329 ****
  
  arelent *
  tc_gen_reloc (section, fixp)
!      asection *section;
       fixS *fixp;
  {
    arelent *rel;
--- 2362,2368 ----
  
  arelent *
  tc_gen_reloc (section, fixp)
!      asection *section ATTRIBUTE_UNUSED;
       fixS *fixp;
  {
    arelent *rel;
Index: gas/config/tc-ns32k.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ns32k.h,v
retrieving revision 1.5
diff -c -r1.5 tc-ns32k.h
*** gas/config/tc-ns32k.h	8 Mar 2001 23:24:24 -0000	1.5
--- gas/config/tc-ns32k.h	29 Jul 2002 12:53:52 -0000
***************
*** 1,5 ****
  /* tc-ns32k.h -- Opcode table for National Semi 32k processor
!    Copyright 1987, 1992, 1993, 1994, 1995, 1997, 2000
     Free Software Foundation, Inc.
  
     This file is part of GAS, the GNU Assembler.
--- 1,5 ----
  /* tc-ns32k.h -- Opcode table for National Semi 32k processor
!    Copyright 1987, 1992, 1993, 1994, 1995, 1997, 2000, 2002
     Free Software Foundation, Inc.
  
     This file is part of GAS, the GNU Assembler.
***************
*** 24,29 ****
--- 24,30 ----
  #define TARGET_BYTES_BIG_ENDIAN	0
  
  #define TC_PCREL_ADJUST(F) md_pcrel_adjust(F)
+ extern int md_pcrel_adjust PARAMS((fragS *fragP));
  
  #ifdef BFD_ASSEMBLER
  #define NO_RELOC BFD_RELOC_NONE


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