This is the mail archive of the binutils@sourceware.org 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: Patch to remove the use of the c++ keyword class in binutil sources.


Found a small issue with new.patch. Updated the patch again.

I also included a patch that renames all uses of the word template to
avoid clashes with the C++ keyword.

Thanks,
Martin

On Thu, Aug 27, 2009 at 5:00 PM, Martin Thuresson<martin@mtme.org> wrote:
> I have updated this patch, and also written one for the keyword new.
>
> Build and ran "make check" without any new errors for the following targets:
>
> alpha-freebsd
> alpha-linux
> arc-elf
> arm-aout
> arm-eabi
> cr16-linux
> cris-linux
> crx-linux
> d30v-linux
> dlx-elf
> hppa-linux
> i370-linux
> i686-linux
> i960-elf
> ia64-linux
> iq2000-elf
> m32c-elf
> m32r-linux
> m68hc11-linux
> m68k-linux
> mcore-elf
> mep-elf
> microblaze-elf
> microblaze-elf
> mips-linux
> mmix-linux
> mn10300-linux
> moxie-elf
> ns32k-netbsd
> pdp11-aout
> pj-linux
> ppc-linux
> rs6000-aix4
> s390-linux
> score-elf
> sh-elf
> sh-linux
> sh64-linux
> sparc-linux
> spu-elf
> tic4x-coff
> vax-linux
> x86_64-linux
> x86_64-linux
> xtensa-linux
> z8k-coff
>
> Thanks,
> Martin
>
diff -prc src.head/bfd/aoutx.h src.new/bfd/aoutx.h
*** src.head/bfd/aoutx.h	Fri Aug 14 10:58:53 2009
--- src.new/bfd/aoutx.h	Tue Aug 18 11:53:38 2009
*************** NAME (aout, make_empty_symbol) (bfd *abf
*** 1668,1679 ****
  {
    bfd_size_type amt = sizeof (aout_symbol_type);
  
!   aout_symbol_type *new = bfd_zalloc (abfd, amt);
!   if (!new)
      return NULL;
!   new->symbol.the_bfd = abfd;
  
!   return &new->symbol;
  }
  
  /* Translate a set of internal symbols into external symbols.  */
--- 1668,1679 ----
  {
    bfd_size_type amt = sizeof (aout_symbol_type);
  
!   aout_symbol_type *new_symbol = (aout_symbol_type *) bfd_zalloc (abfd, amt);
!   if (!new_symbol)
      return NULL;
!   new_symbol->symbol.the_bfd = abfd;
  
!   return &new_symbol->symbol;
  }
  
  /* Translate a set of internal symbols into external symbols.  */
diff -prc src.head/bfd/coffgen.c src.new/bfd/coffgen.c
*** src.head/bfd/coffgen.c	Tue Jun 16 09:07:18 2009
--- src.new/bfd/coffgen.c	Tue Aug 18 11:53:38 2009
*************** asymbol *
*** 1794,1810 ****
  coff_make_empty_symbol (bfd *abfd)
  {
    bfd_size_type amt = sizeof (coff_symbol_type);
!   coff_symbol_type *new = bfd_zalloc (abfd, amt);
  
!   if (new == NULL)
      return NULL;
!   new->symbol.section = 0;
!   new->native = 0;
!   new->lineno = NULL;
!   new->done_lineno = FALSE;
!   new->symbol.the_bfd = abfd;
  
!   return & new->symbol;
  }
  
  /* Make a debugging symbol.  */
--- 1794,1810 ----
  coff_make_empty_symbol (bfd *abfd)
  {
    bfd_size_type amt = sizeof (coff_symbol_type);
!   coff_symbol_type *new_symbol = (coff_symbol_type *) bfd_zalloc (abfd, amt);
  
!   if (new_symbol == NULL)
      return NULL;
!   new_symbol->symbol.section = 0;
!   new_symbol->native = 0;
!   new_symbol->lineno = NULL;
!   new_symbol->done_lineno = FALSE;
!   new_symbol->symbol.the_bfd = abfd;
  
!   return & new_symbol->symbol;
  }
  
  /* Make a debugging symbol.  */
*************** coff_bfd_make_debug_symbol (bfd *abfd,
*** 1815,1837 ****
  			    unsigned long sz ATTRIBUTE_UNUSED)
  {
    bfd_size_type amt = sizeof (coff_symbol_type);
!   coff_symbol_type *new = bfd_alloc (abfd, amt);
  
!   if (new == NULL)
      return NULL;
    /* @@ The 10 is a guess at a plausible maximum number of aux entries
       (but shouldn't be a constant).  */
    amt = sizeof (combined_entry_type) * 10;
!   new->native = bfd_zalloc (abfd, amt);
!   if (!new->native)
      return NULL;
!   new->symbol.section = bfd_abs_section_ptr;
!   new->symbol.flags = BSF_DEBUGGING;
!   new->lineno = NULL;
!   new->done_lineno = FALSE;
!   new->symbol.the_bfd = abfd;
    
!   return & new->symbol;
  }
  
  void
--- 1815,1837 ----
  			    unsigned long sz ATTRIBUTE_UNUSED)
  {
    bfd_size_type amt = sizeof (coff_symbol_type);
!   coff_symbol_type *new_symbol = (coff_symbol_type *) bfd_alloc (abfd, amt);
  
!   if (new_symbol == NULL)
      return NULL;
    /* @@ The 10 is a guess at a plausible maximum number of aux entries
       (but shouldn't be a constant).  */
    amt = sizeof (combined_entry_type) * 10;
!   new_symbol->native = (combined_entry_type *) bfd_zalloc (abfd, amt);
!   if (!new_symbol->native)
      return NULL;
!   new_symbol->symbol.section = bfd_abs_section_ptr;
!   new_symbol->symbol.flags = BSF_DEBUGGING;
!   new_symbol->lineno = NULL;
!   new_symbol->done_lineno = FALSE;
!   new_symbol->symbol.the_bfd = abfd;
    
!   return & new_symbol->symbol;
  }
  
  void
diff -prc src.head/bfd/cpu-ia64-opc.c src.new/bfd/cpu-ia64-opc.c
*** src.head/bfd/cpu-ia64-opc.c	Tue Jun 16 09:07:19 2009
--- src.new/bfd/cpu-ia64-opc.c	Tue Aug 18 11:53:38 2009
*************** ext_reg (const struct ia64_operand *self
*** 81,99 ****
  static const char*
  ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
  {
!   ia64_insn new = 0;
    int i;
  
    for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
      {
!       new |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1))
! 	      << self->field[i].shift);
        value >>= self->field[i].bits;
      }
    if (value)
      return "integer operand out of range";
  
!   *code |= new;
    return 0;
  }
  
--- 81,99 ----
  static const char*
  ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
  {
!   ia64_insn new_insn = 0;
    int i;
  
    for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
      {
!       new_insn |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1))
!                  << self->field[i].shift);
        value >>= self->field[i].bits;
      }
    if (value)
      return "integer operand out of range";
  
!   *code |= new_insn;
    return 0;
  }
  
*************** ins_imms_scaled (const struct ia64_opera
*** 163,184 ****
  		 ia64_insn *code, int scale)
  {
    BFD_HOST_64_BIT svalue = value, sign_bit = 0;
!   ia64_insn new = 0;
    int i;
  
    svalue >>= scale;
  
    for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
      {
!       new |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1))
! 	      << self->field[i].shift);
        sign_bit = (svalue >> (self->field[i].bits - 1)) & 1;
        svalue >>= self->field[i].bits;
      }
    if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1))
      return "integer operand out of range";
  
!   *code |= new;
    return 0;
  }
  
--- 163,184 ----
  		 ia64_insn *code, int scale)
  {
    BFD_HOST_64_BIT svalue = value, sign_bit = 0;
!   ia64_insn new_insn = 0;
    int i;
  
    svalue >>= scale;
  
    for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
      {
!       new_insn |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1))
!                  << self->field[i].shift);
        sign_bit = (svalue >> (self->field[i].bits - 1)) & 1;
        svalue >>= self->field[i].bits;
      }
    if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1))
      return "integer operand out of range";
  
!   *code |= new_insn;
    return 0;
  }
  
diff -prc src.head/bfd/doc/chew.c src.new/bfd/doc/chew.c
*** src.head/bfd/doc/chew.c	Tue Jun 16 09:07:18 2009
--- src.new/bfd/doc/chew.c	Tue Aug 18 11:53:38 2009
*************** dict_type *
*** 1267,1280 ****
  newentry (word)
       char *word;
  {
!   dict_type *new = (dict_type *) malloc (sizeof (dict_type));
!   new->word = word;
!   new->next = root;
!   root = new;
!   new->code = (stinst_type *) malloc (sizeof (stinst_type));
!   new->code_length = 1;
!   new->code_end = 0;
!   return new;
  }
  
  unsigned int
--- 1267,1280 ----
  newentry (word)
       char *word;
  {
!   dict_type *new_d = (dict_type *) malloc (sizeof (dict_type));
!   new_d->word = word;
!   new_d->next = root;
!   root = new_d;
!   new_d->code = (stinst_type *) malloc (sizeof (stinst_type));
!   new_d->code_length = 1;
!   new_d->code_end = 0;
!   return new_d;
  }
  
  unsigned int
*************** add_intrinsic (name, func)
*** 1299,1317 ****
       char *name;
       void (*func) ();
  {
!   dict_type *new = newentry (name);
!   add_to_definition (new, func);
!   add_to_definition (new, 0);
  }
  
  void
  add_var (name)
       char *name;
  {
!   dict_type *new = newentry (name);
!   add_to_definition (new, push_number);
!   add_to_definition (new, (stinst_type) (&(new->var)));
!   add_to_definition (new, 0);
  }
  
  void
--- 1299,1317 ----
       char *name;
       void (*func) ();
  {
!   dict_type *new_d = newentry (name);
!   add_to_definition (new_d, func);
!   add_to_definition (new_d, 0);
  }
  
  void
  add_var (name)
       char *name;
  {
!   dict_type *new_d = newentry (name);
!   add_to_definition (new_d, push_number);
!   add_to_definition (new_d, (stinst_type) (&(new_d->var)));
!   add_to_definition (new_d, 0);
  }
  
  void
diff -prc src.head/bfd/ecoff.c src.new/bfd/ecoff.c
*** src.head/bfd/ecoff.c	Fri Aug 14 10:59:00 2009
--- src.new/bfd/ecoff.c	Tue Aug 18 11:53:38 2009
*************** static asymbol *ecoff_scom_symbol_ptr;
*** 644,661 ****
  asymbol *
  _bfd_ecoff_make_empty_symbol (bfd *abfd)
  {
!   ecoff_symbol_type *new;
    bfd_size_type amt = sizeof (ecoff_symbol_type);
  
!   new = bfd_zalloc (abfd, amt);
!   if (new == NULL)
      return NULL;
!   new->symbol.section = NULL;
!   new->fdr = NULL;
!   new->local = FALSE;
!   new->native = NULL;
!   new->symbol.the_bfd = abfd;
!   return &new->symbol;
  }
  
  /* Set the BFD flags and section for an ECOFF symbol.  */
--- 644,661 ----
  asymbol *
  _bfd_ecoff_make_empty_symbol (bfd *abfd)
  {
!   ecoff_symbol_type *new_symbol;
    bfd_size_type amt = sizeof (ecoff_symbol_type);
  
!   new_symbol = (ecoff_symbol_type *) bfd_zalloc (abfd, amt);
!   if (new_symbol == NULL)
      return NULL;
!   new_symbol->symbol.section = NULL;
!   new_symbol->fdr = NULL;
!   new_symbol->local = FALSE;
!   new_symbol->native = NULL;
!   new_symbol->symbol.the_bfd = abfd;
!   return &new_symbol->symbol;
  }
  
  /* Set the BFD flags and section for an ECOFF symbol.  */
diff -prc src.head/bfd/elf32-m68k.c src.new/bfd/elf32-m68k.c
*** src.head/bfd/elf32-m68k.c	Fri Aug 14 10:59:03 2009
--- src.new/bfd/elf32-m68k.c	Tue Aug 18 11:53:38 2009
*************** elf_m68k_get_got_entry (struct elf_m68k_
*** 1531,1537 ****
  static enum elf_m68k_reloc_type
  elf_m68k_update_got_entry_type (struct elf_m68k_got *got,
  				enum elf_m68k_reloc_type was,
! 				enum elf_m68k_reloc_type new)
  {
    enum elf_m68k_got_offset_size was_size;
    enum elf_m68k_got_offset_size new_size;
--- 1531,1537 ----
  static enum elf_m68k_reloc_type
  elf_m68k_update_got_entry_type (struct elf_m68k_got *got,
  				enum elf_m68k_reloc_type was,
! 				enum elf_m68k_reloc_type new_reloc)
  {
    enum elf_m68k_got_offset_size was_size;
    enum elf_m68k_got_offset_size new_size;
*************** elf_m68k_update_got_entry_type (struct e
*** 1543,1562 ****
        /* Update all got->n_slots counters, including n_slots[R_32].  */
        was_size = R_LAST;
  
!       was = new;
      }
    else
      {
        /* !!! We, probably, should emit an error rather then fail on assert
  	 in such a case.  */
        BFD_ASSERT (elf_m68k_reloc_got_type (was)
! 		  == elf_m68k_reloc_got_type (new));
  
        was_size = elf_m68k_reloc_got_offset_size (was);
      }
  
!   new_size = elf_m68k_reloc_got_offset_size (new);
!   n_slots = elf_m68k_reloc_got_n_slots (new);
  
    while (was_size > new_size)
      {
--- 1543,1562 ----
        /* Update all got->n_slots counters, including n_slots[R_32].  */
        was_size = R_LAST;
  
!       was = new_reloc;
      }
    else
      {
        /* !!! We, probably, should emit an error rather then fail on assert
  	 in such a case.  */
        BFD_ASSERT (elf_m68k_reloc_got_type (was)
! 		  == elf_m68k_reloc_got_type (new_reloc));
  
        was_size = elf_m68k_reloc_got_offset_size (was);
      }
  
!   new_size = elf_m68k_reloc_got_offset_size (new_reloc);
!   n_slots = elf_m68k_reloc_got_n_slots (new_reloc);
  
    while (was_size > new_size)
      {
*************** elf_m68k_update_got_entry_type (struct e
*** 1564,1573 ****
        got->n_slots[was_size] += n_slots;
      }
  
!   if (new > was)
      /* Relocations are ordered from bigger got offset size to lesser,
         so choose the relocation type with lesser offset size.  */
!     was = new;
  
    return was;
  }
--- 1564,1573 ----
        got->n_slots[was_size] += n_slots;
      }
  
!   if (new_reloc > was)
      /* Relocations are ordered from bigger got offset size to lesser,
         so choose the relocation type with lesser offset size.  */
!     was = new_reloc;
  
    return was;
  }
diff -prc src.head/bfd/hash.c src.new/bfd/hash.c
*** src.head/bfd/hash.c	Tue Jun 16 09:07:20 2009
--- src.new/bfd/hash.c	Tue Aug 18 11:53:38 2009
*************** bfd_hash_lookup (struct bfd_hash_table *
*** 453,468 ****
  
    if (copy)
      {
!       char *new;
  
!       new = objalloc_alloc ((struct objalloc *) table->memory, len + 1);
!       if (!new)
  	{
  	  bfd_set_error (bfd_error_no_memory);
  	  return NULL;
  	}
!       memcpy (new, string, len + 1);
!       string = new;
      }
  
    return bfd_hash_insert (table, string, hash);
--- 453,469 ----
  
    if (copy)
      {
!       char *new_string;
  
!       new_string = (char *) objalloc_alloc ((struct objalloc *) table->memory,
!                                             len + 1);
!       if (!new_string)
  	{
  	  bfd_set_error (bfd_error_no_memory);
  	  return NULL;
  	}
!       memcpy (new_string, string, len + 1);
!       string = new_string;
      }
  
    return bfd_hash_insert (table, string, hash);
diff -prc src.head/bfd/ieee.c src.new/bfd/ieee.c
*** src.head/bfd/ieee.c	Tue Jun 16 09:07:20 2009
--- src.new/bfd/ieee.c	Tue Aug 18 11:53:38 2009
*************** static asymbol *
*** 3627,3638 ****
  ieee_make_empty_symbol (bfd *abfd)
  {
    bfd_size_type amt = sizeof (ieee_symbol_type);
!   ieee_symbol_type *new = bfd_zalloc (abfd, amt);
  
!   if (!new)
      return NULL;
!   new->symbol.the_bfd = abfd;
!   return &new->symbol;
  }
  
  static bfd *
--- 3627,3638 ----
  ieee_make_empty_symbol (bfd *abfd)
  {
    bfd_size_type amt = sizeof (ieee_symbol_type);
!   ieee_symbol_type *new_symbol = (ieee_symbol_type *) bfd_zalloc (abfd, amt);
  
!   if (!new_symbol)
      return NULL;
!   new_symbol->symbol.the_bfd = abfd;
!   return &new_symbol->symbol;
  }
  
  static bfd *
diff -prc src.head/bfd/linker.c src.new/bfd/linker.c
*** src.head/bfd/linker.c	Fri Aug 14 10:59:09 2009
--- src.new/bfd/linker.c	Tue Aug 18 11:53:38 2009
*************** struct bfd_link_order *
*** 2604,2624 ****
  bfd_new_link_order (bfd *abfd, asection *section)
  {
    bfd_size_type amt = sizeof (struct bfd_link_order);
!   struct bfd_link_order *new;
  
!   new = bfd_zalloc (abfd, amt);
!   if (!new)
      return NULL;
  
!   new->type = bfd_undefined_link_order;
  
    if (section->map_tail.link_order != NULL)
!     section->map_tail.link_order->next = new;
    else
!     section->map_head.link_order = new;
!   section->map_tail.link_order = new;
  
!   return new;
  }
  
  /* Default link order processing routine.  Note that we can not handle
--- 2604,2624 ----
  bfd_new_link_order (bfd *abfd, asection *section)
  {
    bfd_size_type amt = sizeof (struct bfd_link_order);
!   struct bfd_link_order *new_lo;
  
!   new_lo = (struct bfd_link_order *) bfd_zalloc (abfd, amt);
!   if (!new_lo)
      return NULL;
  
!   new_lo->type = bfd_undefined_link_order;
  
    if (section->map_tail.link_order != NULL)
!     section->map_tail.link_order->next = new_lo;
    else
!     section->map_head.link_order = new_lo;
!   section->map_tail.link_order = new_lo;
  
!   return new_lo;
  }
  
  /* Default link order processing routine.  Note that we can not handle
diff -prc src.head/bfd/mach-o.c src.new/bfd/mach-o.c
*** src.head/bfd/mach-o.c	Fri Aug 14 10:59:09 2009
--- src.new/bfd/mach-o.c	Wed Aug 19 18:30:03 2009
*************** bfd_mach_o_sizeof_headers (bfd *a ATTRIB
*** 1255,1268 ****
  asymbol *
  bfd_mach_o_make_empty_symbol (bfd *abfd)
  {
!   asymbol *new;
  
!   new = bfd_zalloc (abfd, sizeof (bfd_mach_o_asymbol));
!   if (new == NULL)
!     return new;
!   new->the_bfd = abfd;
!   new->udata.i = 0;
!   return new;
  }
  
  static bfd_boolean
--- 1255,1268 ----
  asymbol *
  bfd_mach_o_make_empty_symbol (bfd *abfd)
  {
!   asymbol *new_symbol;
  
!   new_symbol = bfd_zalloc (abfd, sizeof (bfd_mach_o_asymbol));
!   if (new_symbol == NULL)
!     return new_symbol;
!   new_symbol->the_bfd = abfd;
!   new_symbol->udata.i = 0;
!   return new_symbol;
  }
  
  static bfd_boolean
diff -prc src.head/bfd/oasys.c src.new/bfd/oasys.c
*** src.head/bfd/oasys.c	Tue Jun 16 09:07:20 2009
--- src.new/bfd/oasys.c	Wed Aug 19 18:30:42 2009
*************** static asymbol *
*** 1084,1095 ****
  oasys_make_empty_symbol (bfd *abfd)
  {
    bfd_size_type amt = sizeof (oasys_symbol_type);
!   oasys_symbol_type *new = bfd_zalloc (abfd, amt);
  
!   if (!new)
      return NULL;
!   new->symbol.the_bfd = abfd;
!   return &new->symbol;
  }
  
  /* User should have checked the file flags; perhaps we should return
--- 1084,1095 ----
  oasys_make_empty_symbol (bfd *abfd)
  {
    bfd_size_type amt = sizeof (oasys_symbol_type);
!   oasys_symbol_type *new_symbol_type = bfd_zalloc (abfd, amt);
  
!   if (!new_symbol_type)
      return NULL;
!   new_symbol_type->symbol.the_bfd = abfd;
!   return &new_symbol_type->symbol;
  }
  
  /* User should have checked the file flags; perhaps we should return
diff -prc src.head/bfd/pdp11.c src.new/bfd/pdp11.c
*** src.head/bfd/pdp11.c	Tue Jun 16 09:07:20 2009
--- src.new/bfd/pdp11.c	Wed Aug 19 18:31:26 2009
*************** asymbol *
*** 1433,1445 ****
  NAME (aout, make_empty_symbol) (bfd *abfd)
  {
    bfd_size_type amt = sizeof (aout_symbol_type);
!   aout_symbol_type *new = bfd_zalloc (abfd, amt);
  
!   if (!new)
      return NULL;
!   new->symbol.the_bfd = abfd;
  
!   return &new->symbol;
  }
  
  /* Translate a set of internal symbols into external symbols.  */
--- 1433,1445 ----
  NAME (aout, make_empty_symbol) (bfd *abfd)
  {
    bfd_size_type amt = sizeof (aout_symbol_type);
!   aout_symbol_type *new_symbol_type = bfd_zalloc (abfd, amt);
  
!   if (!new_symbol_type)
      return NULL;
!   new_symbol_type->symbol.the_bfd = abfd;
  
!   return &new_symbol_type->symbol;
  }
  
  /* Translate a set of internal symbols into external symbols.  */
diff -prc src.head/bfd/plugin.c src.new/bfd/plugin.c
*** src.head/bfd/plugin.c	Fri Aug 14 10:59:12 2009
--- src.new/bfd/plugin.c	Wed Aug 19 18:31:53 2009
*************** bfd_plugin_get_symbol_info (bfd *abfd AT
*** 415,425 ****
  static asymbol *
  bfd_plugin_make_empty_symbol (bfd *abfd)
  {
!   asymbol *new = bfd_zalloc (abfd, sizeof (asymbol));
!   if (new == NULL)
!     return new;
!   new->the_bfd = abfd;
!   return new;
  }
  
  static int
--- 415,425 ----
  static asymbol *
  bfd_plugin_make_empty_symbol (bfd *abfd)
  {
!   asymbol *new_symbol = bfd_zalloc (abfd, sizeof (asymbol));
!   if (new_symbol == NULL)
!     return new_symbol;
!   new_symbol->the_bfd = abfd;
!   return new_symbol;
  }
  
  static int
diff -prc src.head/bfd/rs6000-core.c src.new/bfd/rs6000-core.c
*** src.head/bfd/rs6000-core.c	Tue Jun 16 09:07:21 2009
--- src.new/bfd/rs6000-core.c	Wed Aug 19 18:34:41 2009
*************** typedef union {
*** 107,115 ****
  
  typedef union {
  #ifdef AIX_CORE_DUMPX_CORE
!   struct core_dumpx new;	/* new AIX 4.3+ core dump */
  #else
!   struct core_dump new;		/* for simpler coding */
  #endif
    struct core_dump old;		/* old AIX 4.2- core dump, still used on
  				   4.3+ with appropriate SMIT config */
--- 107,115 ----
  
  typedef union {
  #ifdef AIX_CORE_DUMPX_CORE
!   struct core_dumpx new_dump;	/* new AIX 4.3+ core dump */
  #else
!   struct core_dump new_dump;		/* for simpler coding */
  #endif
    struct core_dump old;		/* old AIX 4.2- core dump, still used on
  				   4.3+ with appropriate SMIT config */
*************** typedef union {
*** 120,128 ****
  #ifdef CORE_VERSION_1
  typedef union {
  #ifdef AIX_CORE_DUMPX_CORE
!   struct vm_infox new;
  #else
!   struct vm_info new;
  #endif
    struct vm_info old;
  } VmInfo;
--- 120,128 ----
  #ifdef CORE_VERSION_1
  typedef union {
  #ifdef AIX_CORE_DUMPX_CORE
!   struct vm_infox new_dump;
  #else
!   struct vm_info new_dump;
  #endif
    struct vm_info old;
  } VmInfo;
*************** typedef union {
*** 144,150 ****
  
  #ifdef AIX_5_CORE
  # define CORE_DUMPXX_VERSION  	267312562
! # define CNEW_IS_CORE_DUMPXX(c) ((c).new.c_version == CORE_DUMPXX_VERSION)
  #else
  # define CNEW_IS_CORE_DUMPXX(c) 0
  #endif
--- 144,150 ----
  
  #ifdef AIX_5_CORE
  # define CORE_DUMPXX_VERSION  	267312562
! # define CNEW_IS_CORE_DUMPXX(c) ((c).new_dump.c_version == CORE_DUMPXX_VERSION)
  #else
  # define CNEW_IS_CORE_DUMPXX(c) 0
  #endif
*************** read_hdr (bfd *abfd, CoreHdr *core)
*** 291,297 ****
  
    /* Read the trailing portion of the structure.  */
    if (CORE_NEW (*core))
!     size = sizeof (core->new);
    else
      size = sizeof (core->old);
    size -= CORE_COMMONSZ;
--- 291,297 ----
  
    /* Read the trailing portion of the structure.  */
    if (CORE_NEW (*core))
!     size = sizeof (core->new_core);
    else
      size = sizeof (core->old);
    size -= CORE_COMMONSZ;
*************** rs6000coff_core_p (bfd *abfd)
*** 352,364 ****
    /* Copy fields from new or old core structure.  */
    if (CORE_NEW (core))
      {
!       c_flag = core.new.c_flag;
!       c_stack = (file_ptr) core.new.c_stack;
!       c_size = core.new.c_size;
!       c_stackend = CNEW_STACKORG (core.new) + c_size;
!       c_lsize = CNEW_LSIZE (core.new);
!       c_loader = CNEW_LOADER (core.new);
!       proc64 = CNEW_PROC64 (core.new);
      }
    else
      {
--- 352,364 ----
    /* Copy fields from new or old core structure.  */
    if (CORE_NEW (core))
      {
!       c_flag = core.new_dump.c_flag;
!       c_stack = (file_ptr) core.new_dump.c_stack;
!       c_size = core.new_dump.c_size;
!       c_stackend = CNEW_STACKORG (core.new_dump) + c_size;
!       c_lsize = CNEW_LSIZE (core.new_dump);
!       c_loader = CNEW_LOADER (core.new_dump);
!       proc64 = CNEW_PROC64 (core.new_dump);
      }
    else
      {
*************** rs6000coff_core_p (bfd *abfd)
*** 373,385 ****
  
    if (proc64)
      {
!       c_regsize = sizeof (CNEW_CONTEXT64 (core.new));
!       c_regptr = &CNEW_CONTEXT64 (core.new);
      }
    else if (CORE_NEW (core))
      {
!       c_regsize = sizeof (CNEW_MSTSAVE (core.new));
!       c_regptr = &CNEW_MSTSAVE (core.new);
      }
    else
      {
--- 373,385 ----
  
    if (proc64)
      {
!       c_regsize = sizeof (CNEW_CONTEXT64 (core.new_dump));
!       c_regptr = &CNEW_CONTEXT64 (core.new_dump);
      }
    else if (CORE_NEW (core))
      {
!       c_regsize = sizeof (CNEW_MSTSAVE (core.new_dump));
!       c_regptr = &CNEW_MSTSAVE (core.new_dump);
      }
    else
      {
*************** rs6000coff_core_p (bfd *abfd)
*** 449,455 ****
  			   bfd_get_filename (abfd));
  
    /* Allocate core file header.  */
!   size = CORE_NEW (core) ? sizeof (core.new) : sizeof (core.old);
    tmpptr = (char *) bfd_zalloc (abfd, (bfd_size_type) size);
    if (!tmpptr)
      return NULL;
--- 449,455 ----
  			   bfd_get_filename (abfd));
  
    /* Allocate core file header.  */
!   size = CORE_NEW (core) ? sizeof (core.new_dump) : sizeof (core.old);
    tmpptr = (char *) bfd_zalloc (abfd, (bfd_size_type) size);
    if (!tmpptr)
      return NULL;
*************** rs6000coff_core_p (bfd *abfd)
*** 464,470 ****
        enum bfd_architecture arch;
        unsigned long mach;
  
!       switch (CNEW_IMPL (core.new))
  	{
  	case POWER_RS1:
  	case POWER_RSC:
--- 464,470 ----
        enum bfd_architecture arch;
        unsigned long mach;
  
!       switch (CNEW_IMPL (core.new_dump))
  	{
  	case POWER_RS1:
  	case POWER_RSC:
*************** rs6000coff_core_p (bfd *abfd)
*** 537,546 ****
  
      if (CORE_NEW (core))
        {
! 	c_datasize = CNEW_DATASIZE (core.new);
! 	c_data = (file_ptr) core.new.c_data;
! 	c_vmregions = core.new.c_vmregions;
! 	c_vmm = (file_ptr) core.new.c_vmm;
        }
      else
        {
--- 537,546 ----
  
      if (CORE_NEW (core))
        {
! 	c_datasize = CNEW_DATASIZE (core.new_dump);
! 	c_data = (file_ptr) core.new_dump.c_data;
! 	c_vmregions = core.new_dump.c_vmregions;
! 	c_vmm = (file_ptr) core.new_dump.c_vmm;
        }
      else
        {
*************** rs6000coff_core_p (bfd *abfd)
*** 615,629 ****
  	    file_ptr vminfo_offset;
  	    bfd_vma vminfo_addr;
  
! 	    size = CORE_NEW (core) ? sizeof (vminfo.new) : sizeof (vminfo.old);
  	    if (bfd_bread (&vminfo, size, abfd) != size)
  	      goto fail;
  
  	    if (CORE_NEW (core))
  	      {
! 		vminfo_addr = (bfd_vma) vminfo.new.vminfo_addr;
! 		vminfo_size = vminfo.new.vminfo_size;
! 		vminfo_offset = vminfo.new.vminfo_offset;
  	      }
  	    else
  	      {
--- 615,629 ----
  	    file_ptr vminfo_offset;
  	    bfd_vma vminfo_addr;
  
! 	    size = CORE_NEW (core) ? sizeof (vminfo.new_dump) : sizeof (vminfo.old);
  	    if (bfd_bread (&vminfo, size, abfd) != size)
  	      goto fail;
  
  	    if (CORE_NEW (core))
  	      {
! 		vminfo_addr = (bfd_vma) vminfo.new_dump.vminfo_addr;
! 		vminfo_size = vminfo.new_dump.vminfo_size;
! 		vminfo_offset = vminfo.new_dump.vminfo_offset;
  	      }
  	    else
  	      {
*************** rs6000coff_core_file_matches_executable_
*** 669,679 ****
      return FALSE;
  
    if (CORE_NEW (core))
!     c_loader = CNEW_LOADER (core.new);
    else
      c_loader = (file_ptr) (ptr_to_uint) COLD_LOADER (core.old);
  
!   if (CORE_NEW (core) && CNEW_PROC64 (core.new))
      size = (int) ((LdInfo *) 0)->l64.ldinfo_filename;
    else
      size = (int) ((LdInfo *) 0)->l32.ldinfo_filename;
--- 669,679 ----
      return FALSE;
  
    if (CORE_NEW (core))
!     c_loader = CNEW_LOADER (core.new_dump);
    else
      c_loader = (file_ptr) (ptr_to_uint) COLD_LOADER (core.old);
  
!   if (CORE_NEW (core) && CNEW_PROC64 (core.new_dump))
      size = (int) ((LdInfo *) 0)->l64.ldinfo_filename;
    else
      size = (int) ((LdInfo *) 0)->l32.ldinfo_filename;
*************** rs6000coff_core_file_failing_command (bf
*** 735,741 ****
  {
    CoreHdr *core = core_hdr (abfd);
    char *com = CORE_NEW (*core) ?
!     CNEW_COMM (core->new) : COLD_COMM (core->old);
  
    if (*com)
      return com;
--- 735,741 ----
  {
    CoreHdr *core = core_hdr (abfd);
    char *com = CORE_NEW (*core) ?
!     CNEW_COMM (core->new_dump) : COLD_COMM (core->old);
  
    if (*com)
      return com;
*************** int
*** 747,753 ****
  rs6000coff_core_file_failing_signal (bfd *abfd)
  {
    CoreHdr *core = core_hdr (abfd);
!   return CORE_NEW (*core) ? core->new.c_signo : core->old.c_signo;
  }
  
  #endif /* AIX_CORE */
--- 747,753 ----
  rs6000coff_core_file_failing_signal (bfd *abfd)
  {
    CoreHdr *core = core_hdr (abfd);
!   return CORE_NEW (*core) ? core->new_dump.c_signo : core->old.c_signo;
  }
  
  #endif /* AIX_CORE */
diff -prc src.head/bfd/som.c src.new/bfd/som.c
*** src.head/bfd/som.c	Tue Jun 16 09:07:21 2009
--- src.new/bfd/som.c	Wed Aug 19 18:35:41 2009
*************** static asymbol *
*** 4472,4484 ****
  som_make_empty_symbol (bfd *abfd)
  {
    bfd_size_type amt = sizeof (som_symbol_type);
!   som_symbol_type *new = bfd_zalloc (abfd, amt);
  
!   if (new == NULL)
      return NULL;
!   new->symbol.the_bfd = abfd;
  
!   return &new->symbol;
  }
  
  /* Print symbol information.  */
--- 4472,4484 ----
  som_make_empty_symbol (bfd *abfd)
  {
    bfd_size_type amt = sizeof (som_symbol_type);
!   som_symbol_type *new_symbol_type = bfd_zalloc (abfd, amt);
  
!   if (new_symbol_type == NULL)
      return NULL;
!   new_symbol_type->symbol.the_bfd = abfd;
  
!   return &new_symbol_type->symbol;
  }
  
  /* Print symbol information.  */
diff -prc src.head/bfd/syms.c src.new/bfd/syms.c
*** src.head/bfd/syms.c	Fri Aug 14 10:59:12 2009
--- src.new/bfd/syms.c	Tue Aug 18 11:53:38 2009
*************** asymbol *
*** 539,548 ****
  _bfd_generic_make_empty_symbol (bfd *abfd)
  {
    bfd_size_type amt = sizeof (asymbol);
!   asymbol *new = bfd_zalloc (abfd, amt);
!   if (new)
!     new->the_bfd = abfd;
!   return new;
  }
  
  /*
--- 539,548 ----
  _bfd_generic_make_empty_symbol (bfd *abfd)
  {
    bfd_size_type amt = sizeof (asymbol);
!   asymbol *new_symbol = (asymbol *) bfd_zalloc (abfd, amt);
!   if (new_symbol)
!     new_symbol->the_bfd = abfd;
!   return new_symbol;
  }
  
  /*
diff -prc src.head/bfd/tekhex.c src.new/bfd/tekhex.c
*** src.head/bfd/tekhex.c	Tue Jun 16 09:07:21 2009
--- src.new/bfd/tekhex.c	Tue Aug 18 11:53:38 2009
*************** first_phase (bfd *abfd, int type, char *
*** 415,445 ****
  	      /* Symbols, add to section.  */
  	      {
  		bfd_size_type amt = sizeof (tekhex_symbol_type);
! 		tekhex_symbol_type *new = bfd_alloc (abfd, amt);
  		char stype = (*src);
  
! 		if (!new)
  		  return FALSE;
! 		new->symbol.the_bfd = abfd;
  		src++;
  		abfd->symcount++;
  		abfd->flags |= HAS_SYMS;
! 		new->prev = abfd->tdata.tekhex_data->symbols;
! 		abfd->tdata.tekhex_data->symbols = new;
  		if (!getsym (sym, &src, &len))
  		  return FALSE;
! 		new->symbol.name = bfd_alloc (abfd, (bfd_size_type) len + 1);
! 		if (!new->symbol.name)
  		  return FALSE;
! 		memcpy ((char *) (new->symbol.name), sym, len + 1);
! 		new->symbol.section = section;
  		if (stype <= '4')
! 		  new->symbol.flags = (BSF_GLOBAL | BSF_EXPORT);
  		else
! 		  new->symbol.flags = BSF_LOCAL;
  		if (!getvalue (&src, &val))
  		  return FALSE;
! 		new->symbol.value = val - section->vma;
  		break;
  	      }
  	    default:
--- 415,447 ----
  	      /* Symbols, add to section.  */
  	      {
  		bfd_size_type amt = sizeof (tekhex_symbol_type);
! 		tekhex_symbol_type *new_symbol = (tekhex_symbol_type *)
!                     bfd_alloc (abfd, amt);
  		char stype = (*src);
  
! 		if (!new_symbol)
  		  return FALSE;
! 		new_symbol->symbol.the_bfd = abfd;
  		src++;
  		abfd->symcount++;
  		abfd->flags |= HAS_SYMS;
! 		new_symbol->prev = abfd->tdata.tekhex_data->symbols;
! 		abfd->tdata.tekhex_data->symbols = new_symbol;
  		if (!getsym (sym, &src, &len))
  		  return FALSE;
! 		new_symbol->symbol.name = (const char *)
!                     bfd_alloc (abfd, (bfd_size_type) len + 1);
! 		if (!new_symbol->symbol.name)
  		  return FALSE;
! 		memcpy ((char *) (new_symbol->symbol.name), sym, len + 1);
! 		new_symbol->symbol.section = section;
  		if (stype <= '4')
! 		  new_symbol->symbol.flags = (BSF_GLOBAL | BSF_EXPORT);
  		else
! 		  new_symbol->symbol.flags = BSF_LOCAL;
  		if (!getvalue (&src, &val))
  		  return FALSE;
! 		new_symbol->symbol.value = val - section->vma;
  		break;
  	      }
  	    default:
*************** static asymbol *
*** 880,892 ****
  tekhex_make_empty_symbol (bfd *abfd)
  {
    bfd_size_type amt = sizeof (struct tekhex_symbol_struct);
!   tekhex_symbol_type *new = bfd_zalloc (abfd, amt);
  
!   if (!new)
      return NULL;
!   new->symbol.the_bfd = abfd;
!   new->prev =  NULL;
!   return &(new->symbol);
  }
  
  static void
--- 882,895 ----
  tekhex_make_empty_symbol (bfd *abfd)
  {
    bfd_size_type amt = sizeof (struct tekhex_symbol_struct);
!   tekhex_symbol_type *new_symbol = (tekhex_symbol_type *) bfd_zalloc (abfd,
!                                                                       amt);
  
!   if (!new_symbol)
      return NULL;
!   new_symbol->symbol.the_bfd = abfd;
!   new_symbol->prev =  NULL;
!   return &(new_symbol->symbol);
  }
  
  static void
diff -prc src.head/binutils/nlmconv.c src.new/binutils/nlmconv.c
*** src.head/binutils/nlmconv.c	Tue Jun 16 09:07:12 2009
--- src.new/binutils/nlmconv.c	Wed Aug 19 18:20:53 2009
*************** main (int argc, char **argv)
*** 476,498 ****
  		    ++sym->name;
  		  else
  		    {
! 		      char *new;
  
! 		      new = xmalloc (strlen (bfd_asymbol_name (sym)) + 1);
! 		      new[0] = outlead;
! 		      strcpy (new + 1, bfd_asymbol_name (sym) + 1);
! 		      sym->name = new;
  		    }
  		}
  	    }
  	  else
  	    {
! 	      char *new;
  
! 	      new = xmalloc (strlen (bfd_asymbol_name (sym)) + 2);
! 	      new[0] = outlead;
! 	      strcpy (new + 1, bfd_asymbol_name (sym));
! 	      sym->name = new;
  	    }
  	}
  
--- 476,498 ----
  		    ++sym->name;
  		  else
  		    {
! 		      char *new_name;
  
! 		      new_name = xmalloc (strlen (bfd_asymbol_name (sym)) + 1);
! 		      new_name[0] = outlead;
! 		      strcpy (new_name + 1, bfd_asymbol_name (sym) + 1);
! 		      sym->name = new_name;
  		    }
  		}
  	    }
  	  else
  	    {
! 	      char *new_name;
  
! 	      new_name = xmalloc (strlen (bfd_asymbol_name (sym)) + 2);
! 	      new_name[0] = outlead;
! 	      strcpy (new_name + 1, bfd_asymbol_name (sym));
! 	      sym->name = new_name;
  	    }
  	}
  
Only in src.head: cvs.diff
diff -prc src.head/gas/config/tc-arm.c src.new/gas/config/tc-arm.c
*** src.head/gas/config/tc-arm.c	Fri Aug 14 10:59:49 2009
--- src.new/gas/config/tc-arm.c	Tue Aug 18 11:53:38 2009
*************** parse_reloc (char **str)
*** 2048,2082 ****
  static struct reg_entry *
  insert_reg_alias (char *str, int number, int type)
  {
!   struct reg_entry *new;
    const char *name;
  
!   if ((new = hash_find (arm_reg_hsh, str)) != 0)
      {
!       if (new->builtin)
  	as_warn (_("ignoring attempt to redefine built-in register '%s'"), str);
  
        /* Only warn about a redefinition if it's not defined as the
  	 same register.	 */
!       else if (new->number != number || new->type != type)
  	as_warn (_("ignoring redefinition of register alias '%s'"), str);
  
        return NULL;
      }
  
    name = xstrdup (str);
!   new = xmalloc (sizeof (struct reg_entry));
  
!   new->name = name;
!   new->number = number;
!   new->type = type;
!   new->builtin = FALSE;
!   new->neon = NULL;
  
!   if (hash_insert (arm_reg_hsh, name, (void *) new))
      abort ();
  
!   return new;
  }
  
  static void
--- 2048,2082 ----
  static struct reg_entry *
  insert_reg_alias (char *str, int number, int type)
  {
!   struct reg_entry *new_reg;
    const char *name;
  
!   if ((new_reg = (struct reg_entry *) hash_find (arm_reg_hsh, str)) != 0)
      {
!       if (new_reg->builtin)
  	as_warn (_("ignoring attempt to redefine built-in register '%s'"), str);
  
        /* Only warn about a redefinition if it's not defined as the
  	 same register.	 */
!       else if (new_reg->number != number || new_reg->type != type)
  	as_warn (_("ignoring redefinition of register alias '%s'"), str);
  
        return NULL;
      }
  
    name = xstrdup (str);
!   new_reg = (struct reg_entry *) xmalloc (sizeof (struct reg_entry));
  
!   new_reg->name = name;
!   new_reg->number = number;
!   new_reg->type = type;
!   new_reg->builtin = FALSE;
!   new_reg->neon = NULL;
  
!   if (hash_insert (arm_reg_hsh, name, (void *) new_reg))
      abort ();
  
!   return new_reg;
  }
  
  static void
diff -prc src.head/gas/config/tc-dlx.c src.new/gas/config/tc-dlx.c
*** src.head/gas/config/tc-dlx.c	Fri Aug 14 10:59:50 2009
--- src.new/gas/config/tc-dlx.c	Tue Aug 18 11:53:38 2009
*************** static char *
*** 594,600 ****
  parse_operand (char *s, expressionS *operandp)
  {
    char *save = input_line_pointer;
!   char *new;
  
    the_insn.HI = the_insn.LO = 0;
  
--- 594,600 ----
  parse_operand (char *s, expressionS *operandp)
  {
    char *save = input_line_pointer;
!   char *new_pos;
  
    the_insn.HI = the_insn.LO = 0;
  
*************** parse_operand (char *s, expressionS *ope
*** 641,649 ****
        (void) expression (operandp);
      }
  
!   new = input_line_pointer;
    input_line_pointer = save;
!   return new;
  }
  
  /* Instruction parsing.  Takes a string containing the opcode.
--- 641,649 ----
        (void) expression (operandp);
      }
  
!   new_pos = input_line_pointer;
    input_line_pointer = save;
!   return new_pos;
  }
  
  /* Instruction parsing.  Takes a string containing the opcode.
diff -prc src.head/gas/config/tc-ia64.c src.new/gas/config/tc-ia64.c
*** src.head/gas/config/tc-ia64.c	Fri Aug 14 10:59:51 2009
--- src.new/gas/config/tc-ia64.c	Tue Aug 18 11:53:38 2009
*************** ia64_cons_fix_new (fragS *f, int where, 
*** 10861,10867 ****
  static bfd_reloc_code_real_type
  ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
  {
!   bfd_reloc_code_real_type new = 0;
    const char *type = NULL, *suffix = "";
  
    if (sym == NULL)
--- 10861,10867 ----
  static bfd_reloc_code_real_type
  ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type)
  {
!   bfd_reloc_code_real_type newr = 0;
    const char *type = NULL, *suffix = "";
  
    if (sym == NULL)
*************** ia64_gen_real_reloc_type (struct symbol 
*** 10874,10884 ****
      case FUNC_FPTR_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM64:	new = BFD_RELOC_IA64_FPTR64I; break;
! 	case BFD_RELOC_IA64_DIR32MSB:	new = BFD_RELOC_IA64_FPTR32MSB; break;
! 	case BFD_RELOC_IA64_DIR32LSB:	new = BFD_RELOC_IA64_FPTR32LSB; break;
! 	case BFD_RELOC_IA64_DIR64MSB:	new = BFD_RELOC_IA64_FPTR64MSB; break;
! 	case BFD_RELOC_IA64_DIR64LSB:	new = BFD_RELOC_IA64_FPTR64LSB; break;
  	default:			type = "FPTR"; break;
  	}
        break;
--- 10874,10884 ----
      case FUNC_FPTR_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM64:	newr = BFD_RELOC_IA64_FPTR64I; break;
! 	case BFD_RELOC_IA64_DIR32MSB:	newr = BFD_RELOC_IA64_FPTR32MSB; break;
! 	case BFD_RELOC_IA64_DIR32LSB:	newr = BFD_RELOC_IA64_FPTR32LSB; break;
! 	case BFD_RELOC_IA64_DIR64MSB:	newr = BFD_RELOC_IA64_FPTR64MSB; break;
! 	case BFD_RELOC_IA64_DIR64LSB:	newr = BFD_RELOC_IA64_FPTR64LSB; break;
  	default:			type = "FPTR"; break;
  	}
        break;
*************** ia64_gen_real_reloc_type (struct symbol 
*** 10886,10897 ****
      case FUNC_GP_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM22:	new = BFD_RELOC_IA64_GPREL22; break;
! 	case BFD_RELOC_IA64_IMM64:	new = BFD_RELOC_IA64_GPREL64I; break;
! 	case BFD_RELOC_IA64_DIR32MSB:	new = BFD_RELOC_IA64_GPREL32MSB; break;
! 	case BFD_RELOC_IA64_DIR32LSB:	new = BFD_RELOC_IA64_GPREL32LSB; break;
! 	case BFD_RELOC_IA64_DIR64MSB:	new = BFD_RELOC_IA64_GPREL64MSB; break;
! 	case BFD_RELOC_IA64_DIR64LSB:	new = BFD_RELOC_IA64_GPREL64LSB; break;
  	default:			type = "GPREL"; break;
  	}
        break;
--- 10886,10897 ----
      case FUNC_GP_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM22:	newr = BFD_RELOC_IA64_GPREL22; break;
! 	case BFD_RELOC_IA64_IMM64:	newr = BFD_RELOC_IA64_GPREL64I; break;
! 	case BFD_RELOC_IA64_DIR32MSB:	newr = BFD_RELOC_IA64_GPREL32MSB; break;
! 	case BFD_RELOC_IA64_DIR32LSB:	newr = BFD_RELOC_IA64_GPREL32LSB; break;
! 	case BFD_RELOC_IA64_DIR64MSB:	newr = BFD_RELOC_IA64_GPREL64MSB; break;
! 	case BFD_RELOC_IA64_DIR64LSB:	newr = BFD_RELOC_IA64_GPREL64LSB; break;
  	default:			type = "GPREL"; break;
  	}
        break;
*************** ia64_gen_real_reloc_type (struct symbol 
*** 10899,10906 ****
      case FUNC_LT_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM22:	new = BFD_RELOC_IA64_LTOFF22; break;
! 	case BFD_RELOC_IA64_IMM64:	new = BFD_RELOC_IA64_LTOFF64I; break;
  	default:			type = "LTOFF"; break;
  	}
        break;
--- 10899,10906 ----
      case FUNC_LT_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM22:	newr = BFD_RELOC_IA64_LTOFF22; break;
! 	case BFD_RELOC_IA64_IMM64:	newr = BFD_RELOC_IA64_LTOFF64I; break;
  	default:			type = "LTOFF"; break;
  	}
        break;
*************** ia64_gen_real_reloc_type (struct symbol 
*** 10908,10914 ****
      case FUNC_LT_RELATIVE_X:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM22:	new = BFD_RELOC_IA64_LTOFF22X; break;
  	default:			type = "LTOFF"; suffix = "X"; break;
  	}
        break;
--- 10908,10914 ----
      case FUNC_LT_RELATIVE_X:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM22:	newr = BFD_RELOC_IA64_LTOFF22X; break;
  	default:			type = "LTOFF"; suffix = "X"; break;
  	}
        break;
*************** ia64_gen_real_reloc_type (struct symbol 
*** 10916,10927 ****
      case FUNC_PC_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM22:	new = BFD_RELOC_IA64_PCREL22; break;
! 	case BFD_RELOC_IA64_IMM64:	new = BFD_RELOC_IA64_PCREL64I; break;
! 	case BFD_RELOC_IA64_DIR32MSB:	new = BFD_RELOC_IA64_PCREL32MSB; break;
! 	case BFD_RELOC_IA64_DIR32LSB:	new = BFD_RELOC_IA64_PCREL32LSB; break;
! 	case BFD_RELOC_IA64_DIR64MSB:	new = BFD_RELOC_IA64_PCREL64MSB; break;
! 	case BFD_RELOC_IA64_DIR64LSB:	new = BFD_RELOC_IA64_PCREL64LSB; break;
  	default:			type = "PCREL"; break;
  	}
        break;
--- 10916,10927 ----
      case FUNC_PC_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM22:	newr = BFD_RELOC_IA64_PCREL22; break;
! 	case BFD_RELOC_IA64_IMM64:	newr = BFD_RELOC_IA64_PCREL64I; break;
! 	case BFD_RELOC_IA64_DIR32MSB:	newr = BFD_RELOC_IA64_PCREL32MSB; break;
! 	case BFD_RELOC_IA64_DIR32LSB:	newr = BFD_RELOC_IA64_PCREL32LSB; break;
! 	case BFD_RELOC_IA64_DIR64MSB:	newr = BFD_RELOC_IA64_PCREL64MSB; break;
! 	case BFD_RELOC_IA64_DIR64LSB:	newr = BFD_RELOC_IA64_PCREL64LSB; break;
  	default:			type = "PCREL"; break;
  	}
        break;
*************** ia64_gen_real_reloc_type (struct symbol 
*** 10929,10938 ****
      case FUNC_PLT_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM22:	new = BFD_RELOC_IA64_PLTOFF22; break;
! 	case BFD_RELOC_IA64_IMM64:	new = BFD_RELOC_IA64_PLTOFF64I; break;
! 	case BFD_RELOC_IA64_DIR64MSB:	new = BFD_RELOC_IA64_PLTOFF64MSB;break;
! 	case BFD_RELOC_IA64_DIR64LSB:	new = BFD_RELOC_IA64_PLTOFF64LSB;break;
  	default:			type = "PLTOFF"; break;
  	}
        break;
--- 10929,10938 ----
      case FUNC_PLT_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM22:	newr = BFD_RELOC_IA64_PLTOFF22; break;
! 	case BFD_RELOC_IA64_IMM64:	newr = BFD_RELOC_IA64_PLTOFF64I; break;
! 	case BFD_RELOC_IA64_DIR64MSB:	newr = BFD_RELOC_IA64_PLTOFF64MSB;break;
! 	case BFD_RELOC_IA64_DIR64LSB:	newr = BFD_RELOC_IA64_PLTOFF64LSB;break;
  	default:			type = "PLTOFF"; break;
  	}
        break;
*************** ia64_gen_real_reloc_type (struct symbol 
*** 10940,10949 ****
      case FUNC_SEC_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_DIR32MSB:	new = BFD_RELOC_IA64_SECREL32MSB;break;
! 	case BFD_RELOC_IA64_DIR32LSB:	new = BFD_RELOC_IA64_SECREL32LSB;break;
! 	case BFD_RELOC_IA64_DIR64MSB:	new = BFD_RELOC_IA64_SECREL64MSB;break;
! 	case BFD_RELOC_IA64_DIR64LSB:	new = BFD_RELOC_IA64_SECREL64LSB;break;
  	default:			type = "SECREL"; break;
  	}
        break;
--- 10940,10949 ----
      case FUNC_SEC_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_DIR32MSB:	newr = BFD_RELOC_IA64_SECREL32MSB;break;
! 	case BFD_RELOC_IA64_DIR32LSB:	newr = BFD_RELOC_IA64_SECREL32LSB;break;
! 	case BFD_RELOC_IA64_DIR64MSB:	newr = BFD_RELOC_IA64_SECREL64MSB;break;
! 	case BFD_RELOC_IA64_DIR64LSB:	newr = BFD_RELOC_IA64_SECREL64LSB;break;
  	default:			type = "SECREL"; break;
  	}
        break;
*************** ia64_gen_real_reloc_type (struct symbol 
*** 10951,10960 ****
      case FUNC_SEG_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_DIR32MSB:	new = BFD_RELOC_IA64_SEGREL32MSB;break;
! 	case BFD_RELOC_IA64_DIR32LSB:	new = BFD_RELOC_IA64_SEGREL32LSB;break;
! 	case BFD_RELOC_IA64_DIR64MSB:	new = BFD_RELOC_IA64_SEGREL64MSB;break;
! 	case BFD_RELOC_IA64_DIR64LSB:	new = BFD_RELOC_IA64_SEGREL64LSB;break;
  	default:			type = "SEGREL"; break;
  	}
        break;
--- 10951,10960 ----
      case FUNC_SEG_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_DIR32MSB:	newr = BFD_RELOC_IA64_SEGREL32MSB;break;
! 	case BFD_RELOC_IA64_DIR32LSB:	newr = BFD_RELOC_IA64_SEGREL32LSB;break;
! 	case BFD_RELOC_IA64_DIR64MSB:	newr = BFD_RELOC_IA64_SEGREL64MSB;break;
! 	case BFD_RELOC_IA64_DIR64LSB:	newr = BFD_RELOC_IA64_SEGREL64LSB;break;
  	default:			type = "SEGREL"; break;
  	}
        break;
*************** ia64_gen_real_reloc_type (struct symbol 
*** 10962,10971 ****
      case FUNC_LTV_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_DIR32MSB:	new = BFD_RELOC_IA64_LTV32MSB; break;
! 	case BFD_RELOC_IA64_DIR32LSB:	new = BFD_RELOC_IA64_LTV32LSB; break;
! 	case BFD_RELOC_IA64_DIR64MSB:	new = BFD_RELOC_IA64_LTV64MSB; break;
! 	case BFD_RELOC_IA64_DIR64LSB:	new = BFD_RELOC_IA64_LTV64LSB; break;
  	default:			type = "LTV"; break;
  	}
        break;
--- 10962,10971 ----
      case FUNC_LTV_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_DIR32MSB:	newr = BFD_RELOC_IA64_LTV32MSB; break;
! 	case BFD_RELOC_IA64_DIR32LSB:	newr = BFD_RELOC_IA64_LTV32LSB; break;
! 	case BFD_RELOC_IA64_DIR64MSB:	newr = BFD_RELOC_IA64_LTV64MSB; break;
! 	case BFD_RELOC_IA64_DIR64LSB:	newr = BFD_RELOC_IA64_LTV64LSB; break;
  	default:			type = "LTV"; break;
  	}
        break;
*************** ia64_gen_real_reloc_type (struct symbol 
*** 10974,10990 ****
        switch (r_type)
  	{
  	case BFD_RELOC_IA64_IMM22:
! 	  new = BFD_RELOC_IA64_LTOFF_FPTR22; break;
  	case BFD_RELOC_IA64_IMM64:
! 	  new = BFD_RELOC_IA64_LTOFF_FPTR64I; break;
  	case BFD_RELOC_IA64_DIR32MSB:
! 	  new = BFD_RELOC_IA64_LTOFF_FPTR32MSB; break;
  	case BFD_RELOC_IA64_DIR32LSB:
! 	  new = BFD_RELOC_IA64_LTOFF_FPTR32LSB; break;
  	case BFD_RELOC_IA64_DIR64MSB:
! 	  new = BFD_RELOC_IA64_LTOFF_FPTR64MSB; break;
  	case BFD_RELOC_IA64_DIR64LSB:
! 	  new = BFD_RELOC_IA64_LTOFF_FPTR64LSB; break;
  	default:
  	  type = "LTOFF_FPTR"; break;
  	}
--- 10974,10990 ----
        switch (r_type)
  	{
  	case BFD_RELOC_IA64_IMM22:
! 	  newr = BFD_RELOC_IA64_LTOFF_FPTR22; break;
  	case BFD_RELOC_IA64_IMM64:
! 	  newr = BFD_RELOC_IA64_LTOFF_FPTR64I; break;
  	case BFD_RELOC_IA64_DIR32MSB:
! 	  newr = BFD_RELOC_IA64_LTOFF_FPTR32MSB; break;
  	case BFD_RELOC_IA64_DIR32LSB:
! 	  newr = BFD_RELOC_IA64_LTOFF_FPTR32LSB; break;
  	case BFD_RELOC_IA64_DIR64MSB:
! 	  newr = BFD_RELOC_IA64_LTOFF_FPTR64MSB; break;
  	case BFD_RELOC_IA64_DIR64LSB:
! 	  newr = BFD_RELOC_IA64_LTOFF_FPTR64LSB; break;
  	default:
  	  type = "LTOFF_FPTR"; break;
  	}
*************** ia64_gen_real_reloc_type (struct symbol 
*** 10993,11003 ****
      case FUNC_TP_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM14:      new = BFD_RELOC_IA64_TPREL14; break;
! 	case BFD_RELOC_IA64_IMM22:      new = BFD_RELOC_IA64_TPREL22; break;
! 	case BFD_RELOC_IA64_IMM64:      new = BFD_RELOC_IA64_TPREL64I; break;
! 	case BFD_RELOC_IA64_DIR64MSB:   new = BFD_RELOC_IA64_TPREL64MSB; break;
! 	case BFD_RELOC_IA64_DIR64LSB:   new = BFD_RELOC_IA64_TPREL64LSB; break;
  	default:                        type = "TPREL"; break;
  	}
        break;
--- 10993,11003 ----
      case FUNC_TP_RELATIVE:
        switch (r_type)
  	{
! 	case BFD_RELOC_IA64_IMM14:      newr = BFD_RELOC_IA64_TPREL14; break;
! 	case BFD_RELOC_IA64_IMM22:      newr = BFD_RELOC_IA64_TPREL22; break;
! 	case BFD_RELOC_IA64_IMM64:      newr = BFD_RELOC_IA64_TPREL64I; break;
! 	case BFD_RELOC_IA64_DIR64MSB:   newr = BFD_RELOC_IA64_TPREL64MSB; break;
! 	case BFD_RELOC_IA64_DIR64LSB:   newr = BFD_RELOC_IA64_TPREL64LSB; break;
  	default:                        type = "TPREL"; break;
  	}
        break;
*************** ia64_gen_real_reloc_type (struct symbol 
*** 11006,11012 ****
        switch (r_type)
  	{
  	case BFD_RELOC_IA64_IMM22:
! 	  new = BFD_RELOC_IA64_LTOFF_TPREL22; break;
  	default:
  	  type = "LTOFF_TPREL"; break;
  	}
--- 11006,11012 ----
        switch (r_type)
  	{
  	case BFD_RELOC_IA64_IMM22:
! 	  newr = BFD_RELOC_IA64_LTOFF_TPREL22; break;
  	default:
  	  type = "LTOFF_TPREL"; break;
  	}
*************** ia64_gen_real_reloc_type (struct symbol 
*** 11016,11024 ****
        switch (r_type)
  	{
  	case BFD_RELOC_IA64_DIR64MSB:
! 	  new = BFD_RELOC_IA64_DTPMOD64MSB; break;
  	case BFD_RELOC_IA64_DIR64LSB:
! 	  new = BFD_RELOC_IA64_DTPMOD64LSB; break;
  	default:
  	  type = "DTPMOD"; break;
  	}
--- 11016,11024 ----
        switch (r_type)
  	{
  	case BFD_RELOC_IA64_DIR64MSB:
! 	  newr = BFD_RELOC_IA64_DTPMOD64MSB; break;
  	case BFD_RELOC_IA64_DIR64LSB:
! 	  newr = BFD_RELOC_IA64_DTPMOD64LSB; break;
  	default:
  	  type = "DTPMOD"; break;
  	}
*************** ia64_gen_real_reloc_type (struct symbol 
*** 11028,11034 ****
        switch (r_type)
  	{
  	case BFD_RELOC_IA64_IMM22:
! 	  new = BFD_RELOC_IA64_LTOFF_DTPMOD22; break;
  	default:
  	  type = "LTOFF_DTPMOD"; break;
  	}
--- 11028,11034 ----
        switch (r_type)
  	{
  	case BFD_RELOC_IA64_IMM22:
! 	  newr = BFD_RELOC_IA64_LTOFF_DTPMOD22; break;
  	default:
  	  type = "LTOFF_DTPMOD"; break;
  	}
*************** ia64_gen_real_reloc_type (struct symbol 
*** 11038,11056 ****
        switch (r_type)
  	{
  	case BFD_RELOC_IA64_DIR32MSB:
! 	  new = BFD_RELOC_IA64_DTPREL32MSB; break;
  	case BFD_RELOC_IA64_DIR32LSB:
! 	  new = BFD_RELOC_IA64_DTPREL32LSB; break;
  	case BFD_RELOC_IA64_DIR64MSB:
! 	  new = BFD_RELOC_IA64_DTPREL64MSB; break;
  	case BFD_RELOC_IA64_DIR64LSB:
! 	  new = BFD_RELOC_IA64_DTPREL64LSB; break;
  	case BFD_RELOC_IA64_IMM14:
! 	  new = BFD_RELOC_IA64_DTPREL14; break;
  	case BFD_RELOC_IA64_IMM22:
! 	  new = BFD_RELOC_IA64_DTPREL22; break;
  	case BFD_RELOC_IA64_IMM64:
! 	  new = BFD_RELOC_IA64_DTPREL64I; break;
  	default:
  	  type = "DTPREL"; break;
  	}
--- 11038,11056 ----
        switch (r_type)
  	{
  	case BFD_RELOC_IA64_DIR32MSB:
! 	  newr = BFD_RELOC_IA64_DTPREL32MSB; break;
  	case BFD_RELOC_IA64_DIR32LSB:
! 	  newr = BFD_RELOC_IA64_DTPREL32LSB; break;
  	case BFD_RELOC_IA64_DIR64MSB:
! 	  newr = BFD_RELOC_IA64_DTPREL64MSB; break;
  	case BFD_RELOC_IA64_DIR64LSB:
! 	  newr = BFD_RELOC_IA64_DTPREL64LSB; break;
  	case BFD_RELOC_IA64_IMM14:
! 	  newr = BFD_RELOC_IA64_DTPREL14; break;
  	case BFD_RELOC_IA64_IMM22:
! 	  newr = BFD_RELOC_IA64_DTPREL22; break;
  	case BFD_RELOC_IA64_IMM64:
! 	  newr = BFD_RELOC_IA64_DTPREL64I; break;
  	default:
  	  type = "DTPREL"; break;
  	}
*************** ia64_gen_real_reloc_type (struct symbol 
*** 11060,11066 ****
        switch (r_type)
  	{
  	case BFD_RELOC_IA64_IMM22:
! 	  new = BFD_RELOC_IA64_LTOFF_DTPREL22; break;
  	default:
  	  type = "LTOFF_DTPREL"; break;
  	}
--- 11060,11066 ----
        switch (r_type)
  	{
  	case BFD_RELOC_IA64_IMM22:
! 	  newr = BFD_RELOC_IA64_LTOFF_DTPREL22; break;
  	default:
  	  type = "LTOFF_DTPREL"; break;
  	}
*************** ia64_gen_real_reloc_type (struct symbol 
*** 11079,11086 ****
        abort ();
      }
  
!   if (new)
!     return new;
    else
      {
        int width;
--- 11079,11086 ----
        abort ();
      }
  
!   if (newr)
!     return newr;
    else
      {
        int width;
diff -prc src.head/gas/config/tc-mcore.c src.new/gas/config/tc-mcore.c
*** src.head/gas/config/tc-mcore.c	Fri Aug 14 10:59:52 2009
--- src.new/gas/config/tc-mcore.c	Wed Aug 26 12:45:42 2009
*************** static char *
*** 647,653 ****
  parse_exp (char * s, expressionS * e)
  {
    char * save;
!   char * new;
  
    /* Skip whitespace.  */
    while (ISSPACE (* s))
--- 647,653 ----
  parse_exp (char * s, expressionS * e)
  {
    char * save;
!   char * new_pointer;
  
    /* Skip whitespace.  */
    while (ISSPACE (* s))
*************** parse_exp (char * s, expressionS * e)
*** 661,670 ****
    if (e->X_op == O_absent)
      as_bad (_("missing operand"));
  
!   new = input_line_pointer;
    input_line_pointer = save;
  
!   return new;
  }
  
  static int
--- 661,670 ----
    if (e->X_op == O_absent)
      as_bad (_("missing operand"));
  
!   new_pointer = input_line_pointer;
    input_line_pointer = save;
  
!   return new_pointer;
  }
  
  static int
*************** parse_imm (char * s,
*** 771,780 ****
  	   unsigned min,
  	   unsigned max)
  {
!   char * new;
    expressionS e;
  
!   new = parse_exp (s, & e);
  
    if (e.X_op == O_absent)
      ; /* An error message has already been emitted.  */
--- 771,780 ----
  	   unsigned min,
  	   unsigned max)
  {
!   char * new_pointer;
    expressionS e;
  
!   new_pointer = parse_exp (s, & e);
  
    if (e.X_op == O_absent)
      ; /* An error message has already been emitted.  */
*************** parse_imm (char * s,
*** 786,792 ****
  
    * val = e.X_add_number;
  
!   return new;
  }
  
  static char *
--- 786,792 ----
  
    * val = e.X_add_number;
  
!   return new_pointer;
  }
  
  static char *
diff -prc src.head/gas/config/tc-microblaze.c src.new/gas/config/tc-microblaze.c
*** src.head/gas/config/tc-microblaze.c	Thu Aug  6 10:38:02 2009
--- src.new/gas/config/tc-microblaze.c	Fri Aug 28 10:08:56 2009
*************** static char *
*** 568,574 ****
  parse_exp (char *s, expressionS *e)
  {
    char *save;
!   char *new;
  
    /* Skip whitespace.  */
    while (isspace (* s))
--- 568,574 ----
  parse_exp (char *s, expressionS *e)
  {
    char *save;
!   char *new_pointer;
  
    /* Skip whitespace.  */
    while (isspace (* s))
*************** parse_exp (char *s, expressionS *e)
*** 582,591 ****
    if (e->X_op == O_absent)
      as_fatal (_("missing operand"));
  
!   new = input_line_pointer;
    input_line_pointer = save;
  
!   return new;
  }
  
  /* Symbol modifiers (@GOT, @PLT, @GOTOFF).  */
--- 582,591 ----
    if (e->X_op == O_absent)
      as_fatal (_("missing operand"));
  
!   new_pointer = input_line_pointer;
    input_line_pointer = save;
  
!   return new_pointer;
  }
  
  /* Symbol modifiers (@GOT, @PLT, @GOTOFF).  */
*************** static symbolS * GOT_symbol;
*** 600,606 ****
  static char *
  parse_imm (char * s, expressionS * e, int min, int max)
  {
!   char *new;
    char *atp;
  
    /* Find the start of "@GOT" or "@PLT" suffix (if any) */
--- 600,606 ----
  static char *
  parse_imm (char * s, expressionS * e, int min, int max)
  {
!   char *new_pointer;
    char *atp;
  
    /* Find the start of "@GOT" or "@PLT" suffix (if any) */
*************** parse_imm (char * s, expressionS * e, in
*** 643,649 ****
        GOT_symbol = symbol_find_or_make (GOT_SYMBOL_NAME);
      }
  
!   new = parse_exp (s, e);
  
    if (e->X_op == O_absent)
      ; /* An error message has already been emitted.  */
--- 643,649 ----
        GOT_symbol = symbol_find_or_make (GOT_SYMBOL_NAME);
      }
  
!   new_pointer = parse_exp (s, e);
  
    if (e->X_op == O_absent)
      ; /* An error message has already been emitted.  */
*************** parse_imm (char * s, expressionS * e, in
*** 659,676 ****
    if (atp)
      {
        *atp = '@'; /* restore back (needed?)  */
!       if (new >= atp)
!         new += (e->X_md == IMM_GOTOFF)?7:4;
        /* sizeof("@GOTOFF", "@GOT" or "@PLT") */
  
      }
!   return new;
  }
  
  static char *
  check_got (int * got_type, int * got_len)
  {
!   char *new;
    char *atp;
    char *past_got;
    int first, second;
--- 659,676 ----
    if (atp)
      {
        *atp = '@'; /* restore back (needed?)  */
!       if (new_pointer >= atp)
!         new_pointer += (e->X_md == IMM_GOTOFF)?7:4;
        /* sizeof("@GOTOFF", "@GOT" or "@PLT") */
  
      }
!   return new_pointer;
  }
  
  static char *
  check_got (int * got_type, int * got_len)
  {
!   char *new_pointer;
    char *atp;
    char *past_got;
    int first, second;
*************** check_got (int * got_type, int * got_len
*** 705,713 ****
    first = atp - input_line_pointer;
  
    past_got = atp + *got_len + 1;
!   for (new = past_got; !is_end_of_line[(unsigned char) *new++]; )
      ;
!   second = new - past_got;
    tmpbuf = xmalloc (first + second + 2); /* One extra byte for ' ' and one for NUL.  */
    memcpy (tmpbuf, input_line_pointer, first);
    tmpbuf[first] = ' '; /* @GOTOFF is replaced with a single space.  */
--- 705,713 ----
    first = atp - input_line_pointer;
  
    past_got = atp + *got_len + 1;
!   for (new_pointer = past_got; !is_end_of_line[(unsigned char) *new_pointer++];)
      ;
!   second = new_pointer - past_got;
    tmpbuf = xmalloc (first + second + 2); /* One extra byte for ' ' and one for NUL.  */
    memcpy (tmpbuf, input_line_pointer, first);
    tmpbuf[first] = ' '; /* @GOTOFF is replaced with a single space.  */
Only in src.head/gas/config: tc-moxie.c.~1.5.~
diff -prc src.head/gas/config/tc-or32.c src.new/gas/config/tc-or32.c
*** src.head/gas/config/tc-or32.c	Tue Jun 16 09:07:25 2009
--- src.new/gas/config/tc-or32.c	Wed Aug 26 12:47:35 2009
*************** static char *
*** 262,268 ****
  parse_operand (char *s, expressionS *operandp, int opt)
  {
    char *save = input_line_pointer;
!   char *new;
  
  #if DEBUG
    printf ("  PROCESS NEW OPERAND(%s) == %c (%d)\n", s, opt ? opt : '!', opt);
--- 262,268 ----
  parse_operand (char *s, expressionS *operandp, int opt)
  {
    char *save = input_line_pointer;
!   char *new_pointer;
  
  #if DEBUG
    printf ("  PROCESS NEW OPERAND(%s) == %c (%d)\n", s, opt ? opt : '!', opt);
*************** parse_operand (char *s, expressionS *ope
*** 312,325 ****
          }
      }
  
!   new = input_line_pointer;
    input_line_pointer = save;
  
  #if DEBUG
!   printf ("  %s=parse_operand(%s): operandp->X_op = %u\n", new, s, operandp->X_op);
  #endif
  
!   return new;
  }
  
  /* Instruction parsing.  Takes a string containing the opcode.
--- 312,326 ----
          }
      }
  
!   new_pointer = input_line_pointer;
    input_line_pointer = save;
  
  #if DEBUG
!   printf ("  %s=parse_operand(%s): operandp->X_op = %u\n", new_pointer, s,
!           operandp->X_op);
  #endif
  
!   return new_pointer;
  }
  
  /* Instruction parsing.  Takes a string containing the opcode.
diff -prc src.head/gas/config/tc-pdp11.c src.new/gas/config/tc-pdp11.c
*** src.head/gas/config/tc-pdp11.c	Fri Aug 14 10:59:54 2009
--- src.new/gas/config/tc-pdp11.c	Wed Aug 26 12:48:48 2009
*************** md_assemble (char *instruction_string)
*** 752,759 ****
  
      case PDP11_OPCODE_DISPL:
        {
! 	char *new;
! 	new = parse_expression (str, &op1);
  	op1.code = 0;
  	op1.reloc.pc_rel = 1;
  	op1.reloc.type = BFD_RELOC_PDP11_DISP_8_PCREL;
--- 752,759 ----
  
      case PDP11_OPCODE_DISPL:
        {
! 	char *new_pointer;
! 	new_pointer = parse_expression (str, &op1);
  	op1.code = 0;
  	op1.reloc.pc_rel = 1;
  	op1.reloc.type = BFD_RELOC_PDP11_DISP_8_PCREL;
*************** md_assemble (char *instruction_string)
*** 767,773 ****
  	    err = _("8-bit displacement out of range");
  	    break;
  	  }
! 	str = new;
  	insn.code |= op1.code;
  	insn.reloc = op1.reloc;
        }
--- 767,773 ----
  	    err = _("8-bit displacement out of range");
  	    break;
  	  }
! 	str = new_pointer;
  	insn.code |= op1.code;
  	insn.reloc = op1.reloc;
        }
*************** md_assemble (char *instruction_string)
*** 935,941 ****
  
      case PDP11_OPCODE_REG_DISPL:
        {
! 	char *new;
  	str = parse_reg (str, &op2);
  	if (op2.error)
  	  break;
--- 935,941 ----
  
      case PDP11_OPCODE_REG_DISPL:
        {
! 	char *new_pointer;
  	str = parse_reg (str, &op2);
  	if (op2.error)
  	  break;
*************** md_assemble (char *instruction_string)
*** 946,952 ****
  	    op1.error = _("Missing ','");
  	    break;
  	  }
! 	new = parse_expression (str, &op1);
  	op1.code = 0;
  	op1.reloc.pc_rel = 1;
  	op1.reloc.type = BFD_RELOC_PDP11_DISP_6_PCREL;
--- 946,952 ----
  	    op1.error = _("Missing ','");
  	    break;
  	  }
! 	new_pointer = parse_expression (str, &op1);
  	op1.code = 0;
  	op1.reloc.pc_rel = 1;
  	op1.reloc.type = BFD_RELOC_PDP11_DISP_6_PCREL;
*************** md_assemble (char *instruction_string)
*** 960,966 ****
  	    err = _("6-bit displacement out of range");
  	    break;
  	  }
! 	str = new;
  	insn.code |= op1.code;
  	insn.reloc = op1.reloc;
        }
--- 960,966 ----
  	    err = _("6-bit displacement out of range");
  	    break;
  	  }
! 	str = new_pointer;
  	insn.code |= op1.code;
  	insn.reloc = op1.reloc;
        }
diff -prc src.head/gas/config/tc-pj.c src.new/gas/config/tc-pj.c
*** src.head/gas/config/tc-pj.c	Fri Aug 14 10:59:54 2009
--- src.new/gas/config/tc-pj.c	Tue Aug 18 11:53:38 2009
*************** fake_opcode (const char *name,
*** 183,191 ****
     can have another name.  */
  
  static void
! alias (const char *new, const char *old)
  {
!   hash_insert (opcode_hash_control, new,
  	       (char *) hash_find (opcode_hash_control, old));
  }
  
--- 183,191 ----
     can have another name.  */
  
  static void
! alias (const char *new_name, const char *old)
  {
!   hash_insert (opcode_hash_control, new_name,
  	       (char *) hash_find (opcode_hash_control, old));
  }
  
diff -prc src.head/gas/config/tc-score.c src.new/gas/config/tc-score.c
*** src.head/gas/config/tc-score.c	Fri Aug 14 10:59:54 2009
--- src.new/gas/config/tc-score.c	Tue Aug 18 11:53:38 2009
*************** s3_build_score_ops_hsh (void)
*** 6320,6338 ****
      {
        const struct s3_asm_opcode *insn = s3_score_insns + i;
        unsigned len = strlen (insn->template);
!       struct s3_asm_opcode *new;
        char *template;
!       new = obstack_alloc (&insn_obstack, sizeof (struct s3_asm_opcode));
!       template = obstack_alloc (&insn_obstack, len + 1);
  
        strcpy (template, insn->template);
!       new->template = template;
!       new->parms = insn->parms;
!       new->value = insn->value;
!       new->relax_value = insn->relax_value;
!       new->type = insn->type;
!       new->bitmask = insn->bitmask;
!       hash_insert (s3_score_ops_hsh, new->template, (void *) new);
      }
  }
  
--- 6320,6340 ----
      {
        const struct s3_asm_opcode *insn = s3_score_insns + i;
        unsigned len = strlen (insn->template);
!       struct s3_asm_opcode *new_opcode;
        char *template;
!       new_opcode = (struct s3_asm_opcode *)
!           obstack_alloc (&insn_obstack, sizeof (struct s3_asm_opcode));
!       template = (char *) obstack_alloc (&insn_obstack, len + 1);
  
        strcpy (template, insn->template);
!       new_opcode->template = template;
!       new_opcode->parms = insn->parms;
!       new_opcode->value = insn->value;
!       new_opcode->relax_value = insn->relax_value;
!       new_opcode->type = insn->type;
!       new_opcode->bitmask = insn->bitmask;
!       hash_insert (s3_score_ops_hsh, new_opcode->template,
!                    (void *) new_opcode);
      }
  }
  
*************** s3_build_dependency_insn_hsh (void)
*** 6347,6360 ****
      {
        const struct s3_insn_to_dependency *tmp = s3_insn_to_dependency_table + i;
        unsigned len = strlen (tmp->insn_name);
!       struct s3_insn_to_dependency *new;
  
!       new = obstack_alloc (&dependency_obstack, sizeof (struct s3_insn_to_dependency));
!       new->insn_name = obstack_alloc (&dependency_obstack, len + 1);
! 
!       strcpy (new->insn_name, tmp->insn_name);
!       new->type = tmp->type;
!       hash_insert (s3_dependency_insn_hsh, new->insn_name, (void *) new);
      }
  }
  
--- 6349,6366 ----
      {
        const struct s3_insn_to_dependency *tmp = s3_insn_to_dependency_table + i;
        unsigned len = strlen (tmp->insn_name);
!       struct s3_insn_to_dependency *new_i2n;
  
!       new_i2n = (struct s3_insn_to_dependency *)
!           obstack_alloc (&dependency_obstack,
!                          sizeof (struct s3_insn_to_dependency));
!       new_i2n->insn_name = (char *) obstack_alloc (&dependency_obstack,
!                                                    len + 1);
! 
!       strcpy (new_i2n->insn_name, tmp->insn_name);
!       new_i2n->type = tmp->type;
!       hash_insert (s3_dependency_insn_hsh, new_i2n->insn_name,
!                    (void *) new_i2n);
      }
  }
  
*************** s3_relax_frag (asection * sec ATTRIBUTE_
*** 7023,7050 ****
  static void
  s3_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, fragS * fragp)
  {
!   int old;
!   int new;
    char backup[20];
    fixS *fixp;
  
!   old = s3_RELAX_OLD (fragp->fr_subtype);
!   new = s3_RELAX_NEW (fragp->fr_subtype);
  
    /* fragp->fr_opcode indicates whether this frag should be relaxed.  */
    if (fragp->fr_opcode == NULL)
      {
!       memcpy (backup, fragp->fr_literal, old);
!       fragp->fr_fix = old;
      }
    else
      {
!       memcpy (backup, fragp->fr_literal + old, new);
!       fragp->fr_fix = new;
      }
  
    fixp = fragp->tc_frag_data.fixp;
!   while (fixp && fixp->fx_frag == fragp && fixp->fx_where < old)
      {
        if (fragp->fr_opcode)
  	fixp->fx_done = 1;
--- 7029,7056 ----
  static void
  s3_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, fragS * fragp)
  {
!   int r_old;
!   int r_new;
    char backup[20];
    fixS *fixp;
  
!   r_old = s3_RELAX_OLD (fragp->fr_subtype);
!   r_new = s3_RELAX_NEW (fragp->fr_subtype);
  
    /* fragp->fr_opcode indicates whether this frag should be relaxed.  */
    if (fragp->fr_opcode == NULL)
      {
!       memcpy (backup, fragp->fr_literal, r_old);
!       fragp->fr_fix = r_old;
      }
    else
      {
!       memcpy (backup, fragp->fr_literal + r_old, r_new);
!       fragp->fr_fix = r_new;
      }
  
    fixp = fragp->tc_frag_data.fixp;
!   while (fixp && fixp->fx_frag == fragp && fixp->fx_where < r_old)
      {
        if (fragp->fr_opcode)
  	fixp->fx_done = 1;
*************** s3_convert_frag (bfd * abfd ATTRIBUTE_UN
*** 7053,7059 ****
    while (fixp && fixp->fx_frag == fragp)
      {
        if (fragp->fr_opcode)
! 	fixp->fx_where -= old + fragp->insn_addr;
        else
  	fixp->fx_done = 1;
        fixp = fixp->fx_next;
--- 7059,7065 ----
    while (fixp && fixp->fx_frag == fragp)
      {
        if (fragp->fr_opcode)
! 	fixp->fx_where -= r_old + fragp->insn_addr;
        else
  	fixp->fx_done = 1;
        fixp = fixp->fx_next;
diff -prc src.head/gas/config/tc-score7.c src.new/gas/config/tc-score7.c
*** src.head/gas/config/tc-score7.c	Fri Aug 14 10:59:54 2009
--- src.new/gas/config/tc-score7.c	Tue Aug 18 11:53:38 2009
*************** s7_build_score_ops_hsh (void)
*** 5093,5111 ****
      {
        const struct s7_asm_opcode *insn = s7_score_insns + i;
        unsigned len = strlen (insn->template);
!       struct s7_asm_opcode *new;
        char *template;
!       new = obstack_alloc (&insn_obstack, sizeof (struct s7_asm_opcode));
!       template = obstack_alloc (&insn_obstack, len + 1);
  
        strcpy (template, insn->template);
!       new->template = template;
!       new->parms = insn->parms;
!       new->value = insn->value;
!       new->relax_value = insn->relax_value;
!       new->type = insn->type;
!       new->bitmask = insn->bitmask;
!       hash_insert (s7_score_ops_hsh, new->template, (void *) new);
      }
  }
  
--- 5093,5113 ----
      {
        const struct s7_asm_opcode *insn = s7_score_insns + i;
        unsigned len = strlen (insn->template);
!       struct s7_asm_opcode *new_opcode;
        char *template;
!       new_opcode = (struct s7_asm_opcode *)
!           obstack_alloc (&insn_obstack, sizeof (struct s7_asm_opcode));
!       template = (char *) obstack_alloc (&insn_obstack, len + 1);
  
        strcpy (template, insn->template);
!       new_opcode->template = template;
!       new_opcode->parms = insn->parms;
!       new_opcode->value = insn->value;
!       new_opcode->relax_value = insn->relax_value;
!       new_opcode->type = insn->type;
!       new_opcode->bitmask = insn->bitmask;
!       hash_insert (s7_score_ops_hsh, new_opcode->template,
!                    (void *) new_opcode);
      }
  }
  
*************** s7_build_dependency_insn_hsh (void)
*** 5120,5133 ****
      {
        const struct s7_insn_to_dependency *tmp = s7_insn_to_dependency_table + i;
        unsigned len = strlen (tmp->insn_name);
!       struct s7_insn_to_dependency *new;
  
!       new = obstack_alloc (&dependency_obstack, sizeof (struct s7_insn_to_dependency));
!       new->insn_name = obstack_alloc (&dependency_obstack, len + 1);
! 
!       strcpy (new->insn_name, tmp->insn_name);
!       new->type = tmp->type;
!       hash_insert (s7_dependency_insn_hsh, new->insn_name, (void *) new);
      }
  }
  
--- 5122,5139 ----
      {
        const struct s7_insn_to_dependency *tmp = s7_insn_to_dependency_table + i;
        unsigned len = strlen (tmp->insn_name);
!       struct s7_insn_to_dependency *new_i2d;
  
!       new_i2d = (struct s7_insn_to_dependency *)
!           obstack_alloc (&dependency_obstack,
!                          sizeof (struct s7_insn_to_dependency));
!       new_i2d->insn_name = (char *) obstack_alloc (&dependency_obstack,
!                                                    len + 1);
! 
!       strcpy (new_i2d->insn_name, tmp->insn_name);
!       new_i2d->type = tmp->type;
!       hash_insert (s7_dependency_insn_hsh, new_i2d->insn_name,
!                    (void *) new_i2d);
      }
  }
  
*************** s7_b32_relax_to_b16 (fragS * fragp)
*** 5238,5245 ****
  {
    int grows = 0;
    int relaxable_p = 0;
!   int old;
!   int new;
    int frag_addr = fragp->fr_address + fragp->insn_addr;
  
    addressT symbol_address = 0;
--- 5244,5251 ----
  {
    int grows = 0;
    int relaxable_p = 0;
!   int r_old;
!   int r_new;
    int frag_addr = fragp->fr_address + fragp->insn_addr;
  
    addressT symbol_address = 0;
*************** s7_b32_relax_to_b16 (fragS * fragp)
*** 5253,5260 ****
       so in relax stage , it may be wrong to calculate the symbol's offset when the frag's section
       is different from the symbol's.  */
  
!   old = s7_RELAX_OLD (fragp->fr_subtype);
!   new = s7_RELAX_NEW (fragp->fr_subtype);
    relaxable_p = s7_RELAX_OPT (fragp->fr_subtype);
  
    s = fragp->fr_symbol;
--- 5259,5266 ----
       so in relax stage , it may be wrong to calculate the symbol's offset when the frag's section
       is different from the symbol's.  */
  
!   r_old = s7_RELAX_OLD (fragp->fr_subtype);
!   r_new = s7_RELAX_NEW (fragp->fr_subtype);
    relaxable_p = s7_RELAX_OPT (fragp->fr_subtype);
  
    s = fragp->fr_symbol;
*************** s7_convert_frag (bfd * abfd ATTRIBUTE_UN
*** 6575,6602 ****
  		 segT sec ATTRIBUTE_UNUSED,
  		 fragS * fragp)
  {
!   int old;
!   int new;
    char backup[20];
    fixS *fixp;
  
!   old = s7_RELAX_OLD (fragp->fr_subtype);
!   new = s7_RELAX_NEW (fragp->fr_subtype);
  
    /* fragp->fr_opcode indicates whether this frag should be relaxed.  */
    if (fragp->fr_opcode == NULL)
      {
!       memcpy (backup, fragp->fr_literal, old);
!       fragp->fr_fix = old;
      }
    else
      {
!       memcpy (backup, fragp->fr_literal + old, new);
!       fragp->fr_fix = new;
      }
  
    fixp = fragp->tc_frag_data.fixp;
!   while (fixp && fixp->fx_frag == fragp && fixp->fx_where < old)
      {
        if (fragp->fr_opcode)
  	fixp->fx_done = 1;
--- 6581,6608 ----
  		 segT sec ATTRIBUTE_UNUSED,
  		 fragS * fragp)
  {
!   int r_old;
!   int r_new;
    char backup[20];
    fixS *fixp;
  
!   r_old = s7_RELAX_OLD (fragp->fr_subtype);
!   r_new = s7_RELAX_NEW (fragp->fr_subtype);
  
    /* fragp->fr_opcode indicates whether this frag should be relaxed.  */
    if (fragp->fr_opcode == NULL)
      {
!       memcpy (backup, fragp->fr_literal, r_old);
!       fragp->fr_fix = r_old;
      }
    else
      {
!       memcpy (backup, fragp->fr_literal + r_old, r_new);
!       fragp->fr_fix = r_new;
      }
  
    fixp = fragp->tc_frag_data.fixp;
!   while (fixp && fixp->fx_frag == fragp && fixp->fx_where < r_old)
      {
        if (fragp->fr_opcode)
  	fixp->fx_done = 1;
*************** s7_convert_frag (bfd * abfd ATTRIBUTE_UN
*** 6605,6611 ****
    while (fixp && fixp->fx_frag == fragp)
      {
        if (fragp->fr_opcode)
! 	fixp->fx_where -= old + fragp->insn_addr;
        else
  	fixp->fx_done = 1;
        fixp = fixp->fx_next;
--- 6611,6617 ----
    while (fixp && fixp->fx_frag == fragp)
      {
        if (fragp->fr_opcode)
! 	fixp->fx_where -= r_old + fragp->insn_addr;
        else
  	fixp->fx_done = 1;
        fixp = fixp->fx_next;
diff -prc src.head/gas/config/tc-sh.c src.new/gas/config/tc-sh.c
*** src.head/gas/config/tc-sh.c	Fri Aug 14 10:59:54 2009
--- src.new/gas/config/tc-sh.c	Wed Aug 26 12:53:12 2009
*************** static char *
*** 1350,1356 ****
  parse_exp (char *s, sh_operand_info *op)
  {
    char *save;
!   char *new;
  
    save = input_line_pointer;
    input_line_pointer = s;
--- 1350,1356 ----
  parse_exp (char *s, sh_operand_info *op)
  {
    char *save;
!   char *new_pointer;
  
    save = input_line_pointer;
    input_line_pointer = s;
*************** parse_exp (char *s, sh_operand_info *op)
*** 1363,1371 ****
  	   || sh_PIC_related_p (op->immediate.X_op_symbol))
      as_bad (_("misplaced PIC operand"));
  #endif
!   new = input_line_pointer;
    input_line_pointer = save;
!   return new;
  }
  
  /* The many forms of operand:
--- 1363,1371 ----
  	   || sh_PIC_related_p (op->immediate.X_op_symbol))
      as_bad (_("misplaced PIC operand"));
  #endif
!   new_pointer = input_line_pointer;
    input_line_pointer = save;
!   return new_pointer;
  }
  
  /* The many forms of operand:
diff -prc src.head/gas/config/tc-sh64.c src.new/gas/config/tc-sh64.c
*** src.head/gas/config/tc-sh64.c	Fri Aug 14 10:59:54 2009
--- src.new/gas/config/tc-sh64.c	Wed Aug 26 12:54:06 2009
*************** static char *
*** 2204,2219 ****
  shmedia_parse_exp (char *s, shmedia_operand_info *op)
  {
    char *save;
!   char *new;
  
    save = input_line_pointer;
    input_line_pointer = s;
    expression (&op->immediate);
    if (op->immediate.X_op == O_absent)
      as_bad (_("missing operand"));
!   new = input_line_pointer;
    input_line_pointer = save;
!   return new;
  }
  
  /* Parse an operand.  Store pointer to next character in *PTR.  */
--- 2204,2219 ----
  shmedia_parse_exp (char *s, shmedia_operand_info *op)
  {
    char *save;
!   char *new_pointer;
  
    save = input_line_pointer;
    input_line_pointer = s;
    expression (&op->immediate);
    if (op->immediate.X_op == O_absent)
      as_bad (_("missing operand"));
!   new_pointer = input_line_pointer;
    input_line_pointer = save;
!   return new_pointer;
  }
  
  /* Parse an operand.  Store pointer to next character in *PTR.  */
diff -prc src.head/gas/config/tc-tic4x.c src.new/gas/config/tc-tic4x.c
*** src.head/gas/config/tc-tic4x.c	Fri Aug 14 10:59:55 2009
--- src.new/gas/config/tc-tic4x.c	Wed Aug 26 12:54:39 2009
*************** tic4x_operand_parse (char *s, tic4x_oper
*** 1516,1522 ****
    expressionS *exp = &operand->expr;
    char *save = input_line_pointer;
    char *str;
!   char *new;
    struct hash_entry *entry = NULL;
  
    input_line_pointer = s;
--- 1516,1522 ----
    expressionS *exp = &operand->expr;
    char *save = input_line_pointer;
    char *str;
!   char *new_pointer;
    struct hash_entry *entry = NULL;
  
    input_line_pointer = s;
*************** tic4x_operand_parse (char *s, tic4x_oper
*** 1524,1530 ****
  
    str = input_line_pointer;
    c = get_symbol_end ();	/* Get terminator.  */
!   new = input_line_pointer;
    if (strlen (str) && (entry = hash_find (tic4x_asg_hash, str)) != NULL)
      {
        *input_line_pointer = c;
--- 1524,1530 ----
  
    str = input_line_pointer;
    c = get_symbol_end ();	/* Get terminator.  */
!   new_pointer = input_line_pointer;
    if (strlen (str) && (entry = hash_find (tic4x_asg_hash, str)) != NULL)
      {
        *input_line_pointer = c;
*************** tic4x_operand_parse (char *s, tic4x_oper
*** 1666,1674 ****
  #endif
      }
    if (entry == NULL)
!     new = input_line_pointer;
    input_line_pointer = save;
!   return new;
  }
  
  static int 
--- 1666,1674 ----
  #endif
      }
    if (entry == NULL)
!     new_pointer = input_line_pointer;
    input_line_pointer = save;
!   return new_pointer;
  }
  
  static int 
diff -prc src.head/gas/config/tc-z8k.c src.new/gas/config/tc-z8k.c
*** src.head/gas/config/tc-z8k.c	Fri Aug 14 10:59:56 2009
--- src.new/gas/config/tc-z8k.c	Wed Aug 26 12:55:23 2009
*************** static char *
*** 342,356 ****
  parse_exp (char *s, expressionS *op)
  {
    char *save = input_line_pointer;
!   char *new;
  
    input_line_pointer = s;
    expression (op);
    if (op->X_op == O_absent)
      as_bad (_("missing operand"));
!   new = input_line_pointer;
    input_line_pointer = save;
!   return new;
  }
  
  /* The many forms of operand:
--- 342,356 ----
  parse_exp (char *s, expressionS *op)
  {
    char *save = input_line_pointer;
!   char *new_pointer;
  
    input_line_pointer = s;
    expression (op);
    if (op->X_op == O_absent)
      as_bad (_("missing operand"));
!   new_pointer = input_line_pointer;
    input_line_pointer = save;
!   return new_pointer;
  }
  
  /* The many forms of operand:
diff -prc src.head/gas/listing.c src.new/gas/listing.c
*** src.head/gas/listing.c	Fri Aug 14 10:59:46 2009
--- src.new/gas/listing.c	Tue Aug 18 11:53:38 2009
*************** listing_newline (char *ps)
*** 285,291 ****
    unsigned int line;
    static unsigned int last_line = 0xffff;
    static char *last_file = NULL;
!   list_info_type *new = NULL;
  
    if (listing == 0)
      return;
--- 285,291 ----
    unsigned int line;
    static unsigned int last_line = 0xffff;
    static char *last_file = NULL;
!   list_info_type *new_i = NULL;
  
    if (listing == 0)
      return;
*************** listing_newline (char *ps)
*** 318,324 ****
  	  && !(last_file && file && strcmp (file, last_file)))
  	return;
  
!       new = (list_info_type *) xmalloc (sizeof (list_info_type));
  
        /* Detect if we are reading from stdin by examining the file
  	 name returned by as_where().
--- 318,324 ----
  	  && !(last_file && file && strcmp (file, last_file)))
  	return;
  
!       new_i = (list_info_type *) xmalloc (sizeof (list_info_type));
  
        /* Detect if we are reading from stdin by examining the file
  	 name returned by as_where().
*************** listing_newline (char *ps)
*** 371,385 ****
  	      *dest = 0;
  	    }
  
! 	  new->line_contents = copy;
  	}
        else
! 	new->line_contents = NULL;
      }
    else
      {
!       new = xmalloc (sizeof (list_info_type));
!       new->line_contents = ps;
      }
  
    last_line = line;
--- 371,385 ----
  	      *dest = 0;
  	    }
  
! 	  new_i->line_contents = copy;
  	}
        else
! 	new_i->line_contents = NULL;
      }
    else
      {
!       new_i = (list_info_type *) xmalloc (sizeof (list_info_type));
!       new_i->line_contents = ps;
      }
  
    last_line = line;
*************** listing_newline (char *ps)
*** 388,408 ****
    new_frag ();
  
    if (listing_tail)
!     listing_tail->next = new;
    else
!     head = new;
  
!   listing_tail = new;
  
!   new->frag = frag_now;
!   new->line = line;
!   new->file = file_info (file);
!   new->next = (list_info_type *) NULL;
!   new->message = (char *) NULL;
!   new->edict = EDICT_NONE;
!   new->hll_file = (file_info_type *) NULL;
!   new->hll_line = 0;
!   new->debugging = 0;
  
    new_frag ();
  
--- 388,408 ----
    new_frag ();
  
    if (listing_tail)
!     listing_tail->next = new_i;
    else
!     head = new_i;
  
!   listing_tail = new_i;
  
!   new_i->frag = frag_now;
!   new_i->line = line;
!   new_i->file = file_info (file);
!   new_i->next = (list_info_type *) NULL;
!   new_i->message = (char *) NULL;
!   new_i->edict = EDICT_NONE;
!   new_i->hll_file = (file_info_type *) NULL;
!   new_i->hll_line = 0;
!   new_i->debugging = 0;
  
    new_frag ();
  
*************** listing_newline (char *ps)
*** 416,422 ****
        segname = segment_name (now_seg);
        if (strncmp (segname, ".debug", sizeof ".debug" - 1) == 0
  	  || strncmp (segname, ".line", sizeof ".line" - 1) == 0)
! 	new->debugging = 1;
      }
  #endif
  }
--- 416,422 ----
        segname = segment_name (now_seg);
        if (strncmp (segname, ".debug", sizeof ".debug" - 1) == 0
  	  || strncmp (segname, ".line", sizeof ".line" - 1) == 0)
! 	new_i->debugging = 1;
      }
  #endif
  }
diff -prc src.head/ld/ldexp.c src.new/ld/ldexp.c
*** src.head/ld/ldexp.c	Tue Jun 16 09:08:14 2009
--- src.new/ld/ldexp.c	Tue Aug 18 11:53:38 2009
*************** new_abs (bfd_vma value)
*** 154,178 ****
  etree_type *
  exp_intop (bfd_vma value)
  {
!   etree_type *new = stat_alloc (sizeof (new->value));
!   new->type.node_code = INT;
!   new->type.lineno = lineno;
!   new->value.value = value;
!   new->value.str = NULL;
!   new->type.node_class = etree_value;
!   return new;
  }
  
  etree_type *
  exp_bigintop (bfd_vma value, char *str)
  {
!   etree_type *new = stat_alloc (sizeof (new->value));
!   new->type.node_code = INT;
!   new->type.lineno = lineno;
!   new->value.value = value;
!   new->value.str = str;
!   new->type.node_class = etree_value;
!   return new;
  }
  
  /* Build an expression representing an unnamed relocatable value.  */
--- 154,178 ----
  etree_type *
  exp_intop (bfd_vma value)
  {
!   etree_type *new_e = (etree_type *) stat_alloc (sizeof (new_e->value));
!   new_e->type.node_code = INT;
!   new_e->type.lineno = lineno;
!   new_e->value.value = value;
!   new_e->value.str = NULL;
!   new_e->type.node_class = etree_value;
!   return new_e;
  }
  
  etree_type *
  exp_bigintop (bfd_vma value, char *str)
  {
!   etree_type *new_e = (etree_type *) stat_alloc (sizeof (new_e->value));
!   new_e->type.node_code = INT;
!   new_e->type.lineno = lineno;
!   new_e->value.value = value;
!   new_e->value.str = str;
!   new_e->type.node_class = etree_value;
!   return new_e;
  }
  
  /* Build an expression representing an unnamed relocatable value.  */
*************** exp_bigintop (bfd_vma value, char *str)
*** 180,192 ****
  etree_type *
  exp_relop (asection *section, bfd_vma value)
  {
!   etree_type *new = stat_alloc (sizeof (new->rel));
!   new->type.node_code = REL;
!   new->type.lineno = lineno;
!   new->type.node_class = etree_rel;
!   new->rel.section = section;
!   new->rel.value = value;
!   return new;
  }
  
  static void
--- 180,192 ----
  etree_type *
  exp_relop (asection *section, bfd_vma value)
  {
!   etree_type *new_e = (etree_type *) stat_alloc (sizeof (new_e->rel));
!   new_e->type.node_code = REL;
!   new_e->type.lineno = lineno;
!   new_e->type.node_class = etree_rel;
!   new_e->rel.section = section;
!   new_e->rel.value = value;
!   return new_e;
  }
  
  static void
*************** exp_fold_tree_no_dot (etree_type *tree)
*** 851,857 ****
  etree_type *
  exp_binop (int code, etree_type *lhs, etree_type *rhs)
  {
!   etree_type value, *new;
  
    value.type.node_code = code;
    value.type.lineno = lhs->type.lineno;
--- 851,857 ----
  etree_type *
  exp_binop (int code, etree_type *lhs, etree_type *rhs)
  {
!   etree_type value, *new_e;
  
    value.type.node_code = code;
    value.type.lineno = lhs->type.lineno;
*************** exp_binop (int code, etree_type *lhs, et
*** 862,876 ****
    if (expld.result.valid_p)
      return exp_intop (expld.result.value);
  
!   new = stat_alloc (sizeof (new->binary));
!   memcpy (new, &value, sizeof (new->binary));
!   return new;
  }
  
  etree_type *
  exp_trinop (int code, etree_type *cond, etree_type *lhs, etree_type *rhs)
  {
!   etree_type value, *new;
  
    value.type.node_code = code;
    value.type.lineno = lhs->type.lineno;
--- 862,876 ----
    if (expld.result.valid_p)
      return exp_intop (expld.result.value);
  
!   new_e = (etree_type *) stat_alloc (sizeof (new_e->binary));
!   memcpy (new_e, &value, sizeof (new_e->binary));
!   return new_e;
  }
  
  etree_type *
  exp_trinop (int code, etree_type *cond, etree_type *lhs, etree_type *rhs)
  {
!   etree_type value, *new_e;
  
    value.type.node_code = code;
    value.type.lineno = lhs->type.lineno;
*************** exp_trinop (int code, etree_type *cond, 
*** 882,896 ****
    if (expld.result.valid_p)
      return exp_intop (expld.result.value);
  
!   new = stat_alloc (sizeof (new->trinary));
!   memcpy (new, &value, sizeof (new->trinary));
!   return new;
  }
  
  etree_type *
  exp_unop (int code, etree_type *child)
  {
!   etree_type value, *new;
  
    value.unary.type.node_code = code;
    value.unary.type.lineno = child->type.lineno;
--- 882,896 ----
    if (expld.result.valid_p)
      return exp_intop (expld.result.value);
  
!   new_e = (etree_type *) stat_alloc (sizeof (new_e->trinary));
!   memcpy (new_e, &value, sizeof (new_e->trinary));
!   return new_e;
  }
  
  etree_type *
  exp_unop (int code, etree_type *child)
  {
!   etree_type value, *new_e;
  
    value.unary.type.node_code = code;
    value.unary.type.lineno = child->type.lineno;
*************** exp_unop (int code, etree_type *child)
*** 900,914 ****
    if (expld.result.valid_p)
      return exp_intop (expld.result.value);
  
!   new = stat_alloc (sizeof (new->unary));
!   memcpy (new, &value, sizeof (new->unary));
!   return new;
  }
  
  etree_type *
  exp_nameop (int code, const char *name)
  {
!   etree_type value, *new;
  
    value.name.type.node_code = code;
    value.name.type.lineno = lineno;
--- 900,914 ----
    if (expld.result.valid_p)
      return exp_intop (expld.result.value);
  
!   new_e = (etree_type *) stat_alloc (sizeof (new_e->unary));
!   memcpy (new_e, &value, sizeof (new_e->unary));
!   return new_e;
  }
  
  etree_type *
  exp_nameop (int code, const char *name)
  {
!   etree_type value, *new_e;
  
    value.name.type.node_code = code;
    value.name.type.lineno = lineno;
*************** exp_nameop (int code, const char *name)
*** 919,942 ****
    if (expld.result.valid_p)
      return exp_intop (expld.result.value);
  
!   new = stat_alloc (sizeof (new->name));
!   memcpy (new, &value, sizeof (new->name));
!   return new;
  
  }
  
  etree_type *
  exp_assop (int code, const char *dst, etree_type *src)
  {
!   etree_type *new;
  
!   new = stat_alloc (sizeof (new->assign));
!   new->type.node_code = code;
!   new->type.lineno = src->type.lineno;
!   new->type.node_class = etree_assign;
!   new->assign.src = src;
!   new->assign.dst = dst;
!   return new;
  }
  
  /* Handle PROVIDE.  */
--- 919,942 ----
    if (expld.result.valid_p)
      return exp_intop (expld.result.value);
  
!   new_e = (etree_type *) stat_alloc (sizeof (new_e->name));
!   memcpy (new_e, &value, sizeof (new_e->name));
!   return new_e;
  
  }
  
  etree_type *
  exp_assop (int code, const char *dst, etree_type *src)
  {
!   etree_type *new_e;
  
!   new_e = (etree_type *) stat_alloc (sizeof (new_e->assign));
!   new_e->type.node_code = code;
!   new_e->type.lineno = src->type.lineno;
!   new_e->type.node_class = etree_assign;
!   new_e->assign.src = src;
!   new_e->assign.dst = dst;
!   return new_e;
  }
  
  /* Handle PROVIDE.  */
diff -prc src.head/ld/ldfile.c src.new/ld/ldfile.c
*** src.head/ld/ldfile.c	Tue Jun 16 09:08:14 2009
--- src.new/ld/ldfile.c	Tue Aug 18 11:53:38 2009
*************** is_sysrooted_pathname (const char *name,
*** 98,125 ****
  void
  ldfile_add_library_path (const char *name, bfd_boolean cmdline)
  {
!   search_dirs_type *new;
  
    if (!cmdline && config.only_cmd_line_lib_dirs)
      return;
  
!   new = xmalloc (sizeof (search_dirs_type));
!   new->next = NULL;
!   new->cmdline = cmdline;
!   *search_tail_ptr = new;
!   search_tail_ptr = &new->next;
  
    /* If a directory is marked as honoring sysroot, prepend the sysroot path
       now.  */
    if (name[0] == '=')
      {
!       new->name = concat (ld_sysroot, name + 1, (const char *) NULL);
!       new->sysrooted = TRUE;
      }
    else
      {
!       new->name = xstrdup (name);
!       new->sysrooted = is_sysrooted_pathname (name, FALSE);
      }
  }
  
--- 98,125 ----
  void
  ldfile_add_library_path (const char *name, bfd_boolean cmdline)
  {
!   search_dirs_type *new_dirs;
  
    if (!cmdline && config.only_cmd_line_lib_dirs)
      return;
  
!   new_dirs = (search_dirs_type *) xmalloc (sizeof (search_dirs_type));
!   new_dirs->next = NULL;
!   new_dirs->cmdline = cmdline;
!   *search_tail_ptr = new_dirs;
!   search_tail_ptr = &new_dirs->next;
  
    /* If a directory is marked as honoring sysroot, prepend the sysroot path
       now.  */
    if (name[0] == '=')
      {
!       new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL);
!       new_dirs->sysrooted = TRUE;
      }
    else
      {
!       new_dirs->name = xstrdup (name);
!       new_dirs->sysrooted = is_sysrooted_pathname (name, FALSE);
      }
  }
  
*************** void
*** 615,633 ****
  ldfile_add_arch (const char *in_name)
  {
    char *name = xstrdup (in_name);
!   search_arch_type *new = xmalloc (sizeof (search_arch_type));
  
    ldfile_output_machine_name = in_name;
  
!   new->name = name;
!   new->next = NULL;
    while (*name)
      {
        *name = TOLOWER (*name);
        name++;
      }
!   *search_arch_tail_ptr = new;
!   search_arch_tail_ptr = &new->next;
  
  }
  
--- 615,634 ----
  ldfile_add_arch (const char *in_name)
  {
    char *name = xstrdup (in_name);
!   search_arch_type *new_arch = (search_arch_type *)
!       xmalloc (sizeof (search_arch_type));
  
    ldfile_output_machine_name = in_name;
  
!   new_arch->name = name;
!   new_arch->next = NULL;
    while (*name)
      {
        *name = TOLOWER (*name);
        name++;
      }
!   *search_arch_tail_ptr = new_arch;
!   search_arch_tail_ptr = &new_arch->next;
  
  }
  
diff -prc src.head/ld/ldlang.c src.new/ld/ldlang.c
*** src.head/ld/ldlang.c	Fri Aug 14 11:07:08 2009
--- src.new/ld/ldlang.c	Tue Aug 18 11:53:38 2009
*************** new_statement (enum statement_enum type,
*** 949,961 ****
  	       size_t size,
  	       lang_statement_list_type *list)
  {
!   lang_statement_union_type *new;
  
!   new = stat_alloc (size);
!   new->header.type = type;
!   new->header.next = NULL;
!   lang_statement_append (list, new, &new->header.next);
!   return new;
  }
  
  /* Build a new input file node for the language.  There are several
--- 949,961 ----
  	       size_t size,
  	       lang_statement_list_type *list)
  {
!   lang_statement_union_type *new_stmt;
  
!   new_stmt = (lang_statement_union_type *) stat_alloc (size);
!   new_stmt->header.type = type;
!   new_stmt->header.next = NULL;
!   lang_statement_append (list, new_stmt, &new_stmt->header.next);
!   return new_stmt;
  }
  
  /* Build a new input file node for the language.  There are several
*************** new_afile (const char *name,
*** 976,985 ****
    lang_input_statement_type *p;
  
    if (add_to_list)
!     p = new_stat (lang_input_statement, stat_ptr);
    else
      {
!       p = stat_alloc (sizeof (lang_input_statement_type));
        p->header.type = lang_input_statement_enum;
        p->header.next = NULL;
      }
--- 976,986 ----
    lang_input_statement_type *p;
  
    if (add_to_list)
!     p = (lang_input_statement_type *) new_stat (lang_input_statement, stat_ptr);
    else
      {
!       p = (lang_input_statement_type *)
!           stat_alloc (sizeof (lang_input_statement_type));
        p->header.type = lang_input_statement_enum;
        p->header.next = NULL;
      }
*************** lang_memory_region_lookup (const char *c
*** 1220,1226 ****
  {
    lang_memory_region_name *n;
    lang_memory_region_type *r;
!   lang_memory_region_type *new;
  
    /* NAME is NULL for LMA memspecs if no region was specified.  */
    if (name == NULL)
--- 1221,1227 ----
  {
    lang_memory_region_name *n;
    lang_memory_region_type *r;
!   lang_memory_region_type *new_region;
  
    /* NAME is NULL for LMA memspecs if no region was specified.  */
    if (name == NULL)
*************** lang_memory_region_lookup (const char *c
*** 1239,1261 ****
    if (!create && strcmp (name, DEFAULT_MEMORY_REGION))
      einfo (_("%P:%S: warning: memory region `%s' not declared\n"), name);
  
!   new = stat_alloc (sizeof (lang_memory_region_type));
  
!   new->name_list.name = xstrdup (name);
!   new->name_list.next = NULL;
!   new->next = NULL;
!   new->origin = 0;
!   new->length = ~(bfd_size_type) 0;
!   new->current = 0;
!   new->last_os = NULL;
!   new->flags = 0;
!   new->not_flags = 0;
!   new->had_full_message = FALSE;
  
!   *lang_memory_region_list_tail = new;
!   lang_memory_region_list_tail = &new->next;
  
!   return new;
  }
  
  void
--- 1240,1263 ----
    if (!create && strcmp (name, DEFAULT_MEMORY_REGION))
      einfo (_("%P:%S: warning: memory region `%s' not declared\n"), name);
  
!   new_region = (lang_memory_region_type *)
!       stat_alloc (sizeof (lang_memory_region_type));
  
!   new_region->name_list.name = xstrdup (name);
!   new_region->name_list.next = NULL;
!   new_region->next = NULL;
!   new_region->origin = 0;
!   new_region->length = ~(bfd_size_type) 0;
!   new_region->current = 0;
!   new_region->last_os = NULL;
!   new_region->flags = 0;
!   new_region->not_flags = 0;
!   new_region->had_full_message = FALSE;
  
!   *lang_memory_region_list_tail = new_region;
!   lang_memory_region_list_tail = &new_region->next;
  
!   return new_region;
  }
  
  void
*************** init_os (lang_output_section_statement_t
*** 2057,2066 ****
  
    if (!link_info.reduce_memory_overheads)
      {
!       fat_section_userdata_type *new
! 	= stat_alloc (sizeof (fat_section_userdata_type));
!       memset (new, 0, sizeof (fat_section_userdata_type));
!       get_userdata (s->bfd_section) = new;
      }
  
    /* If there is a base address, make sure that any sections it might
--- 2059,2068 ----
  
    if (!link_info.reduce_memory_overheads)
      {
!       fat_section_userdata_type *new_userdata = (fat_section_userdata_type *)
!         stat_alloc (sizeof (fat_section_userdata_type));
!       memset (new_userdata, 0, sizeof (fat_section_userdata_type));
!       get_userdata (s->bfd_section) = new_userdata;
      }
  
    /* If there is a base address, make sure that any sections it might
*************** lang_add_section (lang_statement_list_ty
*** 2196,2202 ****
    if (section->output_section == NULL)
      {
        bfd_boolean first;
!       lang_input_section_type *new;
        flagword flags;
  
        flags = section->flags;
--- 2198,2204 ----
    if (section->output_section == NULL)
      {
        bfd_boolean first;
!       lang_input_section_type *new_section;
        flagword flags;
  
        flags = section->flags;
*************** lang_add_section (lang_statement_list_ty
*** 2244,2252 ****
  	}
  
        /* Add a section reference to the list.  */
!       new = new_stat (lang_input_section, ptr);
  
!       new->section = section;
        section->output_section = output->bfd_section;
  
        /* If final link, don't copy the SEC_LINK_ONCE flags, they've
--- 2246,2254 ----
  	}
  
        /* Add a section reference to the list.  */
!       new_section = new_stat (lang_input_section, ptr);
  
!       new_section->section = section;
        section->output_section = output->bfd_section;
  
        /* If final link, don't copy the SEC_LINK_ONCE flags, they've
*************** typedef struct bfd_sym_chain ldlang_unde
*** 3250,3265 ****
  void
  ldlang_add_undef (const char *const name)
  {
!   ldlang_undef_chain_list_type *new =
!     stat_alloc (sizeof (ldlang_undef_chain_list_type));
  
!   new->next = ldlang_undef_chain_list_head;
!   ldlang_undef_chain_list_head = new;
  
!   new->name = xstrdup (name);
  
    if (link_info.output_bfd != NULL)
!     insert_undefined (new->name);
  }
  
  /* Insert NAME as undefined in the symbol table.  */
--- 3252,3267 ----
  void
  ldlang_add_undef (const char *const name)
  {
!   ldlang_undef_chain_list_type *new_undef = (ldlang_undef_chain_list_type *)
!       stat_alloc (sizeof (ldlang_undef_chain_list_type));
  
!   new_undef->next = ldlang_undef_chain_list_head;
!   ldlang_undef_chain_list_head = new_undef;
  
!   new_undef->name = xstrdup (name);
  
    if (link_info.output_bfd != NULL)
!     insert_undefined (new_undef->name);
  }
  
  /* Insert NAME as undefined in the symbol table.  */
*************** lang_enter_output_section_statement (con
*** 6010,6019 ****
  void
  lang_final (void)
  {
!   lang_output_statement_type *new;
  
-   new = new_stat (lang_output_statement, stat_ptr);
-   new->name = output_filename;
  }
  
  /* Reset the current counters in the regions.  */
--- 6012,6022 ----
  void
  lang_final (void)
  {
!   lang_output_statement_type *new_stmt;
! 
!   new_stmt = new_stat (lang_output_statement, stat_ptr);
!   new_stmt->name = output_filename;
  
  }
  
  /* Reset the current counters in the regions.  */
*************** lang_add_wild (struct wildcard_spec *fil
*** 6377,6383 ****
  	       bfd_boolean keep_sections)
  {
    struct wildcard_list *curr, *next;
!   lang_wild_statement_type *new;
  
    /* Reverse the list as the parser puts it back to front.  */
    for (curr = section_list, section_list = NULL;
--- 6380,6386 ----
  	       bfd_boolean keep_sections)
  {
    struct wildcard_list *curr, *next;
!   lang_wild_statement_type *new_stmt;
  
    /* Reverse the list as the parser puts it back to front.  */
    for (curr = section_list, section_list = NULL;
*************** lang_add_wild (struct wildcard_spec *fil
*** 6399,6416 ****
  	lang_has_input_file = TRUE;
      }
  
!   new = new_stat (lang_wild_statement, stat_ptr);
!   new->filename = NULL;
!   new->filenames_sorted = FALSE;
    if (filespec != NULL)
      {
!       new->filename = filespec->name;
!       new->filenames_sorted = filespec->sorted == by_name;
      }
!   new->section_list = section_list;
!   new->keep_sections = keep_sections;
!   lang_list_init (&new->children);
!   analyze_walk_wild_section_handler (new);
  }
  
  void
--- 6402,6419 ----
  	lang_has_input_file = TRUE;
      }
  
!   new_stmt = new_stat (lang_wild_statement, stat_ptr);
!   new_stmt->filename = NULL;
!   new_stmt->filenames_sorted = FALSE;
    if (filespec != NULL)
      {
!       new_stmt->filename = filespec->name;
!       new_stmt->filenames_sorted = filespec->sorted == by_name;
      }
!   new_stmt->section_list = section_list;
!   new_stmt->keep_sections = keep_sections;
!   lang_list_init (&new_stmt->children);
!   analyze_walk_wild_section_handler (new_stmt);
  }
  
  void
*************** lang_default_entry (const char *name)
*** 6455,6464 ****
  void
  lang_add_target (const char *name)
  {
!   lang_target_statement_type *new;
  
!   new = new_stat (lang_target_statement, stat_ptr);
!   new->target = name;
  }
  
  void
--- 6458,6467 ----
  void
  lang_add_target (const char *name)
  {
!   lang_target_statement_type *new_stmt;
  
!   new_stmt = new_stat (lang_target_statement, stat_ptr);
!   new_stmt->target = name;
  }
  
  void
*************** lang_add_map (const char *name)
*** 6479,6498 ****
  void
  lang_add_fill (fill_type *fill)
  {
!   lang_fill_statement_type *new;
  
!   new = new_stat (lang_fill_statement, stat_ptr);
!   new->fill = fill;
  }
  
  void
  lang_add_data (int type, union etree_union *exp)
  {
!   lang_data_statement_type *new;
  
!   new = new_stat (lang_data_statement, stat_ptr);
!   new->exp = exp;
!   new->type = type;
  }
  
  /* Create a new reloc statement.  RELOC is the BFD relocation type to
--- 6482,6501 ----
  void
  lang_add_fill (fill_type *fill)
  {
!   lang_fill_statement_type *new_stmt;
  
!   new_stmt = new_stat (lang_fill_statement, stat_ptr);
!   new_stmt->fill = fill;
  }
  
  void
  lang_add_data (int type, union etree_union *exp)
  {
!   lang_data_statement_type *new_stmt;
  
!   new_stmt = new_stat (lang_data_statement, stat_ptr);
!   new_stmt->exp = exp;
!   new_stmt->type = type;
  }
  
  /* Create a new reloc statement.  RELOC is the BFD relocation type to
*************** lang_add_reloc (bfd_reloc_code_real_type
*** 6525,6535 ****
  lang_assignment_statement_type *
  lang_add_assignment (etree_type *exp)
  {
!   lang_assignment_statement_type *new;
  
!   new = new_stat (lang_assignment_statement, stat_ptr);
!   new->exp = exp;
!   return new;
  }
  
  void
--- 6528,6538 ----
  lang_assignment_statement_type *
  lang_add_assignment (etree_type *exp)
  {
!   lang_assignment_statement_type *new_stmt;
  
!   new_stmt = new_stat (lang_assignment_statement, stat_ptr);
!   new_stmt->exp = exp;
!   return new_stmt;
  }
  
  void
*************** lang_add_output_format (const char *form
*** 6714,6724 ****
  void
  lang_add_insert (const char *where, int is_before)
  {
!   lang_insert_statement_type *new;
  
!   new = new_stat (lang_insert_statement, stat_ptr);
!   new->where = where;
!   new->is_before = is_before;
    saved_script_handle = previous_script_handle;
  }
  
--- 6717,6727 ----
  void
  lang_add_insert (const char *where, int is_before)
  {
!   lang_insert_statement_type *new_stmt;
  
!   new_stmt = new_stat (lang_insert_statement, stat_ptr);
!   new_stmt->where = where;
!   new_stmt->is_before = is_before;
    saved_script_handle = previous_script_handle;
  }
  
*************** realsymbol (const char *pattern)
*** 7261,7287 ****
      }
  }
  
! /* This is called for each variable name or match expression.  NEW is
     the name of the symbol to match, or, if LITERAL_P is FALSE, a glob
     pattern to be matched against symbol names.  */
  
  struct bfd_elf_version_expr *
  lang_new_vers_pattern (struct bfd_elf_version_expr *orig,
! 		       const char *new,
  		       const char *lang,
  		       bfd_boolean literal_p)
  {
    struct bfd_elf_version_expr *ret;
  
!   ret = xmalloc (sizeof *ret);
    ret->next = orig;
    ret->symver = 0;
    ret->script = 0;
    ret->literal = TRUE;
!   ret->pattern = literal_p ? new : realsymbol (new);
    if (ret->pattern == NULL)
      {
!       ret->pattern = new;
        ret->literal = FALSE;
      }
  
--- 7264,7290 ----
      }
  }
  
! /* This is called for each variable name or match expression.  NEW_NAME is
     the name of the symbol to match, or, if LITERAL_P is FALSE, a glob
     pattern to be matched against symbol names.  */
  
  struct bfd_elf_version_expr *
  lang_new_vers_pattern (struct bfd_elf_version_expr *orig,
! 		       const char *new_name,
  		       const char *lang,
  		       bfd_boolean literal_p)
  {
    struct bfd_elf_version_expr *ret;
  
!   ret = (struct bfd_elf_version_expr *) xmalloc (sizeof *ret);
    ret->next = orig;
    ret->symver = 0;
    ret->script = 0;
    ret->literal = TRUE;
!   ret->pattern = literal_p ? new_name : realsymbol (new_name);
    if (ret->pattern == NULL)
      {
!       ret->pattern = new_name;
        ret->literal = FALSE;
      }
  
diff -prc src.head/opcodes/z8kgen.c src.new/opcodes/z8kgen.c
*** src.head/opcodes/z8kgen.c	Tue Jun 16 09:07:18 2009
--- src.new/opcodes/z8kgen.c	Wed Aug 19 18:28:24 2009
*************** static void
*** 904,917 ****
  internal (void)
  {
    int c = count ();
!   struct op *new = xmalloc (sizeof (struct op) * c);
    struct op *p = opt;
!   memcpy (new, p, c * sizeof (struct op));
  
    /* Sort all names in table alphabetically.  */
!   qsort (new, c, sizeof (struct op), (int (*)(const void *, const void *))func);
  
!   p = new;
    while (p->flags && p->flags[0] != '*')
    {
      /* If there are any @rs, sub the ssss into a ssn0, (rs), (ssn0).  */
--- 904,917 ----
  internal (void)
  {
    int c = count ();
!   struct op *new_op = xmalloc (sizeof (struct op) * c);
    struct op *p = opt;
!   memcpy (new_op, p, c * sizeof (struct op));
  
    /* Sort all names in table alphabetically.  */
!   qsort (new_op, c, sizeof (struct op), (int (*)(const void *, const void *))func);
  
!   p = new_op;
    while (p->flags && p->flags[0] != '*')
    {
      /* If there are any @rs, sub the ssss into a ssn0, (rs), (ssn0).  */
*************** gas (void)
*** 960,971 ****
    struct op *p = opt;
    int idx = -1;
    char *oldname = "";
!   struct op *new = xmalloc (sizeof (struct op) * c);
  
!   memcpy (new, p, c * sizeof (struct op));
  
    /* Sort all names in table alphabetically.  */
!   qsort (new, c, sizeof (struct op), (int (*)(const void *, const void *)) func);
  
    printf ("/* DO NOT EDIT!  -*- buffer-read-only: t -*-\n");
    printf ("   This file is automatically generated by z8kgen.  */\n\n");
--- 960,971 ----
    struct op *p = opt;
    int idx = -1;
    char *oldname = "";
!   struct op *new_op = xmalloc (sizeof (struct op) * c);
  
!   memcpy (new_op, p, c * sizeof (struct op));
  
    /* Sort all names in table alphabetically.  */
!   qsort (new_op, c, sizeof (struct op), (int (*)(const void *, const void *)) func);
  
    printf ("/* DO NOT EDIT!  -*- buffer-read-only: t -*-\n");
    printf ("   This file is automatically generated by z8kgen.  */\n\n");
*************** gas (void)
*** 1279,1297 ****
    printf ("#ifdef DEFINE_TABLE\n");
    printf ("const opcode_entry_type z8k_table[] = {\n");
  
!   while (new->flags && new->flags[0])
      {
        int nargs;
        int length;
  
!       printf ("\n/* %s *** %s */\n", new->bits, new->name);
        printf ("{\n");
  
        printf ("#ifdef NICENAMES\n");
!       printf ("\"%s\",%d,%d,", new->name, new->type, new->cycles);
        {
  	int answer = 0;
! 	char *p = new->flags;
  
  	while (*p)
  	  {
--- 1279,1297 ----
    printf ("#ifdef DEFINE_TABLE\n");
    printf ("const opcode_entry_type z8k_table[] = {\n");
  
!   while (new_op->flags && new_op->flags[0])
      {
        int nargs;
        int length;
  
!       printf ("\n/* %s *** %s */\n", new_op->bits, new_op->name);
        printf ("{\n");
  
        printf ("#ifdef NICENAMES\n");
!       printf ("\"%s\",%d,%d,", new_op->name, new_op->type, new_op->cycles);
        {
  	int answer = 0;
! 	char *p = new_op->flags;
  
  	while (*p)
  	  {
*************** gas (void)
*** 1306,1325 ****
  
        printf ("#endif\n");
  
!       nargs = chewname (&new->name);
  
        printf ("\n\t");
!       chewbits (new->bits, &length);
        length /= 2;
        if (length & 1)
  	abort();
  
!       if (strcmp (oldname, new->name) != 0)
  	idx++;
        printf (",%d,%d,%d", nargs, length, idx);
!       oldname = new->name;
        printf ("},\n");
!       new++;
      }
    printf ("\n/* end marker */\n");
    printf ("{\n#ifdef NICENAMES\nNULL,0,0,\n0,\n#endif\n");
--- 1306,1325 ----
  
        printf ("#endif\n");
  
!       nargs = chewname (&new_op->name);
  
        printf ("\n\t");
!       chewbits (new_op->bits, &length);
        length /= 2;
        if (length & 1)
  	abort();
  
!       if (strcmp (oldname, new_op->name) != 0)
  	idx++;
        printf (",%d,%d,%d", nargs, length, idx);
!       oldname = new_op->name;
        printf ("},\n");
!       new_op++;
      }
    printf ("\n/* end marker */\n");
    printf ("{\n#ifdef NICENAMES\nNULL,0,0,\n0,\n#endif\n");
Only in src.new/sid/component/cfgroot/libltdl: config-h.in]

Attachment: template.changelog
Description: Binary data

diff -prc src.head/bfd/elf32-arm.c src.template/bfd/elf32-arm.c
*** src.head/bfd/elf32-arm.c	Fri Aug 14 10:59:01 2009
--- src.template/bfd/elf32-arm.c	Sun Aug 16 13:42:59 2009
*************** enum elf32_arm_stub_type {
*** 2235,2241 ****
  
  typedef struct
  {
!   const insn_sequence* template;
    int template_size;
  } stub_def;
  
--- 2235,2241 ----
  
  typedef struct
  {
!   const insn_sequence* template_sequence;
    int template_size;
  } stub_def;
  
*************** arm_build_one_stub (struct bfd_hash_entr
*** 3423,3429 ****
    bfd_vma sym_value;
    int template_size;
    int size;
!   const insn_sequence *template;
    int i;
    struct elf32_arm_link_hash_table * globals;
    int stub_reloc_idx[MAXRELOCS] = {-1, -1};
--- 3423,3429 ----
    bfd_vma sym_value;
    int template_size;
    int size;
!   const insn_sequence *template_sequence;
    int i;
    struct elf32_arm_link_hash_table * globals;
    int stub_reloc_idx[MAXRELOCS] = {-1, -1};
*************** arm_build_one_stub (struct bfd_hash_entr
*** 3460,3477 ****
  	       + stub_entry->target_section->output_offset
  	       + stub_entry->target_section->output_section->vma);
  
!   template = stub_entry->stub_template;
    template_size = stub_entry->stub_template_size;
  
    size = 0;
    for (i = 0; i < template_size; i++)
      {
!       switch (template[i].type)
  	{
  	case THUMB16_TYPE:
  	  {
! 	    bfd_vma data = template[i].data;
! 	    if (template[i].reloc_addend != 0)
  	      {
                  /* We've borrowed the reloc_addend field to mean we should
                     insert a condition code into this (Thumb-1 branch)
--- 3460,3477 ----
  	       + stub_entry->target_section->output_offset
  	       + stub_entry->target_section->output_section->vma);
  
!   template_sequence = stub_entry->stub_template;
    template_size = stub_entry->stub_template_size;
  
    size = 0;
    for (i = 0; i < template_size; i++)
      {
!       switch (template_sequence[i].type)
  	{
  	case THUMB16_TYPE:
  	  {
! 	    bfd_vma data = (bfd_vma) template_sequence[i].data;
! 	    if (template_sequence[i].reloc_addend != 0)
  	      {
                  /* We've borrowed the reloc_addend field to mean we should
                     insert a condition code into this (Thumb-1 branch)
*************** arm_build_one_stub (struct bfd_hash_entr
*** 3485,3495 ****
  	  break;
  
  	case THUMB32_TYPE:
!           put_thumb_insn (globals, stub_bfd, (template[i].data >> 16) & 0xffff,
                            loc + size);
!           put_thumb_insn (globals, stub_bfd, template[i].data & 0xffff,
                            loc + size + 2);
!           if (template[i].r_type != R_ARM_NONE)
              {
                stub_reloc_idx[nrelocs] = i;
                stub_reloc_offset[nrelocs++] = size;
--- 3485,3496 ----
  	  break;
  
  	case THUMB32_TYPE:
!           put_thumb_insn (globals, stub_bfd,
!                           (template_sequence[i].data >> 16) & 0xffff,
                            loc + size);
!           put_thumb_insn (globals, stub_bfd, template_sequence[i].data & 0xffff,
                            loc + size + 2);
!           if (template_sequence[i].r_type != R_ARM_NONE)
              {
                stub_reloc_idx[nrelocs] = i;
                stub_reloc_offset[nrelocs++] = size;
*************** arm_build_one_stub (struct bfd_hash_entr
*** 3498,3507 ****
            break;
  
  	case ARM_TYPE:
! 	  put_arm_insn (globals, stub_bfd, template[i].data, loc + size);
  	  /* Handle cases where the target is encoded within the
  	     instruction.  */
! 	  if (template[i].r_type == R_ARM_JUMP24)
  	    {
  	      stub_reloc_idx[nrelocs] = i;
  	      stub_reloc_offset[nrelocs++] = size;
--- 3499,3509 ----
            break;
  
  	case ARM_TYPE:
! 	  put_arm_insn (globals, stub_bfd, template_sequence[i].data,
!                         loc + size);
  	  /* Handle cases where the target is encoded within the
  	     instruction.  */
! 	  if (template_sequence[i].r_type == R_ARM_JUMP24)
  	    {
  	      stub_reloc_idx[nrelocs] = i;
  	      stub_reloc_offset[nrelocs++] = size;
*************** arm_build_one_stub (struct bfd_hash_entr
*** 3510,3516 ****
  	  break;
  
  	case DATA_TYPE:
! 	  bfd_put_32 (stub_bfd, template[i].data, loc + size);
  	  stub_reloc_idx[nrelocs] = i;
  	  stub_reloc_offset[nrelocs++] = size;
  	  size += 4;
--- 3512,3518 ----
  	  break;
  
  	case DATA_TYPE:
! 	  bfd_put_32 (stub_bfd, template_sequence[i].data, loc + size);
  	  stub_reloc_idx[nrelocs] = i;
  	  stub_reloc_offset[nrelocs++] = size;
  	  size += 4;
*************** arm_build_one_stub (struct bfd_hash_entr
*** 3537,3558 ****
    BFD_ASSERT (nrelocs != 0 && nrelocs <= MAXRELOCS);
  
    for (i = 0; i < nrelocs; i++)
!     if (template[stub_reloc_idx[i]].r_type == R_ARM_THM_JUMP24
! 	|| template[stub_reloc_idx[i]].r_type == R_ARM_THM_JUMP19
! 	|| template[stub_reloc_idx[i]].r_type == R_ARM_THM_CALL
! 	|| template[stub_reloc_idx[i]].r_type == R_ARM_THM_XPC22)
        {
  	Elf_Internal_Rela rel;
  	bfd_boolean unresolved_reloc;
  	char *error_message;
  	int sym_flags
! 	  = (template[stub_reloc_idx[i]].r_type != R_ARM_THM_XPC22)
  	    ? STT_ARM_TFUNC : 0;
  	bfd_vma points_to = sym_value + stub_entry->target_addend;
  
  	rel.r_offset = stub_entry->stub_offset + stub_reloc_offset[i];
! 	rel.r_info = ELF32_R_INFO (0, template[stub_reloc_idx[i]].r_type);
! 	rel.r_addend = template[stub_reloc_idx[i]].reloc_addend;
  
  	if (stub_entry->stub_type == arm_stub_a8_veneer_b_cond && i == 0)
  	  /* The first relocation in the elf32_arm_stub_a8_veneer_b_cond[]
--- 3539,3561 ----
    BFD_ASSERT (nrelocs != 0 && nrelocs <= MAXRELOCS);
  
    for (i = 0; i < nrelocs; i++)
!     if (template_sequence[stub_reloc_idx[i]].r_type == R_ARM_THM_JUMP24
! 	|| template_sequence[stub_reloc_idx[i]].r_type == R_ARM_THM_JUMP19
! 	|| template_sequence[stub_reloc_idx[i]].r_type == R_ARM_THM_CALL
! 	|| template_sequence[stub_reloc_idx[i]].r_type == R_ARM_THM_XPC22)
        {
  	Elf_Internal_Rela rel;
  	bfd_boolean unresolved_reloc;
  	char *error_message;
  	int sym_flags
! 	  = (template_sequence[stub_reloc_idx[i]].r_type != R_ARM_THM_XPC22)
  	    ? STT_ARM_TFUNC : 0;
  	bfd_vma points_to = sym_value + stub_entry->target_addend;
  
  	rel.r_offset = stub_entry->stub_offset + stub_reloc_offset[i];
! 	rel.r_info = ELF32_R_INFO (0,
!                                    template_sequence[stub_reloc_idx[i]].r_type);
! 	rel.r_addend = template_sequence[stub_reloc_idx[i]].reloc_addend;
  
  	if (stub_entry->stub_type == arm_stub_a8_veneer_b_cond && i == 0)
  	  /* The first relocation in the elf32_arm_stub_a8_veneer_b_cond[]
*************** arm_build_one_stub (struct bfd_hash_entr
*** 3568,3574 ****
  	   rather than only for certain relocations listed in the enclosing
  	   conditional, for the sake of consistency.  */
  	elf32_arm_final_link_relocate (elf32_arm_howto_from_type
! 	    (template[stub_reloc_idx[i]].r_type),
  	  stub_bfd, info->output_bfd, stub_sec, stub_sec->contents, &rel,
  	  points_to, info, stub_entry->target_section, "", sym_flags,
  	  (struct elf_link_hash_entry *) stub_entry->h, &unresolved_reloc,
--- 3571,3577 ----
  	   rather than only for certain relocations listed in the enclosing
  	   conditional, for the sake of consistency.  */
  	elf32_arm_final_link_relocate (elf32_arm_howto_from_type
! 	    (template_sequence[stub_reloc_idx[i]].r_type),
  	  stub_bfd, info->output_bfd, stub_sec, stub_sec->contents, &rel,
  	  points_to, info, stub_entry->target_section, "", sym_flags,
  	  (struct elf_link_hash_entry *) stub_entry->h, &unresolved_reloc,
*************** arm_build_one_stub (struct bfd_hash_entr
*** 3577,3586 ****
      else
        {
  	_bfd_final_link_relocate (elf32_arm_howto_from_type
! 	    (template[stub_reloc_idx[i]].r_type), stub_bfd, stub_sec,
  	  stub_sec->contents, stub_entry->stub_offset + stub_reloc_offset[i],
  	  sym_value + stub_entry->target_addend,
! 	  template[stub_reloc_idx[i]].reloc_addend);
        }
  
    return TRUE;
--- 3580,3589 ----
      else
        {
  	_bfd_final_link_relocate (elf32_arm_howto_from_type
! 	    (template_sequence[stub_reloc_idx[i]].r_type), stub_bfd, stub_sec,
  	  stub_sec->contents, stub_entry->stub_offset + stub_reloc_offset[i],
  	  sym_value + stub_entry->target_addend,
! 	  template_sequence[stub_reloc_idx[i]].reloc_addend);
        }
  
    return TRUE;
*************** find_stub_size_and_template (enum elf32_
*** 3595,3611 ****
  			     const insn_sequence **stub_template,
  			     int *stub_template_size)
  {
!   const insn_sequence *template = NULL;
    int template_size = 0, i;
    unsigned int size;
  
!   template = stub_definitions[stub_type].template;
    template_size = stub_definitions[stub_type].template_size;
  
    size = 0;
    for (i = 0; i < template_size; i++)
      {
!       switch (template[i].type)
  	{
  	case THUMB16_TYPE:
  	  size += 2;
--- 3598,3614 ----
  			     const insn_sequence **stub_template,
  			     int *stub_template_size)
  {
!   const insn_sequence *template_sequence = NULL;
    int template_size = 0, i;
    unsigned int size;
  
!   template_sequence = stub_definitions[stub_type].template_sequence;
    template_size = stub_definitions[stub_type].template_size;
  
    size = 0;
    for (i = 0; i < template_size; i++)
      {
!       switch (template_sequence[i].type)
  	{
  	case THUMB16_TYPE:
  	  size += 2;
*************** find_stub_size_and_template (enum elf32_
*** 3624,3630 ****
      }
  
    if (stub_template)
!     *stub_template = template;
  
    if (stub_template_size)
      *stub_template_size = template_size;
--- 3627,3633 ----
      }
  
    if (stub_template)
!     *stub_template = template_sequence;
  
    if (stub_template_size)
      *stub_template_size = template_size;
*************** arm_size_one_stub (struct bfd_hash_entry
*** 3641,3647 ****
  {
    struct elf32_arm_stub_hash_entry *stub_entry;
    struct elf32_arm_link_hash_table *htab;
!   const insn_sequence *template;
    int template_size, size;
  
    /* Massage our args to the form they really have.  */
--- 3644,3650 ----
  {
    struct elf32_arm_stub_hash_entry *stub_entry;
    struct elf32_arm_link_hash_table *htab;
!   const insn_sequence *template_sequence;
    int template_size, size;
  
    /* Massage our args to the form they really have.  */
*************** arm_size_one_stub (struct bfd_hash_entry
*** 3651,3661 ****
    BFD_ASSERT((stub_entry->stub_type > arm_stub_none)
  	     && stub_entry->stub_type < ARRAY_SIZE(stub_definitions));
  
!   size = find_stub_size_and_template (stub_entry->stub_type, &template,
  				      &template_size);
  
    stub_entry->stub_size = size;
!   stub_entry->stub_template = template;
    stub_entry->stub_template_size = template_size;
  
    size = (size + 7) & ~7;
--- 3654,3664 ----
    BFD_ASSERT((stub_entry->stub_type > arm_stub_none)
  	     && stub_entry->stub_type < ARRAY_SIZE(stub_definitions));
  
!   size = find_stub_size_and_template (stub_entry->stub_type, &template_sequence,
  				      &template_size);
  
    stub_entry->stub_size = size;
!   stub_entry->stub_template = template_sequence;
    stub_entry->stub_template_size = template_size;
  
    size = (size + 7) & ~7;
*************** elf32_arm_size_stubs (bfd *output_bfd,
*** 4659,4665 ****
            unsigned int section_id = a8_fixes[i].section->id;
            asection *link_sec = htab->stub_group[section_id].link_sec;
            asection *stub_sec = htab->stub_group[section_id].stub_sec;
!           const insn_sequence *template;
            int template_size, size = 0;
  
            stub_entry = arm_stub_hash_lookup (&htab->stub_hash_table, stub_name,
--- 4662,4668 ----
            unsigned int section_id = a8_fixes[i].section->id;
            asection *link_sec = htab->stub_group[section_id].link_sec;
            asection *stub_sec = htab->stub_group[section_id].stub_sec;
!           const insn_sequence *template_sequence;
            int template_size, size = 0;
  
            stub_entry = arm_stub_hash_lookup (&htab->stub_hash_table, stub_name,
*************** elf32_arm_size_stubs (bfd *output_bfd,
*** 4682,4692 ****
            stub_entry->orig_insn = a8_fixes[i].orig_insn;
            stub_entry->st_type = STT_ARM_TFUNC;
  
!           size = find_stub_size_and_template (a8_fixes[i].stub_type, &template,
                                                &template_size);
  
            stub_entry->stub_size = size;
!           stub_entry->stub_template = template;
            stub_entry->stub_template_size = template_size;
          }
  
--- 4685,4696 ----
            stub_entry->orig_insn = a8_fixes[i].orig_insn;
            stub_entry->st_type = STT_ARM_TFUNC;
  
!           size = find_stub_size_and_template (a8_fixes[i].stub_type,
!                                               &template_sequence,
                                                &template_size);
  
            stub_entry->stub_size = size;
!           stub_entry->stub_template = template_sequence;
            stub_entry->stub_template_size = template_size;
          }
  
*************** arm_map_one_stub (struct bfd_hash_entry 
*** 12940,12946 ****
    bfd_vma addr;
    char *stub_name;
    output_arch_syminfo *osi;
!   const insn_sequence *template;
    enum stub_insn_type prev_type;
    int size;
    int i;
--- 12944,12950 ----
    bfd_vma addr;
    char *stub_name;
    output_arch_syminfo *osi;
!   const insn_sequence *template_sequence;
    enum stub_insn_type prev_type;
    int size;
    int i;
*************** arm_map_one_stub (struct bfd_hash_entry 
*** 12963,12970 ****
    addr = (bfd_vma) stub_entry->stub_offset;
    stub_name = stub_entry->output_name;
  
!   template = stub_entry->stub_template;
!   switch (template[0].type)
      {
      case ARM_TYPE:
        if (!elf32_arm_output_stub_sym (osi, stub_name, addr, stub_entry->stub_size))
--- 12967,12974 ----
    addr = (bfd_vma) stub_entry->stub_offset;
    stub_name = stub_entry->output_name;
  
!   template_sequence = stub_entry->stub_template;
!   switch (template_sequence[0].type)
      {
      case ARM_TYPE:
        if (!elf32_arm_output_stub_sym (osi, stub_name, addr, stub_entry->stub_size))
*************** arm_map_one_stub (struct bfd_hash_entry 
*** 12985,12991 ****
    size = 0;
    for (i = 0; i < stub_entry->stub_template_size; i++)
      {
!       switch (template[i].type)
  	{
  	case ARM_TYPE:
  	  sym_type = ARM_MAP_ARM;
--- 12989,12995 ----
    size = 0;
    for (i = 0; i < stub_entry->stub_template_size; i++)
      {
!       switch (template_sequence[i].type)
  	{
  	case ARM_TYPE:
  	  sym_type = ARM_MAP_ARM;
*************** arm_map_one_stub (struct bfd_hash_entry 
*** 13005,13018 ****
  	  return FALSE;
  	}
  
!       if (template[i].type != prev_type)
  	{
! 	  prev_type = template[i].type;
  	  if (!elf32_arm_output_map_sym (osi, sym_type, addr + size))
  	    return FALSE;
  	}
  
!       switch (template[i].type)
  	{
  	case ARM_TYPE:
  	case THUMB32_TYPE:
--- 13009,13022 ----
  	  return FALSE;
  	}
  
!       if (template_sequence[i].type != prev_type)
  	{
! 	  prev_type = template_sequence[i].type;
  	  if (!elf32_arm_output_map_sym (osi, sym_type, addr + size))
  	    return FALSE;
  	}
  
!       switch (template_sequence[i].type)
  	{
  	case ARM_TYPE:
  	case THUMB32_TYPE:
Only in src.template/bfd: elf32-arm.c.orig
diff -prc src.head/bfd/elfxx-ia64.c src.template/bfd/elfxx-ia64.c
*** src.head/bfd/elfxx-ia64.c	Fri Aug 14 10:59:06 2009
--- src.template/bfd/elfxx-ia64.c	Wed Aug 19 09:16:03 2009
*************** bfd_elfNN_ia64_after_parse (int itanium)
*** 612,618 ****
  static bfd_boolean
  elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off)
  {
!   unsigned int template, mlx;
    bfd_vma t0, t1, s0, s1, s2, br_code;
    long br_slot;
    bfd_byte *hit_addr;
--- 612,618 ----
  static bfd_boolean
  elfNN_ia64_relax_br (bfd_byte *contents, bfd_vma off)
  {
!   unsigned int template_val, mlx;
    bfd_vma t0, t1, s0, s1, s2, br_code;
    long br_slot;
    bfd_byte *hit_addr;
*************** elfNN_ia64_relax_br (bfd_byte *contents,
*** 626,632 ****
    /* Check if we can turn br into brl.  A label is always at the start
       of the bundle.  Even if there are predicates on NOPs, we still
       perform this optimization.  */
!   template = t0 & 0x1e;
    s0 = (t0 >> 5) & 0x1ffffffffffLL;
    s1 = ((t0 >> 46) | (t1 << 18)) & 0x1ffffffffffLL;
    s2 = (t1 >> 23) & 0x1ffffffffffLL;
--- 626,632 ----
    /* Check if we can turn br into brl.  A label is always at the start
       of the bundle.  Even if there are predicates on NOPs, we still
       perform this optimization.  */
!   template_val = t0 & 0x1e;
    s0 = (t0 >> 5) & 0x1ffffffffffLL;
    s1 = ((t0 >> 46) | (t1 << 18)) & 0x1ffffffffffLL;
    s2 = (t1 >> 23) & 0x1ffffffffffLL;
*************** elfNN_ia64_relax_br (bfd_byte *contents,
*** 642,650 ****
      case 1:
        /* Check if slot 2 is NOP. Possible templates are MBB and BBB.
  	 For BBB, slot 0 also has to be nop.b.  */
!       if (!((template == 0x12				/* MBB */
  	     && IS_NOP_B (s2))
! 	    || (template == 0x16			/* BBB */
  		&& IS_NOP_B (s0)
  		&& IS_NOP_B (s2))))
  	return FALSE;
--- 642,650 ----
      case 1:
        /* Check if slot 2 is NOP. Possible templates are MBB and BBB.
  	 For BBB, slot 0 also has to be nop.b.  */
!       if (!((template_val == 0x12				/* MBB */
  	     && IS_NOP_B (s2))
! 	    || (template_val == 0x16			/* BBB */
  		&& IS_NOP_B (s0)
  		&& IS_NOP_B (s2))))
  	return FALSE;
*************** elfNN_ia64_relax_br (bfd_byte *contents,
*** 653,668 ****
      case 2:
        /* Check if slot 1 is NOP. Possible templates are MIB, MBB, BBB,
  	 MMB and MFB. For BBB, slot 0 also has to be nop.b.  */
!       if (!((template == 0x10				/* MIB */
  	     && IS_NOP_I (s1))
! 	    || (template == 0x12			/* MBB */
  		&& IS_NOP_B (s1))
! 	    || (template == 0x16			/* BBB */
  		&& IS_NOP_B (s0)
  		&& IS_NOP_B (s1))
! 	    || (template == 0x18			/* MMB */
  		&& IS_NOP_M (s1))
! 	    || (template == 0x1c			/* MFB */
  		&& IS_NOP_F (s1))))
  	return FALSE;
        br_code = s2;
--- 653,668 ----
      case 2:
        /* Check if slot 1 is NOP. Possible templates are MIB, MBB, BBB,
  	 MMB and MFB. For BBB, slot 0 also has to be nop.b.  */
!       if (!((template_val == 0x10				/* MIB */
  	     && IS_NOP_I (s1))
! 	    || (template_val == 0x12			/* MBB */
  		&& IS_NOP_B (s1))
! 	    || (template_val == 0x16			/* BBB */
  		&& IS_NOP_B (s0)
  		&& IS_NOP_B (s1))
! 	    || (template_val == 0x18			/* MMB */
  		&& IS_NOP_M (s1))
! 	    || (template_val == 0x1c			/* MFB */
  		&& IS_NOP_F (s1))))
  	return FALSE;
        br_code = s2;
*************** elfNN_ia64_relax_br (bfd_byte *contents,
*** 686,692 ****
    else
      mlx = 0x4;
  
!   if (template == 0x16)
      {
        /* For BBB, we need to put nop.m in slot 0.  We keep the original
  	 predicate only if slot 0 isn't br.  */
--- 686,692 ----
    else
      mlx = 0x4;
  
!   if (template_val == 0x16)
      {
        /* For BBB, we need to put nop.m in slot 0.  We keep the original
  	 predicate only if slot 0 isn't br.  */
*************** elfNN_ia64_relax_br (bfd_byte *contents,
*** 715,721 ****
  static void
  elfNN_ia64_relax_brl (bfd_byte *contents, bfd_vma off)
  {
!   int template;
    bfd_byte *hit_addr;
    bfd_vma t0, t1, i0, i1, i2;
  
--- 715,721 ----
  static void
  elfNN_ia64_relax_brl (bfd_byte *contents, bfd_vma off)
  {
!   int template_val;
    bfd_byte *hit_addr;
    bfd_vma t0, t1, i0, i1, i2;
  
*************** elfNN_ia64_relax_brl (bfd_byte *contents
*** 734,743 ****
    /* Turn a MLX bundle into a MBB bundle with the same stop-bit
       variety.  */
    if (t0 & 0x1)
!     template = 0x13;
    else
!     template = 0x12;
!   t0 = (i1 << 46) | (i0 << 5) | template;
    t1 = (i2 << 23) | (i1 >> 18);
  
    bfd_putl64 (t0, hit_addr);
--- 734,743 ----
    /* Turn a MLX bundle into a MBB bundle with the same stop-bit
       variety.  */
    if (t0 & 0x1)
!     template_val = 0x13;
    else
!     template_val = 0x12;
!   t0 = (i1 << 46) | (i0 << 5) | template_val;
    t1 = (i2 << 23) | (i1 >> 18);
  
    bfd_putl64 (t0, hit_addr);
Only in src.head: cvs.diff
diff -prc src.head/gas/config/tc-arm.c src.template/gas/config/tc-arm.c
*** src.head/gas/config/tc-arm.c	Fri Aug 14 10:59:49 2009
--- src.template/gas/config/tc-arm.c	Sun Aug 16 13:45:35 2009
*************** LITTLENUM_TYPE fp_values[NUM_FLOAT_VALS]
*** 415,421 ****
  
  struct asm_cond
  {
!   const char *	 template;
    unsigned long  value;
  };
  
--- 415,421 ----
  
  struct asm_cond
  {
!   const char *	 template_name;
    unsigned long  value;
  };
  
*************** struct asm_cond
*** 423,435 ****
  
  struct asm_psr
  {
!   const char *   template;
    unsigned long  field;
  };
  
  struct asm_barrier_opt
  {
!   const char *   template;
    unsigned long  value;
  };
  
--- 423,435 ----
  
  struct asm_psr
  {
!   const char *   template_name;
    unsigned long  field;
  };
  
  struct asm_barrier_opt
  {
!   const char *   template_name;
    unsigned long  value;
  };
  
*************** const char * const reg_expected_msgs[] =
*** 548,554 ****
  struct asm_opcode
  {
    /* Basic string to match.  */
!   const char * template;
  
    /* Parameters to instruction.	 */
    unsigned char operands[8];
--- 548,554 ----
  struct asm_opcode
  {
    /* Basic string to match.  */
!   const char * template_name;
  
    /* Parameters to instruction.	 */
    unsigned char operands[8];
*************** md_begin (void)
*** 21296,21316 ****
      as_fatal (_("virtual memory exhausted"));
  
    for (i = 0; i < sizeof (insns) / sizeof (struct asm_opcode); i++)
!     hash_insert (arm_ops_hsh, insns[i].template, (void *) (insns + i));
    for (i = 0; i < sizeof (conds) / sizeof (struct asm_cond); i++)
!     hash_insert (arm_cond_hsh, conds[i].template, (void *) (conds + i));
    for (i = 0; i < sizeof (shift_names) / sizeof (struct asm_shift_name); i++)
      hash_insert (arm_shift_hsh, shift_names[i].name, (void *) (shift_names + i));
    for (i = 0; i < sizeof (psrs) / sizeof (struct asm_psr); i++)
!     hash_insert (arm_psr_hsh, psrs[i].template, (void *) (psrs + i));
    for (i = 0; i < sizeof (v7m_psrs) / sizeof (struct asm_psr); i++)
!     hash_insert (arm_v7m_psr_hsh, v7m_psrs[i].template, (void *) (v7m_psrs + i));
    for (i = 0; i < sizeof (reg_names) / sizeof (struct reg_entry); i++)
      hash_insert (arm_reg_hsh, reg_names[i].name, (void *) (reg_names + i));
    for (i = 0;
         i < sizeof (barrier_opt_names) / sizeof (struct asm_barrier_opt);
         i++)
!     hash_insert (arm_barrier_opt_hsh, barrier_opt_names[i].template,
  		 (void *) (barrier_opt_names + i));
  #ifdef OBJ_ELF
    for (i = 0; i < sizeof (reloc_names) / sizeof (struct reloc_entry); i++)
--- 21296,21317 ----
      as_fatal (_("virtual memory exhausted"));
  
    for (i = 0; i < sizeof (insns) / sizeof (struct asm_opcode); i++)
!     hash_insert (arm_ops_hsh, insns[i].template_name, (void *) (insns + i));
    for (i = 0; i < sizeof (conds) / sizeof (struct asm_cond); i++)
!     hash_insert (arm_cond_hsh, conds[i].template_name, (void *) (conds + i));
    for (i = 0; i < sizeof (shift_names) / sizeof (struct asm_shift_name); i++)
      hash_insert (arm_shift_hsh, shift_names[i].name, (void *) (shift_names + i));
    for (i = 0; i < sizeof (psrs) / sizeof (struct asm_psr); i++)
!     hash_insert (arm_psr_hsh, psrs[i].template_name, (void *) (psrs + i));
    for (i = 0; i < sizeof (v7m_psrs) / sizeof (struct asm_psr); i++)
!     hash_insert (arm_v7m_psr_hsh, v7m_psrs[i].template_name,
!                  (void *) (v7m_psrs + i));
    for (i = 0; i < sizeof (reg_names) / sizeof (struct reg_entry); i++)
      hash_insert (arm_reg_hsh, reg_names[i].name, (void *) (reg_names + i));
    for (i = 0;
         i < sizeof (barrier_opt_names) / sizeof (struct asm_barrier_opt);
         i++)
!     hash_insert (arm_barrier_opt_hsh, barrier_opt_names[i].template_name,
  		 (void *) (barrier_opt_names + i));
  #ifdef OBJ_ELF
    for (i = 0; i < sizeof (reloc_names) / sizeof (struct reloc_entry); i++)
diff -prc src.head/gas/config/tc-i386.c src.template/gas/config/tc-i386.c
*** src.head/gas/config/tc-i386.c	Fri Aug 14 10:59:51 2009
--- src.template/gas/config/tc-i386.c	Sun Aug 16 12:50:21 2009
***************
*** 97,104 ****
    */
  typedef struct
  {
!   const template *start;
!   const template *end;
  }
  templates;
  
--- 97,104 ----
    */
  typedef struct
  {
!   const insn_template *start;
!   const insn_template *end;
  }
  templates;
  
*************** static void swap_operands (void);
*** 159,165 ****
  static void swap_2_operands (int, int);
  static void optimize_imm (void);
  static void optimize_disp (void);
! static const template *match_template (void);
  static int check_string (void);
  static int process_suffix (void);
  static int check_byte_reg (void);
--- 159,165 ----
  static void swap_2_operands (int, int);
  static void optimize_imm (void);
  static void optimize_disp (void);
! static const insn_template *match_template (void);
  static int check_string (void);
  static int process_suffix (void);
  static int check_byte_reg (void);
*************** union i386_op
*** 204,210 ****
  struct _i386_insn
    {
      /* TM holds the template for the insn were currently assembling.  */
!     template tm;
  
      /* SUFFIX holds the instruction size suffix for byte, word, dword
         or qword, if given.  */
--- 204,210 ----
  struct _i386_insn
    {
      /* TM holds the template for the insn were currently assembling.  */
!     insn_template tm;
  
      /* SUFFIX holds the instruction size suffix for byte, word, dword
         or qword, if given.  */
*************** cpu_flags_and_not (i386_cpu_flags x, i38
*** 1285,1291 ****
  /* Return CPU flags match bits. */
  
  static int
! cpu_flags_match (const template *t)
  {
    i386_cpu_flags x = t->cpu_flags;
    int match = cpu_flags_check_cpu64 (x) ? CPU_FLAGS_64BIT_MATCH : 0;
--- 1285,1291 ----
  /* Return CPU flags match bits. */
  
  static int
! cpu_flags_match (const insn_template *t)
  {
    i386_cpu_flags x = t->cpu_flags;
    int match = cpu_flags_check_cpu64 (x) ? CPU_FLAGS_64BIT_MATCH : 0;
*************** operand_type_check (i386_operand_type t,
*** 1469,1475 ****
     operand J for instruction template T.  */
  
  static INLINE int
! match_reg_size (const template *t, unsigned int j)
  {
    return !((i.types[j].bitfield.byte
  	    && !t->operand_types[j].bitfield.byte)
--- 1469,1475 ----
     operand J for instruction template T.  */
  
  static INLINE int
! match_reg_size (const insn_template *t, unsigned int j)
  {
    return !((i.types[j].bitfield.byte
  	    && !t->operand_types[j].bitfield.byte)
*************** match_reg_size (const template *t, unsig
*** 1485,1491 ****
     instruction template T.  */
  
  static INLINE int
! match_mem_size (const template *t, unsigned int j)
  {
    return (match_reg_size (t, j)
  	  && !((i.types[j].bitfield.unspecified
--- 1485,1491 ----
     instruction template T.  */
  
  static INLINE int
! match_mem_size (const insn_template *t, unsigned int j)
  {
    return (match_reg_size (t, j)
  	  && !((i.types[j].bitfield.unspecified
*************** match_mem_size (const template *t, unsig
*** 1504,1510 ****
     instruction template T.  */
  
  static INLINE int
! operand_size_match (const template *t)
  {
    unsigned int j;
    int match = 1;
--- 1504,1510 ----
     instruction template T.  */
  
  static INLINE int
! operand_size_match (const insn_template *t)
  {
    unsigned int j;
    int match = 1;
*************** md_begin ()
*** 2125,2131 ****
    op_hash = hash_new ();
  
    {
!     const template *optab;
      templates *core_optab;
  
      /* Setup for loop.  */
--- 2125,2131 ----
    op_hash = hash_new ();
  
    {
!     const insn_template *optab;
      templates *core_optab;
  
      /* Setup for loop.  */
*************** i386_print_statistics (FILE *file)
*** 2260,2266 ****
  #ifdef DEBUG386
  
  /* Debugging routines for md_assemble.  */
! static void pte (template *);
  static void pt (i386_operand_type);
  static void pe (expressionS *);
  static void ps (symbolS *);
--- 2260,2266 ----
  #ifdef DEBUG386
  
  /* Debugging routines for md_assemble.  */
! static void pte (insn_template *);
  static void pt (i386_operand_type);
  static void pe (expressionS *);
  static void ps (symbolS *);
*************** pi (char *line, i386_insn *x)
*** 2311,2317 ****
  }
  
  static void
! pte (template *t)
  {
    unsigned int i;
    fprintf (stdout, " %d operands ", t->operands);
--- 2311,2317 ----
  }
  
  static void
! pte (insn_template *t)
  {
    unsigned int i;
    fprintf (stdout, " %d operands ", t->operands);
*************** intel_float_operand (const char *mnemoni
*** 2626,2632 ****
  /* Build the VEX prefix.  */
  
  static void
! build_vex_prefix (const template *t)
  {
    unsigned int register_specifier;
    unsigned int implied_prefix;
--- 2626,2632 ----
  /* Build the VEX prefix.  */
  
  static void
! build_vex_prefix (const insn_template *t)
  {
    unsigned int register_specifier;
    unsigned int implied_prefix;
*************** md_assemble (char *line)
*** 2802,2808 ****
  {
    unsigned int j;
    char mnemonic[MAX_MNEM_SIZE];
!   const template *t;
  
    /* Initialize globals.  */
    memset (&i, '\0', sizeof (i));
--- 2802,2808 ----
  {
    unsigned int j;
    char mnemonic[MAX_MNEM_SIZE];
!   const insn_template *t;
  
    /* Initialize globals.  */
    memset (&i, '\0', sizeof (i));
*************** parse_insn (char *line, char *mnemonic)
*** 3023,3029 ****
    char *token_start = l;
    char *mnem_p;
    int supported;
!   const template *t;
    char *dot_p = NULL;
  
    /* Non-zero if we found a prefix only acceptable with string insns.  */
--- 3023,3029 ----
    char *token_start = l;
    char *mnem_p;
    int supported;
!   const insn_template *t;
    char *dot_p = NULL;
  
    /* Non-zero if we found a prefix only acceptable with string insns.  */
*************** parse_insn (char *line, char *mnemonic)
*** 3064,3070 ****
  	}
  
        /* Look up instruction (or prefix) via hash table.  */
!       current_templates = hash_find (op_hash, mnemonic);
  
        if (*l != END_OF_INSN
  	  && (!is_space_char (*l) || l[1] != END_OF_INSN)
--- 3064,3070 ----
  	}
  
        /* Look up instruction (or prefix) via hash table.  */
!       current_templates = (const templates *) hash_find (op_hash, mnemonic);
  
        if (*l != END_OF_INSN
  	  && (!is_space_char (*l) || l[1] != END_OF_INSN)
*************** parse_insn (char *line, char *mnemonic)
*** 3116,3122 ****
  	goto check_suffix;
        mnem_p = dot_p;
        *dot_p = '\0';
!       current_templates = hash_find (op_hash, mnemonic);
      }
  
    if (!current_templates)
--- 3116,3122 ----
  	goto check_suffix;
        mnem_p = dot_p;
        *dot_p = '\0';
!       current_templates = (const templates *) hash_find (op_hash, mnemonic);
      }
  
    if (!current_templates)
*************** check_suffix:
*** 3133,3139 ****
  	case QWORD_MNEM_SUFFIX:
  	  i.suffix = mnem_p[-1];
  	  mnem_p[-1] = '\0';
! 	  current_templates = hash_find (op_hash, mnemonic);
  	  break;
  	case SHORT_MNEM_SUFFIX:
  	case LONG_MNEM_SUFFIX:
--- 3133,3140 ----
  	case QWORD_MNEM_SUFFIX:
  	  i.suffix = mnem_p[-1];
  	  mnem_p[-1] = '\0';
! 	  current_templates = (const templates *) hash_find (op_hash,
!                                                              mnemonic);
  	  break;
  	case SHORT_MNEM_SUFFIX:
  	case LONG_MNEM_SUFFIX:
*************** check_suffix:
*** 3141,3147 ****
  	    {
  	      i.suffix = mnem_p[-1];
  	      mnem_p[-1] = '\0';
! 	      current_templates = hash_find (op_hash, mnemonic);
  	    }
  	  break;
  
--- 3142,3149 ----
  	    {
  	      i.suffix = mnem_p[-1];
  	      mnem_p[-1] = '\0';
! 	      current_templates = (const templates *) hash_find (op_hash,
!                                                                  mnemonic);
  	    }
  	  break;
  
*************** check_suffix:
*** 3154,3160 ****
  	      else
  		i.suffix = LONG_MNEM_SUFFIX;
  	      mnem_p[-1] = '\0';
! 	      current_templates = hash_find (op_hash, mnemonic);
  	    }
  	  break;
  	}
--- 3156,3163 ----
  	      else
  		i.suffix = LONG_MNEM_SUFFIX;
  	      mnem_p[-1] = '\0';
! 	      current_templates = (const templates *) hash_find (op_hash,
!                                                                  mnemonic);
  	    }
  	  break;
  	}
*************** optimize_imm (void)
*** 3527,3533 ****
  	       than those matching the insn suffix.  */
  	    {
  	      i386_operand_type mask, allowed;
! 	      const template *t;
  
  	      operand_type_set (&mask, 0);
  	      operand_type_set (&allowed, 0);
--- 3530,3536 ----
  	       than those matching the insn suffix.  */
  	    {
  	      i386_operand_type mask, allowed;
! 	      const insn_template *t;
  
  	      operand_type_set (&mask, 0);
  	      operand_type_set (&allowed, 0);
*************** optimize_disp (void)
*** 3639,3649 ****
        }
  }
  
! static const template *
  match_template (void)
  {
    /* Points to template once we've found it.  */
!   const template *t;
    i386_operand_type overlap0, overlap1, overlap2, overlap3;
    i386_operand_type overlap4;
    unsigned int found_reverse_match;
--- 3642,3652 ----
        }
  }
  
! static const insn_template *
  match_template (void)
  {
    /* Points to template once we've found it.  */
!   const insn_template *t;
    i386_operand_type overlap0, overlap1, overlap2, overlap3;
    i386_operand_type overlap4;
    unsigned int found_reverse_match;
Only in src.template/gas/config: tc-i386.c.orig
diff -prc src.head/gas/config/tc-ia64.c src.template/gas/config/tc-ia64.c
*** src.head/gas/config/tc-ia64.c	Fri Aug 14 10:59:51 2009
--- src.template/gas/config/tc-ia64.c	Sun Aug 16 12:50:21 2009
*************** dot_endp (int dummy ATTRIBUTE_UNUSED)
*** 4421,4429 ****
  }
  
  static void
! dot_template (int template)
  {
!   CURR_SLOT.user_template = template;
  }
  
  static void
--- 4421,4429 ----
  }
  
  static void
! dot_template (int template_val)
  {
!   CURR_SLOT.user_template = template_val;
  }
  
  static void
*************** emit_one_bundle (void)
*** 6318,6324 ****
    int manual_bundling_off = 0, manual_bundling = 0;
    enum ia64_unit required_unit, insn_unit = 0;
    enum ia64_insn_type type[3], insn_type;
!   unsigned int template, orig_template;
    bfd_vma insn[3] = { -1, -1, -1 };
    struct ia64_opcode *idesc;
    int end_of_insn_group = 0, user_template = -1;
--- 6318,6324 ----
    int manual_bundling_off = 0, manual_bundling = 0;
    enum ia64_unit required_unit, insn_unit = 0;
    enum ia64_insn_type type[3], insn_type;
!   unsigned int template_val, orig_template;
    bfd_vma insn[3] = { -1, -1, -1 };
    struct ia64_opcode *idesc;
    int end_of_insn_group = 0, user_template = -1;
*************** emit_one_bundle (void)
*** 6340,6346 ****
       otherwise:  */
  
    if (md.slot[first].user_template >= 0)
!     user_template = template = md.slot[first].user_template;
    else
      {
        /* Auto select appropriate template.  */
--- 6340,6346 ----
       otherwise:  */
  
    if (md.slot[first].user_template >= 0)
!     user_template = template_val = md.slot[first].user_template;
    else
      {
        /* Auto select appropriate template.  */
*************** emit_one_bundle (void)
*** 6353,6364 ****
  	  type[i] = md.slot[curr].idesc->type;
  	  curr = (curr + 1) % NUM_SLOTS;
  	}
!       template = best_template[type[0]][type[1]][type[2]];
      }
  
    /* initialize instructions with appropriate nops:  */
    for (i = 0; i < 3; ++i)
!     insn[i] = nop[ia64_templ_desc[template].exec_unit[i]];
  
    f = frag_more (16);
  
--- 6353,6364 ----
  	  type[i] = md.slot[curr].idesc->type;
  	  curr = (curr + 1) % NUM_SLOTS;
  	}
!       template_val = best_template[type[0]][type[1]][type[2]];
      }
  
    /* initialize instructions with appropriate nops:  */
    for (i = 0; i < 3; ++i)
!     insn[i] = nop[ia64_templ_desc[template_val].exec_unit[i]];
  
    f = frag_more (16);
  
*************** emit_one_bundle (void)
*** 6452,6458 ****
  	     MBB, BBB, MMB, and MFB.  We don't handle anything other
  	     than M and B slots because these are the only kind of
  	     instructions that can have the IA64_OPCODE_LAST bit set.  */
! 	  required_template = template;
  	  switch (idesc->type)
  	    {
  	    case IA64_TYPE_M:
--- 6452,6458 ----
  	     MBB, BBB, MMB, and MFB.  We don't handle anything other
  	     than M and B slots because these are the only kind of
  	     instructions that can have the IA64_OPCODE_LAST bit set.  */
! 	  required_template = template_val;
  	  switch (idesc->type)
  	    {
  	    case IA64_TYPE_M:
*************** emit_one_bundle (void)
*** 6476,6482 ****
  		  || (required_slot == 2 && !manual_bundling_off)
  		  || (user_template >= 0
  		      /* Changing from MMI to M;MI is OK.  */
! 		      && (template ^ required_template) > 1)))
  	    {
  	      as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
  			    _("`%s' must be last in instruction group"),
--- 6476,6482 ----
  		  || (required_slot == 2 && !manual_bundling_off)
  		  || (user_template >= 0
  		      /* Changing from MMI to M;MI is OK.  */
! 		      && (template_val ^ required_template) > 1)))
  	    {
  	      as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
  			    _("`%s' must be last in instruction group"),
*************** emit_one_bundle (void)
*** 6489,6495 ****
  	    break;
  
  	  i = required_slot;
! 	  if (required_template != template)
  	    {
  	      /* If we switch the template, we need to reset the NOPs
  	         after slot i.  The slot-types of the instructions ahead
--- 6489,6495 ----
  	    break;
  
  	  i = required_slot;
! 	  if (required_template != template_val)
  	    {
  	      /* If we switch the template, we need to reset the NOPs
  	         after slot i.  The slot-types of the instructions ahead
*************** emit_one_bundle (void)
*** 6502,6508 ****
  		 middle, so we don't need another one emitted later.  */
  	      md.slot[curr].end_of_insn_group = 0;
  	    }
! 	  template = required_template;
  	}
        if (curr != first && md.slot[curr].label_fixups)
  	{
--- 6502,6508 ----
  		 middle, so we don't need another one emitted later.  */
  	      md.slot[curr].end_of_insn_group = 0;
  	    }
! 	  template_val = required_template;
  	}
        if (curr != first && md.slot[curr].label_fixups)
  	{
*************** emit_one_bundle (void)
*** 6522,6539 ****
  	     bundle.  See if we can switch to an other template with
  	     an appropriate boundary.  */
  
! 	  orig_template = template;
  	  if (i == 1 && (user_template == 4
  			 || (user_template < 0
! 			     && (ia64_templ_desc[template].exec_unit[0]
  				 == IA64_UNIT_M))))
  	    {
! 	      template = 5;
  	      end_of_insn_group = 0;
  	    }
  	  else if (i == 2 && (user_template == 0
  			      || (user_template < 0
! 				  && (ia64_templ_desc[template].exec_unit[1]
  				      == IA64_UNIT_I)))
  		   /* This test makes sure we don't switch the template if
  		      the next instruction is one that needs to be first in
--- 6522,6539 ----
  	     bundle.  See if we can switch to an other template with
  	     an appropriate boundary.  */
  
! 	  orig_template = template_val;
  	  if (i == 1 && (user_template == 4
  			 || (user_template < 0
! 			     && (ia64_templ_desc[template_val].exec_unit[0]
  				 == IA64_UNIT_M))))
  	    {
! 	      template_val = 5;
  	      end_of_insn_group = 0;
  	    }
  	  else if (i == 2 && (user_template == 0
  			      || (user_template < 0
! 				  && (ia64_templ_desc[template_val].exec_unit[1]
  				      == IA64_UNIT_I)))
  		   /* This test makes sure we don't switch the template if
  		      the next instruction is one that needs to be first in
*************** emit_one_bundle (void)
*** 6546,6552 ****
  		      first in the group! --davidm 99/12/16  */
  		   && (idesc->flags & IA64_OPCODE_FIRST) == 0)
  	    {
! 	      template = 1;
  	      end_of_insn_group = 0;
  	    }
  	  else if (i == 1
--- 6546,6552 ----
  		      first in the group! --davidm 99/12/16  */
  		   && (idesc->flags & IA64_OPCODE_FIRST) == 0)
  	    {
! 	      template_val = 1;
  	      end_of_insn_group = 0;
  	    }
  	  else if (i == 1
*************** emit_one_bundle (void)
*** 6558,6572 ****
  	    /* can't fit this insn */
  	    break;
  
! 	  if (template != orig_template)
  	    /* if we switch the template, we need to reset the NOPs
  	       after slot i.  The slot-types of the instructions ahead
  	       of i never change, so we don't need to worry about
  	       changing NOPs in front of this slot.  */
  	    for (j = i; j < 3; ++j)
! 	      insn[j] = nop[ia64_templ_desc[template].exec_unit[j]];
  	}
!       required_unit = ia64_templ_desc[template].exec_unit[i];
  
        /* resolve dynamic opcodes such as "break", "hint", and "nop":  */
        if (idesc->type == IA64_TYPE_DYN)
--- 6558,6572 ----
  	    /* can't fit this insn */
  	    break;
  
! 	  if (template_val != orig_template)
  	    /* if we switch the template, we need to reset the NOPs
  	       after slot i.  The slot-types of the instructions ahead
  	       of i never change, so we don't need to worry about
  	       changing NOPs in front of this slot.  */
  	    for (j = i; j < 3; ++j)
! 	      insn[j] = nop[ia64_templ_desc[template_val].exec_unit[j]];
  	}
!       required_unit = ia64_templ_desc[template_val].exec_unit[i];
  
        /* resolve dynamic opcodes such as "break", "hint", and "nop":  */
        if (idesc->type == IA64_TYPE_DYN)
*************** emit_one_bundle (void)
*** 6607,6613 ****
  	    {
  	      insn_unit = IA64_UNIT_M;
  	      if (required_unit == IA64_UNIT_I
! 		  || (required_unit == IA64_UNIT_F && template == 6))
  		insn_unit = IA64_UNIT_I;
  	    }
  	  else
--- 6607,6613 ----
  	    {
  	      insn_unit = IA64_UNIT_M;
  	      if (required_unit == IA64_UNIT_I
! 		  || (required_unit == IA64_UNIT_F && template_val == 6))
  		insn_unit = IA64_UNIT_I;
  	    }
  	  else
*************** emit_one_bundle (void)
*** 6735,6741 ****
      {
        as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
  		    _("`%s' does not fit into %s template"),
! 		    idesc->name, ia64_templ_desc[template].name);
        /* Drop first insn so we don't livelock.  */
        --md.num_slots_in_use;
        know (curr == first);
--- 6735,6741 ----
      {
        as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
  		    _("`%s' does not fit into %s template"),
! 		    idesc->name, ia64_templ_desc[template_val].name);
        /* Drop first insn so we don't livelock.  */
        --md.num_slots_in_use;
        know (curr == first);
*************** emit_one_bundle (void)
*** 6754,6760 ****
  	    {
  	      const char *where;
  
! 	      if (template == 2)
  		where = "X slot";
  	      else if (last_slot == 0)
  		where = "slots 2 or 3";
--- 6754,6760 ----
  	    {
  	      const char *where;
  
! 	      if (template_val == 2)
  		where = "X slot";
  	      else if (last_slot == 0)
  		where = "slots 2 or 3";
*************** emit_one_bundle (void)
*** 6762,6768 ****
  		where = "slot 3";
  	      as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
  			    _("`%s' can't go in %s of %s template"),
! 			    idesc->name, where, ia64_templ_desc[template].name);
  	    }
  	}
        else
--- 6762,6768 ----
  		where = "slot 3";
  	      as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
  			    _("`%s' can't go in %s of %s template"),
! 			    idesc->name, where, ia64_templ_desc[template_val].name);
  	    }
  	}
        else
*************** emit_one_bundle (void)
*** 6772,6778 ****
  	
    know (md.num_slots_in_use < NUM_SLOTS);
  
!   t0 = end_of_insn_group | (template << 1) | (insn[0] << 5) | (insn[1] << 46);
    t1 = ((insn[1] >> 18) & 0x7fffff) | (insn[2] << 23);
  
    number_to_chars_littleendian (f + 0, t0, 8);
--- 6772,6778 ----
  	
    know (md.num_slots_in_use < NUM_SLOTS);
  
!   t0 = end_of_insn_group | (template_val << 1) | (insn[0] << 5) | (insn[1] << 46);
    t1 = ((insn[1] >> 18) & 0x7fffff) | (insn[2] << 23);
  
    number_to_chars_littleendian (f + 0, t0, 8);
Only in src.head/gas/config: tc-moxie.c.~1.5.~
diff -prc src.head/gas/config/tc-score.c src.template/gas/config/tc-score.c
*** src.head/gas/config/tc-score.c	Fri Aug 14 10:59:54 2009
--- src.template/gas/config/tc-score.c	Fri Aug 28 10:41:22 2009
*************** static struct s3_datafield_range s3_scor
*** 539,545 ****
  struct s3_asm_opcode
  {
    /* Instruction name.  */
!   const char *template;
  
    /* Instruction Opcode.  */
    bfd_vma value;
--- 539,545 ----
  struct s3_asm_opcode
  {
    /* Instruction name.  */
!   const char *template_name;
  
    /* Instruction Opcode.  */
    bfd_vma value;
*************** s3_parse_16_32_inst (char *insnstr, bfd_
*** 2681,2687 ****
        s3_inst.size = s3_GET_INSN_SIZE (s3_inst.type);
        s3_inst.relax_size = 0;
        s3_inst.bwarn = 0;
!       sprintf (s3_inst.name, "%s", opcode->template);
        strcpy (s3_inst.reg, "");
        s3_inst.error = NULL;
        s3_inst.reloc.type = BFD_RELOC_NONE;
--- 2681,2687 ----
        s3_inst.size = s3_GET_INSN_SIZE (s3_inst.type);
        s3_inst.relax_size = 0;
        s3_inst.bwarn = 0;
!       sprintf (s3_inst.name, "%s", opcode->template_name);
        strcpy (s3_inst.reg, "");
        s3_inst.error = NULL;
        s3_inst.reloc.type = BFD_RELOC_NONE;
*************** s3_parse_48_inst (char *insnstr, bfd_boo
*** 2727,2733 ****
        s3_inst.size = s3_GET_INSN_SIZE (s3_inst.type);
        s3_inst.relax_size = 0;
        s3_inst.bwarn = 0;
!       sprintf (s3_inst.name, "%s", opcode->template);
        strcpy (s3_inst.reg, "");
        s3_inst.error = NULL;
        s3_inst.reloc.type = BFD_RELOC_NONE;
--- 2727,2733 ----
        s3_inst.size = s3_GET_INSN_SIZE (s3_inst.type);
        s3_inst.relax_size = 0;
        s3_inst.bwarn = 0;
!       sprintf (s3_inst.name, "%s", opcode->template_name);
        strcpy (s3_inst.reg, "");
        s3_inst.error = NULL;
        s3_inst.reloc.type = BFD_RELOC_NONE;
*************** s3_do_macro_ldst_label (char *str)
*** 4993,4999 ****
          {
            int ldst_idx = 0;
            ldst_idx = s3_inst.instruction & OPC_PSEUDOLDST_MASK;
!           s3_build_lwst_pic (reg_rd, s3_inst.reloc.exp, s3_score_ldst_insns[ldst_idx * 3 + 0].template);
            return;
          }
        else
--- 4993,5000 ----
          {
            int ldst_idx = 0;
            ldst_idx = s3_inst.instruction & OPC_PSEUDOLDST_MASK;
!           s3_build_lwst_pic (reg_rd, s3_inst.reloc.exp,
!                              s3_score_ldst_insns[ldst_idx * 3 + 0].template_name);
            return;
          }
        else
*************** s3_build_score_ops_hsh (void)
*** 6319,6338 ****
    for (i = 0; i < sizeof (s3_score_insns) / sizeof (struct s3_asm_opcode); i++)
      {
        const struct s3_asm_opcode *insn = s3_score_insns + i;
!       unsigned len = strlen (insn->template);
        struct s3_asm_opcode *new;
!       char *template;
!       new = obstack_alloc (&insn_obstack, sizeof (struct s3_asm_opcode));
!       template = obstack_alloc (&insn_obstack, len + 1);
  
!       strcpy (template, insn->template);
!       new->template = template;
        new->parms = insn->parms;
        new->value = insn->value;
        new->relax_value = insn->relax_value;
        new->type = insn->type;
        new->bitmask = insn->bitmask;
!       hash_insert (s3_score_ops_hsh, new->template, (void *) new);
      }
  }
  
--- 6320,6340 ----
    for (i = 0; i < sizeof (s3_score_insns) / sizeof (struct s3_asm_opcode); i++)
      {
        const struct s3_asm_opcode *insn = s3_score_insns + i;
!       unsigned len = strlen (insn->template_name);
        struct s3_asm_opcode *new;
!       char *template_name;
!       new = (struct s3_asm_opcode *)
!           obstack_alloc (&insn_obstack, sizeof (struct s3_asm_opcode));
!       template_name = (char *) obstack_alloc (&insn_obstack, len + 1);
  
!       strcpy (template_name, insn->template_name);
!       new->template_name = template_name;
        new->parms = insn->parms;
        new->value = insn->value;
        new->relax_value = insn->relax_value;
        new->type = insn->type;
        new->bitmask = insn->bitmask;
!       hash_insert (s3_score_ops_hsh, new->template_name, (void *) new);
      }
  }
  
diff -prc src.head/gas/config/tc-score7.c src.template/gas/config/tc-score7.c
*** src.head/gas/config/tc-score7.c	Fri Aug 14 10:59:54 2009
--- src.template/gas/config/tc-score7.c	Fri Aug 28 10:43:12 2009
*************** static struct s7_datafield_range s7_scor
*** 597,603 ****
  struct s7_asm_opcode
  {
    /* Instruction name.  */
!   const char *template;
  
    /* Instruction Opcode.  */
    bfd_vma value;
--- 597,603 ----
  struct s7_asm_opcode
  {
    /* Instruction name.  */
!   const char *template_name;
  
    /* Instruction Opcode.  */
    bfd_vma value;
*************** s7_parse_16_32_inst (char *insnstr, bfd_
*** 2804,2810 ****
        s7_inst.size = s7_GET_INSN_SIZE (s7_inst.type);
        s7_inst.relax_size = 0;
        s7_inst.bwarn = 0;
!       sprintf (s7_inst.name, "%s", opcode->template);
        strcpy (s7_inst.reg, "");
        s7_inst.error = NULL;
        s7_inst.reloc.type = BFD_RELOC_NONE;
--- 2804,2810 ----
        s7_inst.size = s7_GET_INSN_SIZE (s7_inst.type);
        s7_inst.relax_size = 0;
        s7_inst.bwarn = 0;
!       sprintf (s7_inst.name, "%s", opcode->template_name);
        strcpy (s7_inst.reg, "");
        s7_inst.error = NULL;
        s7_inst.reloc.type = BFD_RELOC_NONE;
*************** s7_do_macro_ldst_label (char *str)
*** 4789,4795 ****
          {
            int ldst_idx = 0;
            ldst_idx = s7_inst.instruction & OPC_PSEUDOLDST_MASK;
!           s7_build_lwst_pic (reg_rd, s7_inst.reloc.exp, s7_score_ldst_insns[ldst_idx * 3 + 0].template);
            return;
          }
        else
--- 4789,4796 ----
          {
            int ldst_idx = 0;
            ldst_idx = s7_inst.instruction & OPC_PSEUDOLDST_MASK;
!           s7_build_lwst_pic (reg_rd, s7_inst.reloc.exp,
!                              s7_score_ldst_insns[ldst_idx * 3 + 0].template_name);
            return;
          }
        else
*************** s7_build_score_ops_hsh (void)
*** 5092,5111 ****
    for (i = 0; i < sizeof (s7_score_insns) / sizeof (struct s7_asm_opcode); i++)
      {
        const struct s7_asm_opcode *insn = s7_score_insns + i;
!       unsigned len = strlen (insn->template);
        struct s7_asm_opcode *new;
!       char *template;
!       new = obstack_alloc (&insn_obstack, sizeof (struct s7_asm_opcode));
!       template = obstack_alloc (&insn_obstack, len + 1);
  
!       strcpy (template, insn->template);
!       new->template = template;
        new->parms = insn->parms;
        new->value = insn->value;
        new->relax_value = insn->relax_value;
        new->type = insn->type;
        new->bitmask = insn->bitmask;
!       hash_insert (s7_score_ops_hsh, new->template, (void *) new);
      }
  }
  
--- 5093,5113 ----
    for (i = 0; i < sizeof (s7_score_insns) / sizeof (struct s7_asm_opcode); i++)
      {
        const struct s7_asm_opcode *insn = s7_score_insns + i;
!       unsigned len = strlen (insn->template_name);
        struct s7_asm_opcode *new;
!       char *template_name;
!       new = (struct s7_asm_opcode *)
!           obstack_alloc (&insn_obstack, sizeof (struct s7_asm_opcode));
!       template_name = (char *) obstack_alloc (&insn_obstack, len + 1);
  
!       strcpy (template_name, insn->template_name);
!       new->template_name = template_name;
        new->parms = insn->parms;
        new->value = insn->value;
        new->relax_value = insn->relax_value;
        new->type = insn->type;
        new->bitmask = insn->bitmask;
!       hash_insert (s7_score_ops_hsh, new->template_name, (void *) new);
      }
  }
  
diff -prc src.head/gas/config/tc-tic30.c src.template/gas/config/tc-tic30.c
*** src.head/gas/config/tc-tic30.c	Fri Aug 14 10:59:55 2009
--- src.template/gas/config/tc-tic30.c	Sun Aug 16 12:50:21 2009
*************** md_begin (void)
*** 117,123 ****
    op_hash = hash_new ();
  
    {
!     const template *current_optab = tic30_optab;
  
      for (; current_optab < tic30_optab_end; current_optab++)
        {
--- 117,123 ----
    op_hash = hash_new ();
  
    {
!     const insn_template *current_optab = tic30_optab;
  
      for (; current_optab < tic30_optab_end; current_optab++)
        {
*************** typedef struct
*** 257,267 ****
    } immediate;
  } operand;
  
! template *opcode;
  
  struct tic30_insn
  {
!   template *tm;			/* Template of current instruction.  */
    unsigned opcode;		/* Final opcode.  */
    unsigned int operands;	/* Number of given operands.  */
    /* Type of operand given in instruction.  */
--- 257,267 ----
    } immediate;
  } operand;
  
! insn_template *opcode;
  
  struct tic30_insn
  {
!   insn_template *tm;		/* Template of current instruction.  */
    unsigned opcode;		/* Final opcode.  */
    unsigned int operands;	/* Number of given operands.  */
    /* Type of operand given in instruction.  */
*************** md_operand (expressionS *expressionP ATT
*** 1416,1422 ****
  void
  md_assemble (char *line)
  {
!   template *opcode;
    char *current_posn;
    char *token_start;
    char save_char;
--- 1416,1422 ----
  void
  md_assemble (char *line)
  {
!   insn_template *opcode;
    char *current_posn;
    char *token_start;
    char save_char;
*************** md_assemble (char *line)
*** 1464,1470 ****
      /* Find instruction.  */
      save_char = *current_posn;
      *current_posn = '\0';
!     opcode = (template *) hash_find (op_hash, token_start);
      if (opcode)
        {
  	debug ("Found instruction %s\n", opcode->name);
--- 1464,1470 ----
      /* Find instruction.  */
      save_char = *current_posn;
      *current_posn = '\0';
!     opcode = (insn_template *) hash_find (op_hash, token_start);
      if (opcode)
        {
  	debug ("Found instruction %s\n", opcode->name);
diff -prc src.head/gas/config/tc-tic54x.c src.template/gas/config/tc-tic54x.c
*** src.head/gas/config/tc-tic54x.c	Fri Aug 14 10:59:55 2009
--- src.template/gas/config/tc-tic54x.c	Sun Aug 16 12:50:21 2009
*************** static struct stag
*** 81,87 ****
  
  typedef struct _tic54x_insn
  {
!   const template *tm;		/* Opcode template.  */
  
    char mnemonic[MAX_LINE];	/* Opcode name/mnemonic.  */
    char parmnemonic[MAX_LINE];   /* 2nd mnemonic of parallel insn.  */
--- 81,87 ----
  
  typedef struct _tic54x_insn
  {
!   const insn_template *tm;	/* Opcode template.  */
  
    char mnemonic[MAX_LINE];	/* Opcode name/mnemonic.  */
    char parmnemonic[MAX_LINE];   /* 2nd mnemonic of parallel insn.  */
*************** static const math_proc_entry math_procs[
*** 2989,2995 ****
  void
  md_begin (void)
  {
!   template *tm;
    symbol *sym;
    const subsym_proc_entry *subsym_proc;
    const math_proc_entry *math_proc;
--- 2989,2995 ----
  void
  md_begin (void)
  {
!   insn_template *tm;
    symbol *sym;
    const subsym_proc_entry *subsym_proc;
    const math_proc_entry *math_proc;
*************** md_begin (void)
*** 3018,3024 ****
      }
  
    op_hash = hash_new ();
!   for (tm = (template *) tic54x_optab; tm->name; tm++)
      {
        if (hash_find (op_hash, tm->name))
  	continue;
--- 3018,3024 ----
      }
  
    op_hash = hash_new ();
!   for (tm = (insn_template *) tic54x_optab; tm->name; tm++)
      {
        if (hash_find (op_hash, tm->name))
  	continue;
*************** md_begin (void)
*** 3028,3034 ****
  		  tm->name, hash_err);
      }
    parop_hash = hash_new ();
!   for (tm = (template *) tic54x_paroptab; tm->name; tm++)
      {
        if (hash_find (parop_hash, tm->name))
  	continue;
--- 3028,3034 ----
  		  tm->name, hash_err);
      }
    parop_hash = hash_new ();
!   for (tm = (insn_template *) tic54x_paroptab; tm->name; tm++)
      {
        if (hash_find (parop_hash, tm->name))
  	continue;
*************** optimize_insn (tic54x_insn *insn)
*** 4179,4185 ****
  static int
  tic54x_parse_insn (tic54x_insn *insn, char *line)
  {
!   insn->tm = (template *) hash_find (op_hash, insn->mnemonic);
    if (!insn->tm)
      {
        as_bad (_("Unrecognized instruction \"%s\""), insn->mnemonic);
--- 4179,4185 ----
  static int
  tic54x_parse_insn (tic54x_insn *insn, char *line)
  {
!   insn->tm = (insn_template *) hash_find (op_hash, insn->mnemonic);
    if (!insn->tm)
      {
        as_bad (_("Unrecognized instruction \"%s\""), insn->mnemonic);
*************** tic54x_parse_insn (tic54x_insn *insn, ch
*** 4202,4209 ****
  	  /* SUCCESS! now try some optimizations.  */
  	  if (optimize_insn (insn))
  	    {
! 	      insn->tm = (template *) hash_find (op_hash,
! 						 insn->mnemonic);
  	      continue;
  	    }
  
--- 4202,4209 ----
  	  /* SUCCESS! now try some optimizations.  */
  	  if (optimize_insn (insn))
  	    {
! 	      insn->tm = (insn_template *) hash_find (op_hash,
!                                                       insn->mnemonic);
  	      continue;
  	    }
  
*************** next_line_shows_parallel (char *next_lin
*** 4237,4243 ****
  static int
  tic54x_parse_parallel_insn_firstline (tic54x_insn *insn, char *line)
  {
!   insn->tm = (template *) hash_find (parop_hash, insn->mnemonic);
    if (!insn->tm)
      {
        as_bad (_("Unrecognized parallel instruction \"%s\""),
--- 4237,4243 ----
  static int
  tic54x_parse_parallel_insn_firstline (tic54x_insn *insn, char *line)
  {
!   insn->tm = (insn_template *) hash_find (parop_hash, insn->mnemonic);
    if (!insn->tm)
      {
        as_bad (_("Unrecognized parallel instruction \"%s\""),
diff -prc src.head/include/opcode/tic30.h src.template/include/opcode/tic30.h
*** src.head/include/opcode/tic30.h	Tue Jun 16 09:07:24 2009
--- src.template/include/opcode/tic30.h	Wed Aug 19 09:11:20 2009
*************** typedef struct _template
*** 241,249 ****
  #define Imm_SInt  2
  #define Imm_UInt  3
  }
! template;
  
! static const template tic30_optab[] = {
    { "absf"   ,2,0x00000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
    { "absi"   ,2,0x00800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
    { "addc"   ,2,0x01000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
--- 241,249 ----
  #define Imm_SInt  2
  #define Imm_UInt  3
  }
! insn_template;
  
! static const insn_template tic30_optab[] = {
    { "absf"   ,2,0x00000000,AddressMode, { GAddr1, Rn, 0 }, Imm_Float },
    { "absi"   ,2,0x00800000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
    { "addc"   ,2,0x01000000,AddressMode, { GAddr2, AllReg, 0 }, Imm_SInt },
*************** static const template tic30_optab[] = {
*** 604,610 ****
    { ""       ,0,0x00000000,0,           { 0, 0, 0 }, 0 }
  };
  
! static const template *const tic30_optab_end =
    tic30_optab + sizeof(tic30_optab)/sizeof(tic30_optab[0]);
  
  typedef struct {
--- 604,610 ----
    { ""       ,0,0x00000000,0,           { 0, 0, 0 }, 0 }
  };
  
! static const insn_template *const tic30_optab_end =
    tic30_optab + sizeof(tic30_optab)/sizeof(tic30_optab[0]);
  
  typedef struct {
diff -prc src.head/include/opcode/tic54x.h src.template/include/opcode/tic54x.h
*** src.head/include/opcode/tic54x.h	Tue Jun 16 09:07:24 2009
--- src.template/include/opcode/tic54x.h	Sun Aug 16 12:50:21 2009
*************** typedef struct _template
*** 147,163 ****
    const char* parname;
    enum optype paroperand_types[MAX_OPERANDS];
  
! } template;
  
! extern const template tic54x_unknown_opcode;
! extern const template tic54x_optab[];
! extern const template tic54x_paroptab[];
  extern const symbol mmregs[], regs[];
  extern const symbol condition_codes[], cc2_codes[], status_bits[];
  extern const symbol cc3_codes[];
  extern const char *misc_symbols[];
  struct disassemble_info;
! extern const template* tic54x_get_insn (struct disassemble_info *, 
                                          bfd_vma, unsigned short, int *);
  
  #endif /* _opcode_tic54x_h_ */
--- 147,163 ----
    const char* parname;
    enum optype paroperand_types[MAX_OPERANDS];
  
! } insn_template;
  
! extern const insn_template tic54x_unknown_opcode;
! extern const insn_template tic54x_optab[];
! extern const insn_template tic54x_paroptab[];
  extern const symbol mmregs[], regs[];
  extern const symbol condition_codes[], cc2_codes[], status_bits[];
  extern const symbol cc3_codes[];
  extern const char *misc_symbols[];
  struct disassemble_info;
! extern const insn_template* tic54x_get_insn (struct disassemble_info *, 
                                          bfd_vma, unsigned short, int *);
  
  #endif /* _opcode_tic54x_h_ */
diff -prc src.head/opcodes/cris-dis.c src.template/opcodes/cris-dis.c
*** src.head/opcodes/cris-dis.c	Tue Jun 16 09:07:16 2009
--- src.template/opcodes/cris-dis.c	Sun Aug 16 12:50:21 2009
*************** bytes_to_skip (unsigned int insn,
*** 660,676 ****
  {
    /* Each insn is a word plus "immediate" operands.  */
    unsigned to_skip = 2;
!   const char *template = matchedp->args;
    const char *s;
  
!   for (s = template; *s; s++)
      if ((*s == 's' || *s == 'N' || *s == 'Y')
  	&& (insn & 0x400) && (insn & 15) == 15
  	&& prefix_matchedp == NULL)
        {
  	/* Immediate via [pc+], so we have to check the size of the
  	   operand.  */
! 	int mode_size = 1 << ((insn >> 4) & (*template == 'z' ? 1 : 3));
  
  	if (matchedp->imm_oprnd_size == SIZE_FIX_32)
  	  to_skip += 4;
--- 660,676 ----
  {
    /* Each insn is a word plus "immediate" operands.  */
    unsigned to_skip = 2;
!   const char *template_name = (const char *) matchedp->args;
    const char *s;
  
!   for (s = template_name; *s; s++)
      if ((*s == 's' || *s == 'N' || *s == 'Y')
  	&& (insn & 0x400) && (insn & 15) == 15
  	&& prefix_matchedp == NULL)
        {
  	/* Immediate via [pc+], so we have to check the size of the
  	   operand.  */
! 	int mode_size = 1 << ((insn >> 4) & (*template_name == 'z' ? 1 : 3));
  
  	if (matchedp->imm_oprnd_size == SIZE_FIX_32)
  	  to_skip += 4;
diff -prc src.head/opcodes/i386-dis.c src.template/opcodes/i386-dis.c
*** src.head/opcodes/i386-dis.c	Fri Aug 14 11:16:37 2009
--- src.template/opcodes/i386-dis.c	Sun Aug 16 12:50:21 2009
*************** OP_STi (int bytemode ATTRIBUTE_UNUSED, i
*** 10184,10190 ****
  
  /* Capital letters in template are macros.  */
  static int
! putop (const char *template, int sizeflag)
  {
    const char *p;
    int alt = 0;
--- 10184,10190 ----
  
  /* Capital letters in template are macros.  */
  static int
! putop (const char *in_template, int sizeflag)
  {
    const char *p;
    int alt = 0;
*************** putop (const char *template, int sizefla
*** 10198,10204 ****
    else					\
      abort ();
  
!   for (p = template; *p; p++)
      {
        switch (*p)
  	{
--- 10198,10204 ----
    else					\
      abort ();
  
!   for (p = in_template; *p; p++)
      {
        switch (*p)
  	{
Only in src.template/opcodes: i386-dis.c.orig
diff -prc src.head/opcodes/i386-gen.c src.template/opcodes/i386-gen.c
*** src.head/opcodes/i386-gen.c	Fri Aug 14 11:16:38 2009
--- src.template/opcodes/i386-gen.c	Wed Aug 19 09:09:24 2009
*************** process_i386_opcodes (FILE *table)
*** 876,882 ****
  					 xcalloc, free);
  
    fprintf (table, "\n/* i386 opcode table.  */\n\n");
!   fprintf (table, "const template i386_optab[] =\n{\n");
  
    /* Put everything on opcode array.  */
    while (!feof (fp))
--- 876,882 ----
  					 xcalloc, free);
  
    fprintf (table, "\n/* i386 opcode table.  */\n\n");
!   fprintf (table, "const insn_template i386_optab[] =\n{\n");
  
    /* Put everything on opcode array.  */
    while (!feof (fp))
diff -prc src.head/opcodes/i386-opc.h src.template/opcodes/i386-opc.h
*** src.head/opcodes/i386-opc.h	Fri Aug 14 11:16:38 2009
--- src.template/opcodes/i386-opc.h	Sun Aug 16 12:50:21 2009
*************** typedef union i386_operand_type
*** 524,530 ****
    unsigned int array[OTNumOfUints];
  } i386_operand_type;
  
! typedef struct template
  {
    /* instruction name sans width suffix ("mov" for movl insns) */
    char *name;
--- 524,530 ----
    unsigned int array[OTNumOfUints];
  } i386_operand_type;
  
! typedef struct insn_template
  {
    /* instruction name sans width suffix ("mov" for movl insns) */
    char *name;
*************** typedef struct template
*** 566,574 ****
       either a register or an immediate operand.  */
    i386_operand_type operand_types[MAX_OPERANDS];
  }
! template;
  
! extern const template i386_optab[];
  
  /* these are for register name --> number & type hash lookup */
  typedef struct
--- 566,574 ----
       either a register or an immediate operand.  */
    i386_operand_type operand_types[MAX_OPERANDS];
  }
! insn_template;
  
! extern const insn_template i386_optab[];
  
  /* these are for register name --> number & type hash lookup */
  typedef struct
Only in src.template/opcodes: i386-opc.h.orig
diff -prc src.head/opcodes/i386-tbl.h src.template/opcodes/i386-tbl.h
*** src.head/opcodes/i386-tbl.h	Fri Aug 14 11:16:41 2009
--- src.template/opcodes/i386-tbl.h	Wed Aug 19 09:53:23 2009
***************
*** 21,27 ****
  
  /* i386 opcode table.  */
  
! const template i386_optab[] =
  {
    { "mov", 2, 0xa0, None, 1,
      { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
--- 21,27 ----
  
  /* i386 opcode table.  */
  
! const insn_template i386_optab[] =
  {
    { "mov", 2, 0xa0, None, 1,
      { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
diff -prc src.head/opcodes/ia64-dis.c src.template/opcodes/ia64-dis.c
*** src.head/opcodes/ia64-dis.c	Tue Jun 16 09:07:16 2009
--- src.template/opcodes/ia64-dis.c	Sun Aug 16 12:50:21 2009
*************** unit_to_type (ia64_insn opcode, enum ia6
*** 68,74 ****
  int
  print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info)
  {
!   ia64_insn t0, t1, slot[3], template, s_bit, insn;
    int slotnum, j, status, need_comma, retval, slot_multiplier;
    const struct ia64_operand *odesc;
    const struct ia64_opcode *idesc;
--- 68,74 ----
  int
  print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info)
  {
!   ia64_insn t0, t1, slot[3], template_val, s_bit, insn;
    int slotnum, j, status, need_comma, retval, slot_multiplier;
    const struct ia64_operand *odesc;
    const struct ia64_opcode *idesc;
*************** print_insn_ia64 (bfd_vma memaddr, struct
*** 100,119 ****
    t0 = bfd_getl64 (bundle);
    t1 = bfd_getl64 (bundle + 8);
    s_bit = t0 & 1;
!   template = (t0 >> 1) & 0xf;
    slot[0] = (t0 >>  5) & 0x1ffffffffffLL;
    slot[1] = ((t0 >> 46) & 0x3ffff) | ((t1 & 0x7fffff) << 18);
    slot[2] = (t1 >> 23) & 0x1ffffffffffLL;
  
!   tname = ia64_templ_desc[template].name;
    if (slotnum == 0)
      (*info->fprintf_func) (info->stream, "[%s] ", tname);
    else
      (*info->fprintf_func) (info->stream, "      ");
  
!   unit = ia64_templ_desc[template].exec_unit[slotnum];
  
!   if (template == 2 && slotnum == 1)
      {
        /* skip L slot in MLI template: */
        slotnum = 2;
--- 100,119 ----
    t0 = bfd_getl64 (bundle);
    t1 = bfd_getl64 (bundle + 8);
    s_bit = t0 & 1;
!   template_val = (t0 >> 1) & 0xf;
    slot[0] = (t0 >>  5) & 0x1ffffffffffLL;
    slot[1] = ((t0 >> 46) & 0x3ffff) | ((t1 & 0x7fffff) << 18);
    slot[2] = (t1 >> 23) & 0x1ffffffffffLL;
  
!   tname = ia64_templ_desc[template_val].name;
    if (slotnum == 0)
      (*info->fprintf_func) (info->stream, "[%s] ", tname);
    else
      (*info->fprintf_func) (info->stream, "      ");
  
!   unit = ia64_templ_desc[template_val].exec_unit[slotnum];
  
!   if (template_val == 2 && slotnum == 1)
      {
        /* skip L slot in MLI template: */
        slotnum = 2;
*************** print_insn_ia64 (bfd_vma memaddr, struct
*** 303,309 ****
  	  need_comma = 0;
  	}
      }
!   if (slotnum + 1 == ia64_templ_desc[template].group_boundary 
        || ((slotnum == 2) && s_bit))
      (*info->fprintf_func) (info->stream, ";;");
  
--- 303,309 ----
  	  need_comma = 0;
  	}
      }
!   if (slotnum + 1 == ia64_templ_desc[template_val].group_boundary 
        || ((slotnum == 2) && s_bit))
      (*info->fprintf_func) (info->stream, ";;");
  
diff -prc src.head/opcodes/tic30-dis.c src.template/opcodes/tic30-dis.c
*** src.head/opcodes/tic30-dis.c	Tue Jun 16 09:07:17 2009
--- src.template/opcodes/tic30-dis.c	Wed Aug 19 09:12:12 2009
*************** static unsigned int _pc;
*** 64,70 ****
  struct instruction
  {
    int type;
!   template *tm;
    partemplate *ptm;
  };
  
--- 64,70 ----
  struct instruction
  {
    int type;
!   insn_template *tm;
    partemplate *ptm;
  };
  
*************** get_tic30_instruction (unsigned long ins
*** 78,84 ****
      case THREE_OPERAND:
        insn->type = NORMAL_INSN;
        {
! 	template *current_optab = (template *) tic30_optab;
  
  	for (; current_optab < tic30_optab_end; current_optab++)
  	  {
--- 78,84 ----
      case THREE_OPERAND:
        insn->type = NORMAL_INSN;
        {
! 	insn_template *current_optab = (insn_template *) tic30_optab;
  
  	for (; current_optab < tic30_optab_end; current_optab++)
  	  {
*************** get_tic30_instruction (unsigned long ins
*** 145,151 ****
      case BRANCHES:
        insn->type = NORMAL_INSN;
        {
! 	template *current_optab = (template *) tic30_optab;
  
  	for (; current_optab < tic30_optab_end; current_optab++)
  	  {
--- 145,151 ----
      case BRANCHES:
        insn->type = NORMAL_INSN;
        {
! 	insn_template *current_optab = (insn_template *) tic30_optab;
  
  	for (; current_optab < tic30_optab_end; current_optab++)
  	  {
diff -prc src.head/opcodes/tic54x-dis.c src.template/opcodes/tic54x-dis.c
*** src.head/opcodes/tic54x-dis.c	Tue Jun 16 09:07:17 2009
--- src.template/opcodes/tic54x-dis.c	Wed Aug 19 09:13:09 2009
***************
*** 27,40 ****
  #include "opcode/tic54x.h"
  #include "coff/tic54x.h"
  
! static int has_lkaddr (unsigned short, const template *);
! static int get_insn_size (unsigned short, const template *);
  static int print_instruction (disassemble_info *, bfd_vma,
                                unsigned short, const char *,
                                const enum optype [], int, int);
  static int print_parallel_instruction (disassemble_info *, bfd_vma,
!                                        unsigned short, 
!                                        const template *, int);
  static int sprint_dual_address (disassemble_info *,char [],
                                  unsigned short);
  static int sprint_indirect_address (disassemble_info *,char [],
--- 27,40 ----
  #include "opcode/tic54x.h"
  #include "coff/tic54x.h"
  
! static int has_lkaddr (unsigned short, const insn_template *);
! static int get_insn_size (unsigned short, const insn_template *);
  static int print_instruction (disassemble_info *, bfd_vma,
                                unsigned short, const char *,
                                const enum optype [], int, int);
  static int print_parallel_instruction (disassemble_info *, bfd_vma,
!                                        unsigned short,
!                                        const insn_template *, int);
  static int sprint_dual_address (disassemble_info *,char [],
                                  unsigned short);
  static int sprint_indirect_address (disassemble_info *,char [],
*************** print_insn_tic54x (bfd_vma memaddr, disa
*** 51,57 ****
    bfd_byte opbuf[2];
    unsigned short opcode;
    int status, size;
!   const template* tm;
  
    status = (*info->read_memory_func) (memaddr, opbuf, 2, info);
    if (status != 0)
--- 51,57 ----
    bfd_byte opbuf[2];
    unsigned short opcode;
    int status, size;
!   const insn_template* tm;
  
    status = (*info->read_memory_func) (memaddr, opbuf, 2, info);
    if (status != 0)
*************** print_insn_tic54x (bfd_vma memaddr, disa
*** 86,92 ****
  }
  
  static int
! has_lkaddr (unsigned short memdata, const template *tm)
  {
    return (IS_LKADDR (memdata)
  	  && (OPTYPE (tm->operand_types[0]) == OP_Smem
--- 86,92 ----
  }
  
  static int
! has_lkaddr (unsigned short memdata, const insn_template *tm)
  {
    return (IS_LKADDR (memdata)
  	  && (OPTYPE (tm->operand_types[0]) == OP_Smem
*************** has_lkaddr (unsigned short memdata, cons
*** 99,109 ****
  
  /* always returns 1 (whether an insn template was found) since we provide an
     "unknown instruction" template */
! const template*
! tic54x_get_insn (disassemble_info *info, bfd_vma addr, 
                   unsigned short memdata, int *size)
  {
!   const template *tm = NULL;
  
    for (tm = tic54x_optab; tm->name; tm++)
    {
--- 99,109 ----
  
  /* always returns 1 (whether an insn template was found) since we provide an
     "unknown instruction" template */
! const insn_template*
! tic54x_get_insn (disassemble_info *info, bfd_vma addr,
                   unsigned short memdata, int *size)
  {
!   const insn_template *tm = NULL;
  
    for (tm = tic54x_optab; tm->name; tm++)
    {
*************** tic54x_get_insn (disassemble_info *info,
*** 135,141 ****
          }
      }
    }
!   for (tm = (template *) tic54x_paroptab; tm->name; tm++)
    {
      if (tm->opcode == (memdata & tm->mask))
      {
--- 135,141 ----
          }
      }
    }
!   for (tm = (insn_template *) tic54x_paroptab; tm->name; tm++)
    {
      if (tm->opcode == (memdata & tm->mask))
      {
*************** tic54x_get_insn (disassemble_info *info,
*** 149,155 ****
  }
  
  static int
! get_insn_size (unsigned short memdata, const template *insn)
  {
    int size;
  
--- 149,155 ----
  }
  
  static int
! get_insn_size (unsigned short memdata, const insn_template *insn)
  {
    int size;
  
*************** print_parallel_instruction (info, memadd
*** 472,478 ****
    disassemble_info *info;
    bfd_vma memaddr;
    unsigned short opcode;
!   const template *ptm;
    int size;
  {
    print_instruction (info, memaddr, opcode,
--- 472,478 ----
    disassemble_info *info;
    bfd_vma memaddr;
    unsigned short opcode;
!   const insn_template *ptm;
    int size;
  {
    print_instruction (info, memaddr, opcode,
diff -prc src.head/opcodes/tic54x-opc.c src.template/opcodes/tic54x-opc.c
*** src.head/opcodes/tic54x-opc.c	Tue Jun 16 09:07:17 2009
--- src.template/opcodes/tic54x-opc.c	Wed Aug 19 09:14:02 2009
*************** const char *misc_symbols[] = {
*** 231,239 ****
  #define ZPAR 0,{OP_None}
  #define REST 0,0,ZPAR
  #define XREST ZPAR
! const template tic54x_unknown_opcode =
    { "???",   1,0,0,0x0000, 0x0000, {0}, 0, REST};
! const template tic54x_optab[] = {
    /* these must precede bc/bcd, cc/ccd to avoid misinterpretation */
    { "fb",    2,1,1,0xF880, 0xFF80, {OP_xpmad}, B_BRANCH|FL_FAR|FL_NR, REST},
    { "fbd",   2,1,1,0xFA80, 0xFF80, {OP_xpmad}, B_BRANCH|FL_FAR|FL_DELAY|FL_NR, REST},
--- 231,239 ----
  #define ZPAR 0,{OP_None}
  #define REST 0,0,ZPAR
  #define XREST ZPAR
! const insn_template tic54x_unknown_opcode =
    { "???",   1,0,0,0x0000, 0x0000, {0}, 0, REST};
! const insn_template tic54x_optab[] = {
    /* these must precede bc/bcd, cc/ccd to avoid misinterpretation */
    { "fb",    2,1,1,0xF880, 0xFF80, {OP_xpmad}, B_BRANCH|FL_FAR|FL_NR, REST},
    { "fbd",   2,1,1,0xFA80, 0xFF80, {OP_xpmad}, B_BRANCH|FL_FAR|FL_DELAY|FL_NR, REST},
*************** const template tic54x_optab[] = {
*** 465,471 ****
  };
  
  /* assume all parallel instructions have at least three operands */
! const template tic54x_paroptab[] = {
    { "ld",1,1,2,0xA800, 0xFE00, {OP_Xmem,OP_DST},      FL_PAR,0,0,
      "mac",                     {OP_Ymem,OPT|OP_RND},},
    { "ld",1,1,2,0xAA00, 0xFE00, {OP_Xmem,OP_DST},      FL_PAR,0,0,
--- 465,471 ----
  };
  
  /* assume all parallel instructions have at least three operands */
! const insn_template tic54x_paroptab[] = {
    { "ld",1,1,2,0xA800, 0xFE00, {OP_Xmem,OP_DST},      FL_PAR,0,0,
      "mac",                     {OP_Ymem,OPT|OP_RND},},
    { "ld",1,1,2,0xAA00, 0xFE00, {OP_Xmem,OP_DST},      FL_PAR,0,0,
Only in src.template/sid/component/cfgroot/libltdl: config-h.in]

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