source: patches/binutils-2.19-branch_update-4.patch@ a5288d3

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since a5288d3 was 7c6ada9, checked in by Jim Gifford <clfs@…>, 16 years ago

Updated Binutils Branch Update Patch to -4

  • Property mode set to 100644
File size: 116.9 KB
  • bfd/ChangeLog

    Submitted By: Jim Gifford (jim at cross-lfs dot org)
    Date: 01-22-2009
    Initial Package Version: 2.19
    Origin: Upstream
    Upstream Status: Applied
    Description: This is a branch update for binutils-2.19, and should be
                 rechecked periodically.
    
    diff -Naur binutils-2.19.orig/bfd/ChangeLog binutils-2.19/bfd/ChangeLog
    old new  
     12009-01-14  Joseph Myers  <joseph@codesourcery.com>
     2
     3        * elf32-arm.c (elf32_arm_final_link_relocate): Do not turn
     4        branches to undefine weak symbols into branches to the next
     5        instruction if creating PLT entries for those symbols.
     6
     72008-12-23  Nick Clifton  <nickc@redhat.com>
     8
     9        * Import this patch from the mainline:
     10        2008-11-10  Andreas Schwab  <schwab@suse.de>
     11
     12        PR 7011
     13        * elf.c (assign_file_positions_for_non_load_sections): Handle
     14        PT_GNU_RELRO specially.
     15
     162008-11-20  Alan Modra  <amodra@bigpond.net.au>
     17
     18        * elf32-ppc.c (allocate_dynrelocs): Always use tlsld_got for
     19        TLS_LD even when symbol is used with other TLS reloc types.
     20        (ppc_elf_relocate_section): Bypass symbol checks when using tlsld_got.
     21        Leave addend zero on LD DTPMOD dynamic reloc.
     22
     232008-11-17  Eric B. Weddington  <eric.weddington@atmel.com>
     24
     25        PR 7022
     26        * elf32-avr.c (bfd_elf_avr_final_write_processing):
     27        Add missing break statements.
     28
     292008-10-28  Tristan Gingold  <gingold@adacore.com>
     30
     31        * configure.in: Bump version to 2.19.0
     32        * Makefile.am (RELEASE): Unset.
     33        * configure, Makefile.in: Regenerated.
     34
    1352008-10-16  Tristan Gingold  <gingold@adacore.com>
    236
    337        * configure.in: Bump version to 2.19
  • bfd/configure

    diff -Naur binutils-2.19.orig/bfd/configure binutils-2.19/bfd/configure
    old new  
    30323032
    30333033# Define the identity of the package.
    30343034 PACKAGE=bfd
    3035  VERSION=2.19
     3035 VERSION=2.19.0
    30363036
    30373037
    30383038cat >>confdefs.h <<_ACEOF
  • bfd/configure.in

    diff -Naur binutils-2.19.orig/bfd/configure.in binutils-2.19/bfd/configure.in
    old new  
    88AC_CANONICAL_TARGET
    99AC_ISC_POSIX
    1010
    11 AM_INIT_AUTOMAKE(bfd, 2.19)
     11AM_INIT_AUTOMAKE(bfd, 2.19.0)
    1212
    1313dnl These must be called before LT_INIT, because it may want
    1414dnl to call AC_CHECK_PROG.
  • bfd/doc/bfdver.texi

    diff -Naur binutils-2.19.orig/bfd/doc/bfdver.texi binutils-2.19/bfd/doc/bfdver.texi
    old new  
    1 @set VERSION 2.19
     1@set VERSION 2.19.0
    22@set VERSION_PACKAGE (GNU Binutils)
    3 @set UPDATED October 2008
     3@set UPDATED December 2008
    44@set BUGURL @uref{http://www.sourceware.org/bugzilla/}
  • bfd/elf32-arm.c

    diff -Naur binutils-2.19.orig/bfd/elf32-arm.c binutils-2.19/bfd/elf32-arm.c
    old new  
    63816381        int thumb2 = using_thumb2 (globals);
    63826382
    63836383        /* A branch to an undefined weak symbol is turned into a jump to
    6384            the next instruction.  */
    6385         if (h && h->root.type == bfd_link_hash_undefweak)
     6384           the next instruction unless a PLT entry will be created.  */
     6385        if (h && h->root.type == bfd_link_hash_undefweak
     6386            && !(splt != NULL && h->plt.offset != (bfd_vma) -1))
    63866387          {
    63876388            bfd_put_16 (input_bfd, 0xe000, hit_data);
    63886389            bfd_put_16 (input_bfd, 0xbf00, hit_data + 2);
  • bfd/elf32-avr.c

    diff -Naur binutils-2.19.orig/bfd/elf32-avr.c binutils-2.19/bfd/elf32-avr.c
    old new  
    12981298
    12991299    case bfd_mach_avr25:
    13001300      val = E_AVR_MACH_AVR25;
     1301      break;
    13011302
    13021303    case bfd_mach_avr3:
    13031304      val = E_AVR_MACH_AVR3;
     
    13051306
    13061307    case bfd_mach_avr31:
    13071308      val = E_AVR_MACH_AVR31;
     1309      break;
    13081310
    13091311    case bfd_mach_avr35:
    13101312      val = E_AVR_MACH_AVR35;
     1313      break;
    13111314
    13121315    case bfd_mach_avr4:
    13131316      val = E_AVR_MACH_AVR4;
  • bfd/elf32-ppc.c

    diff -Naur binutils-2.19.orig/bfd/elf32-ppc.c binutils-2.19/bfd/elf32-ppc.c
    old new  
    49974997  eh = (struct ppc_elf_link_hash_entry *) h;
    49984998  if (eh->elf.got.refcount > 0)
    49994999    {
     5000      bfd_boolean dyn;
     5001      unsigned int need;
     5002
    50005003      /* Make sure this symbol is output as a dynamic symbol.  */
    50015004      if (eh->elf.dynindx == -1
    50025005          && !eh->elf.forced_local
     
    50065009            return FALSE;
    50075010        }
    50085011
    5009       if (eh->tls_mask == (TLS_TLS | TLS_LD)
    5010           && !eh->elf.def_dynamic)
    5011         {
    5012           /* If just an LD reloc, we'll just use htab->tlsld_got.offset.  */
    5013           htab->tlsld_got.refcount += 1;
    5014           eh->elf.got.offset = (bfd_vma) -1;
    5015         }
    5016       else
     5012      need = 0;
     5013      if ((eh->tls_mask & TLS_TLS) != 0)
    50175014        {
    5018           bfd_boolean dyn;
    5019           unsigned int need = 0;
    5020           if ((eh->tls_mask & TLS_TLS) != 0)
     5015          if ((eh->tls_mask & TLS_LD) != 0)
    50215016            {
    5022               if ((eh->tls_mask & TLS_LD) != 0)
    5023                 need += 8;
    5024               if ((eh->tls_mask & TLS_GD) != 0)
     5017              if (!eh->elf.def_dynamic)
     5018                /* We'll just use htab->tlsld_got.offset.  This should
     5019                   always be the case.  It's a little odd if we have
     5020                   a local dynamic reloc against a non-local symbol.  */
     5021                htab->tlsld_got.refcount += 1;
     5022              else
    50255023                need += 8;
    5026               if ((eh->tls_mask & (TLS_TPREL | TLS_TPRELGD)) != 0)
    5027                 need += 4;
    5028               if ((eh->tls_mask & TLS_DTPREL) != 0)
    5029                 need += 4;
    50305024            }
    5031           else
     5025          if ((eh->tls_mask & TLS_GD) != 0)
     5026            need += 8;
     5027          if ((eh->tls_mask & (TLS_TPREL | TLS_TPRELGD)) != 0)
     5028            need += 4;
     5029          if ((eh->tls_mask & TLS_DTPREL) != 0)
    50325030            need += 4;
     5031        }
     5032      else
     5033        need += 4;
     5034      if (need == 0)
     5035        eh->elf.got.offset = (bfd_vma) -1;
     5036      else
     5037        {
    50335038          eh->elf.got.offset = allocate_got (htab, need);
    50345039          dyn = htab->elf.dynamic_sections_created;
    50355040          if ((info->shared
     
    50395044            {
    50405045              /* All the entries we allocated need relocs.
    50415046                 Except LD only needs one.  */
    5042               if ((eh->tls_mask & TLS_LD) != 0)
     5047              if ((eh->tls_mask & TLS_LD) != 0
     5048                  && eh->elf.def_dynamic)
    50435049                need -= 4;
    50445050              htab->relgot->size += need * (sizeof (Elf32_External_Rela) / 4);
    50455051            }
     
    52755281      for (; local_got < end_local_got; ++local_got, ++lgot_masks)
    52765282        if (*local_got > 0)
    52775283          {
    5278             if (*lgot_masks == (TLS_TLS | TLS_LD))
     5284            unsigned int need = 0;
     5285            if ((*lgot_masks & TLS_TLS) != 0)
    52795286              {
    5280                 /* If just an LD reloc, we'll just use
    5281                    htab->tlsld_got.offset.  */
    5282                 htab->tlsld_got.refcount += 1;
    5283                 *local_got = (bfd_vma) -1;
     5287                if ((*lgot_masks & TLS_GD) != 0)
     5288                  need += 8;
     5289                if ((*lgot_masks & TLS_LD) != 0)
     5290                  htab->tlsld_got.refcount += 1;
     5291                if ((*lgot_masks & (TLS_TPREL | TLS_TPRELGD)) != 0)
     5292                  need += 4;
     5293                if ((*lgot_masks & TLS_DTPREL) != 0)
     5294                  need += 4;
    52845295              }
    52855296            else
     5297              need += 4;
     5298            if (need == 0)
     5299              *local_got = (bfd_vma) -1;
     5300            else
    52865301              {
    5287                 unsigned int need = 0;
    5288                 if ((*lgot_masks & TLS_TLS) != 0)
    5289                   {
    5290                     if ((*lgot_masks & TLS_GD) != 0)
    5291                       need += 8;
    5292                     if ((*lgot_masks & (TLS_TPREL | TLS_TPRELGD)) != 0)
    5293                       need += 4;
    5294                     if ((*lgot_masks & TLS_DTPREL) != 0)
    5295                       need += 4;
    5296                   }
    5297                 else
    5298                   need += 4;
    52995302                *local_got = allocate_got (htab, need);
    53005303                if (info->shared)
    53015304                  htab->relgot->size += (need
     
    65606563
    65616564                    /* Generate relocs for the dynamic linker.  */
    65626565                    if ((info->shared || indx != 0)
    6563                         && (h == NULL
     6566                        && (offp == &htab->tlsld_got.offset
     6567                            || h == NULL
    65646568                            || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
    65656569                            || h->root.type != bfd_link_hash_undefweak))
    65666570                      {
     
    65916595                          outrel.r_info = ELF32_R_INFO (indx, R_PPC_RELATIVE);
    65926596                        else
    65936597                          outrel.r_info = ELF32_R_INFO (indx, R_PPC_GLOB_DAT);
    6594                         if (indx == 0)
     6598                        if (indx == 0 && tls_ty != (TLS_TLS | TLS_LD))
    65956599                          {
    65966600                            outrel.r_addend += relocation;
    65976601                            if (tls_ty & (TLS_GD | TLS_DTPREL | TLS_TPREL))
  • binutils-2.19

    diff -Naur binutils-2.19.orig/bfd/elf.c binutils-2.19/bfd/elf.c
    old new  
    46064606       m != NULL;
    46074607       m = m->next, p++)
    46084608    {
    4609       if (m->count != 0)
     4609      if (p->p_type == PT_GNU_RELRO)
     4610        {
     4611          const Elf_Internal_Phdr *lp;
     4612
     4613          BFD_ASSERT (!m->includes_filehdr && !m->includes_phdrs);
     4614
     4615          if (link_info != NULL)
     4616            {
     4617              /* During linking the range of the RELRO segment is passed
     4618                 in link_info.  */
     4619              for (lp = phdrs; lp < phdrs + count; ++lp)
     4620                {
     4621                  if (lp->p_type == PT_LOAD
     4622                      && lp->p_vaddr >= link_info->relro_start
     4623                      && lp->p_vaddr < link_info->relro_end
     4624                      && lp->p_vaddr + lp->p_filesz >= link_info->relro_end)
     4625                    break;
     4626                }
     4627            }
     4628          else
     4629            {
     4630              /* Otherwise we are copying an executable or shared
     4631                 library, but we need to use the same linker logic.  */
     4632              for (lp = phdrs; lp < phdrs + count; ++lp)
     4633                {
     4634                  if (lp->p_type == PT_LOAD
     4635                      && lp->p_paddr == p->p_paddr)
     4636                    break;
     4637                }
     4638            }
     4639
     4640          if (lp < phdrs + count)
     4641            {
     4642              p->p_vaddr = lp->p_vaddr;
     4643              p->p_paddr = lp->p_paddr;
     4644              p->p_offset = lp->p_offset;
     4645              if (link_info != NULL)
     4646                p->p_filesz = link_info->relro_end - lp->p_vaddr;
     4647              else if (m->p_size_valid)
     4648                p->p_filesz = m->p_size;
     4649              else
     4650                abort ();
     4651              p->p_memsz = p->p_filesz;
     4652              p->p_align = 1;
     4653              p->p_flags = (lp->p_flags & ~PF_W);
     4654            }
     4655          else if (link_info != NULL)
     4656            {
     4657              memset (p, 0, sizeof *p);
     4658              p->p_type = PT_NULL;
     4659            }
     4660          else
     4661            abort ();
     4662        }
     4663      else if (m->count != 0)
    46104664        {
    46114665          if (p->p_type != PT_LOAD
    46124666              && (p->p_type != PT_NOTE
     
    46224676              p->p_filesz = sect->filepos - m->sections[0]->filepos;
    46234677              if (hdr->sh_type != SHT_NOBITS)
    46244678                p->p_filesz += hdr->sh_size;
    4625 
    4626               if (p->p_type == PT_GNU_RELRO)
    4627                 {
    4628                   /* When we get here, we are copying executable
    4629                      or shared library. But we need to use the same
    4630                      linker logic.  */
    4631                   Elf_Internal_Phdr *lp;
    4632 
    4633                   for (lp = phdrs; lp < phdrs + count; ++lp)
    4634                     {
    4635                       if (lp->p_type == PT_LOAD
    4636                           && lp->p_paddr == p->p_paddr)
    4637                         break;
    4638                     }
    4639          
    4640                   if (lp < phdrs + count)
    4641                     {
    4642                       /* We should use p_size if it is valid since it
    4643                          may contain the first few bytes of the next
    4644                          SEC_ALLOC section.  */
    4645                       if (m->p_size_valid)
    4646                         p->p_filesz = m->p_size;
    4647                       else
    4648                         abort ();
    4649                       p->p_vaddr = lp->p_vaddr;
    4650                       p->p_offset = lp->p_offset;
    4651                       p->p_memsz = p->p_filesz;
    4652                       p->p_align = 1;
    4653                     }
    4654                   else
    4655                     abort ();
    4656                 }
    4657               else
    4658                 p->p_offset = m->sections[0]->filepos;
     4679              p->p_offset = m->sections[0]->filepos;
    46594680            }
    46604681        }
    4661       else
     4682      else if (m->includes_filehdr)
    46624683        {
    4663           if (m->includes_filehdr)
    4664             {
    4665               p->p_vaddr = filehdr_vaddr;
    4666               if (! m->p_paddr_valid)
    4667                 p->p_paddr = filehdr_paddr;
    4668             }
    4669           else if (m->includes_phdrs)
    4670             {
    4671               p->p_vaddr = phdrs_vaddr;
    4672               if (! m->p_paddr_valid)
    4673                 p->p_paddr = phdrs_paddr;
    4674             }
    4675           else if (p->p_type == PT_GNU_RELRO)
    4676             {
    4677               Elf_Internal_Phdr *lp;
    4678 
    4679               for (lp = phdrs; lp < phdrs + count; ++lp)
    4680                 {
    4681                   if (lp->p_type == PT_LOAD
    4682                       && lp->p_vaddr <= link_info->relro_end
    4683                       && lp->p_vaddr >= link_info->relro_start
    4684                       && (lp->p_vaddr + lp->p_filesz
    4685                           >= link_info->relro_end))
    4686                     break;
    4687                 }
    4688 
    4689               if (lp < phdrs + count
    4690                   && link_info->relro_end > lp->p_vaddr)
    4691                 {
    4692                   p->p_vaddr = lp->p_vaddr;
    4693                   p->p_paddr = lp->p_paddr;
    4694                   p->p_offset = lp->p_offset;
    4695                   p->p_filesz = link_info->relro_end - lp->p_vaddr;
    4696                   p->p_memsz = p->p_filesz;
    4697                   p->p_align = 1;
    4698                   p->p_flags = (lp->p_flags & ~PF_W);
    4699                 }
    4700               else
    4701                 {
    4702                   memset (p, 0, sizeof *p);
    4703                   p->p_type = PT_NULL;
    4704                 }
    4705             }
     4684          p->p_vaddr = filehdr_vaddr;
     4685          if (! m->p_paddr_valid)
     4686            p->p_paddr = filehdr_paddr;
     4687        }
     4688      else if (m->includes_phdrs)
     4689        {
     4690          p->p_vaddr = phdrs_vaddr;
     4691          if (! m->p_paddr_valid)
     4692            p->p_paddr = phdrs_paddr;
    47064693        }
    47074694    }
    47084695
  • bfd/Makefile.in

    diff -Naur binutils-2.19.orig/bfd/Makefile.in binutils-2.19/bfd/Makefile.in
    old new  
    271271ACLOCAL_AMFLAGS = -I . -I .. -I ../config
    272272
    273273# Uncomment the following line when doing a release.
    274 RELEASE = y
     274RELEASE=y
    275275INCDIR = $(srcdir)/../include
    276276CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
    277277MKDEP = gcc -MM
  • bfd/version.h

    diff -Naur binutils-2.19.orig/bfd/version.h binutils-2.19/bfd/version.h
    old new  
    1 #define BFD_VERSION_DATE 20081016
     1#define BFD_VERSION_DATE 20090123
    22#define BFD_VERSION @bfd_version@
    33#define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
    44#define REPORT_BUGS_TO @report_bugs_to@
  • binutils/ChangeLog

    diff -Naur binutils-2.19.orig/binutils/ChangeLog binutils-2.19/binutils/ChangeLog
    old new  
     12008-12-23  Nick Clifton  <nickc@redhat.com>
     2
     3        * windmc.c (main): Use correct type for file length.
     4        * dlltool.c (gen_exp_file): Likewise.
     5
     62008-12-01  Nick Clifton  <nickc@redhat.com>
     7
     8        PR 7044
     9        * dlltool.c (run): Use formatting string to avoid compile time
     10        warning.
     11        (gen_exp_file): Check return value from fread.
     12        * windmc.c (main): Check return value from fread.
     13
    1142008-09-25  Richard Henderson  <rth@redhat.com>
    215
    316        * dwarf.c (size_of_encoded_value, get_encoded_value): Move up.
  • binutils/dlltool.c

    diff -Naur binutils-2.19.orig/binutils/dlltool.c binutils-2.19/binutils/dlltool.c
    old new  
    12061206
    12071207  if (pid == -1)
    12081208    {
    1209       inform (strerror (errno));
     1209      inform ("%s", strerror (errno));
    12101210
    12111211      fatal (errmsg_fmt, errmsg_arg);
    12121212    }
     
    19801980      int addr;
    19811981      long need[PAGE_SIZE];
    19821982      long page_addr;
    1983       int numbytes;
     1983      bfd_size_type numbytes;
    19841984      int num_entries;
    19851985      long *copy;
    19861986      int j;
     
    19921992      numbytes = ftell (base_file);
    19931993      fseek (base_file, 0, SEEK_SET);
    19941994      copy = xmalloc (numbytes);
    1995       fread (copy, 1, numbytes, base_file);
     1995      if (fread (copy, 1, numbytes, base_file) < numbytes)
     1996        fatal (_("failed to read the number of entries from base file"));
    19961997      num_entries = numbytes / sizeof (long);
    19971998
    1998 
    19991999      fprintf (f, "\t.section\t.reloc\n");
    20002000      if (num_entries)
    20012001        {
  • binutils/windmc.c

    diff -Naur binutils-2.19.orig/binutils/windmc.c binutils-2.19/binutils/windmc.c
    old new  
    11441144    unichar *u;
    11451145    rc_uint_type ul;
    11461146    char *buff;
    1147     long flen;
     1147    bfd_size_type flen;
    11481148    FILE *fp = fopen (input_filename, "rb");
    11491149
    11501150    if (!fp)
     
    11551155    fseek (fp, 0, SEEK_SET);
    11561156    buff = malloc (flen + 3);
    11571157    memset (buff, 0, flen + 3);
    1158     fread (buff, 1, flen, fp);
     1158    if (fread (buff, 1, flen, fp) < flen)
     1159      fatal (_("unable to read contents of %s"), input_filename);
    11591160    fclose (fp);
    11601161    if (mcset_text_in_is_unicode != 1)
    11611162      {
  • configure.ac

    diff -Naur binutils-2.19.orig/configure.ac binutils-2.19/configure.ac
    old new  
    166166# binutils, gas and ld appear in that order because it makes sense to run
    167167# "make check" in that particular order.
    168168# If --enable-gold is used, "gold" will replace "ld".
    169 host_tools="byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools"
     169host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools"
    170170
    171171# libgcj represents the runtime libraries only used by gcj.
    172172libgcj="target-libffi \
  • gas/ChangeLog

    diff -Naur binutils-2.19.orig/gas/ChangeLog binutils-2.19/gas/ChangeLog
    old new  
     12009-01-14  Jakub Jelinek  <jakub@redhat.com>
     2
     3        * Makefile.am (ehopt.o): Add struc-symbol.h.
     4        * Makefile.in: Regenerated.
     5        * ehopt.c: Include struc-symbol.h.
     6        (check_eh_frame): For very small O_constant DW_CFA_advance_loc4
     7        create correct DW_CFA_advance_loc.  Handle O_subtract only
     8        for code alignment factor 1, otherwise handle O_divide or
     9        O_right_shift of O_subtract and O_constant.
     10        (eh_frame_estimate_size_before_relax): Always divide by ca.
     11        (eh_frame_convert_frag): Likewise.
     12
     132009-01-14  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
     14
     15        * dw2gencfi.c (output_cfi_insn): Scale DW_CFA_advance_loc1,
     16        DW_CFA_advance_loc2 and DW_CFA_advance_loc4 outputs.
     17
     182009-01-08  Adam Nemet  <anemet@caviumnetworks.com>
     19
     20        * config/tc-mips.c (NO_ISA_COP): New macro.
     21        (COP_INSN): New macro.
     22        (is_opcode_valid): Use them.
     23        (macro) <ld_st>: Use them.  Don't accept coprocessor load store
     24        insns based on the ISA if CPU is NO_ISA_COP.
     25        <copz>: Likewise for coprocessor operations.
     26
    1272008-10-09  Eric Botcazou  <ebotcazou@adacore.com>
    228
    329        * dw2gencfi.c (cfi_finish): Deal with md_fix_up_eh_frame.
  • gas/config/tc-mips.c

    diff -Naur binutils-2.19.orig/gas/config/tc-mips.c binutils-2.19/gas/config/tc-mips.c
    old new  
    514514/* Returns true for a (non floating-point) coprocessor instruction.  Reading
    515515   or writing the condition code is only possible on the coprocessors and
    516516   these insns are not marked with INSN_COP.  Thus for these insns use the
    517    condition-code flags unless this is the floating-point coprocessor.  */
     517   condition-code flags.  */
    518518#define COP_INSN(PINFO)                                                 \
    519519  (PINFO != INSN_MACRO                                                  \
    520    && (((PINFO) & INSN_COP)                                             \
    521        || ((PINFO) & (INSN_READ_COND_CODE | INSN_WRITE_COND_CODE)       \
    522            && ((PINFO) & (FP_S | FP_D)) == 0)))
     520   && ((PINFO) & (FP_S | FP_D)) == 0                                    \
     521   && ((PINFO) & (INSN_COP | INSN_READ_COND_CODE | INSN_WRITE_COND_CODE)))
    523522
    524523/* MIPS PIC level.  */
    525524
  • gas/dw2gencfi.c

    diff -Naur binutils-2.19.orig/gas/dw2gencfi.c binutils-2.19/gas/dw2gencfi.c
    old new  
    11/* dw2gencfi.c - Support for generating Dwarf2 CFI information.
    2    Copyright 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
     2   Copyright 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
    33   Contributed by Michal Ludvig <mludvig@suse.cz>
    44
    55   This file is part of GAS, the GNU Assembler.
     
    972972
    973973            if (scaled <= 0x3F)
    974974              out_one (DW_CFA_advance_loc + scaled);
    975             else if (delta <= 0xFF)
     975            else if (scaled <= 0xFF)
    976976              {
    977977                out_one (DW_CFA_advance_loc1);
    978                 out_one (delta);
     978                out_one (scaled);
    979979              }
    980             else if (delta <= 0xFFFF)
     980            else if (scaled <= 0xFFFF)
    981981              {
    982982                out_one (DW_CFA_advance_loc2);
    983                 out_two (delta);
     983                out_two (scaled);
    984984              }
    985985            else
    986986              {
    987987                out_one (DW_CFA_advance_loc4);
    988                 out_four (delta);
     988                out_four (scaled);
    989989              }
    990990          }
    991991        else
  • binutils-2.19

    diff -Naur binutils-2.19.orig/gas/ehopt.c binutils-2.19/gas/ehopt.c
    old new  
    11/* ehopt.c--optimize gcc exception frame information.
    2    Copyright 1998, 2000, 2001, 2003, 2005, 2007 Free Software Foundation, Inc.
     2   Copyright 1998, 2000, 2001, 2003, 2005, 2007, 2008
     3   Free Software Foundation, Inc.
    34   Written by Ian Lance Taylor <ian@cygnus.com>.
    45
    56   This file is part of GAS, the GNU Assembler.
     
    2122
    2223#include "as.h"
    2324#include "subsegs.h"
     25#include "struc-symbol.h"
    2426
    2527/* We include this ELF file, even though we may not be assembling for
    2628   ELF, since the exception frame information is always in a format
     
    398400             subtracted were in the same frag and the expression was
    399401             reduced to a constant.  We can do the optimization entirely
    400402             in this function.  */
    401           if (d->cie_info.code_alignment > 0
    402               && exp->X_add_number % d->cie_info.code_alignment == 0
    403               && exp->X_add_number / d->cie_info.code_alignment < 0x40)
     403          if (exp->X_add_number < 0x40)
    404404            {
    405405              d->loc4_frag->fr_literal[d->loc4_fix]
    406                 = DW_CFA_advance_loc
    407                   | (exp->X_add_number / d->cie_info.code_alignment);
     406                = DW_CFA_advance_loc | exp->X_add_number;
    408407              /* No more bytes needed.  */
    409408              return 1;
    410409            }
     
    419418              *pnbytes = 2;
    420419            }
    421420        }
    422       else if (exp->X_op == O_subtract)
     421      else if (exp->X_op == O_subtract && d->cie_info.code_alignment == 1)
    423422        {
    424423          /* This is a case we can optimize.  The expression was not
    425424             reduced, so we can not finish the optimization until the end
    426425             of the assembly.  We set up a variant frag which we handle
    427426             later.  */
    428           int fr_subtype;
    429 
    430           if (d->cie_info.code_alignment > 0)
    431             fr_subtype = d->cie_info.code_alignment << 3;
    432           else
    433             fr_subtype = 0;
    434 
    435           frag_var (rs_cfa, 4, 0, fr_subtype, make_expr_symbol (exp),
     427          frag_var (rs_cfa, 4, 0, 1 << 3, make_expr_symbol (exp),
    436428                    d->loc4_fix, (char *) d->loc4_frag);
    437429          return 1;
    438430        }
     431      else if ((exp->X_op == O_divide
     432                || exp->X_op == O_right_shift)
     433               && d->cie_info.code_alignment > 1)
     434        {
     435          if (exp->X_add_symbol->bsym
     436              && exp->X_op_symbol->bsym
     437              && exp->X_add_symbol->sy_value.X_op == O_subtract
     438              && exp->X_op_symbol->sy_value.X_op == O_constant
     439              && ((exp->X_op == O_divide
     440                   ? exp->X_op_symbol->sy_value.X_add_number
     441                   : (offsetT) 1 << exp->X_op_symbol->sy_value.X_add_number)
     442                  == (offsetT) d->cie_info.code_alignment))
     443            {
     444              /* This is a case we can optimize as well.  The expression was
     445                 not reduced, so we can not finish the optimization until the
     446                 end of the assembly.  We set up a variant frag which we
     447                 handle later.  */
     448              frag_var (rs_cfa, 4, 0, d->cie_info.code_alignment << 3,
     449                        make_expr_symbol (&exp->X_add_symbol->sy_value),
     450                        d->loc4_fix, (char *) d->loc4_frag);
     451              return 1;
     452            }
     453        }
    439454      break;
    440455
    441456    case state_error:
     
    459474
    460475  diff = resolve_symbol_value (frag->fr_symbol);
    461476
    462   if (ca > 0 && diff % ca == 0 && diff / ca < 0x40)
     477  assert (ca > 0);
     478  diff /= ca;
     479  if (diff < 0x40)
    463480    ret = 0;
    464481  else if (diff < 0x100)
    465482    ret = 1;
     
    496513{
    497514  offsetT diff;
    498515  fragS *loc4_frag;
    499   int loc4_fix;
     516  int loc4_fix, ca;
    500517
    501518  loc4_frag = (fragS *) frag->fr_opcode;
    502519  loc4_fix = (int) frag->fr_offset;
    503520
    504521  diff = resolve_symbol_value (frag->fr_symbol);
    505522
     523  ca = frag->fr_subtype >> 3;
     524  assert (ca > 0);
     525  diff /= ca;
    506526  switch (frag->fr_subtype & 7)
    507527    {
    508528    case 0:
    509       {
    510         int ca = frag->fr_subtype >> 3;
    511         assert (ca > 0 && diff % ca == 0 && diff / ca < 0x40);
    512         loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc | (diff / ca);
    513       }
     529      assert (diff < 0x40);
     530      loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc | diff;
    514531      break;
    515532
    516533    case 1:
  • gas/Makefile.am

    diff -Naur binutils-2.19.orig/gas/Makefile.am binutils-2.19/gas/Makefile.am
    old new  
    21592159dw2gencfi.o: dw2gencfi.c dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
    21602160  subsegs.h $(INCDIR)/obstack.h
    21612161ecoff.o: ecoff.c ecoff.h
    2162 ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h
     2162ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h \
     2163  struc-symbol.h
    21632164expr.o: expr.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h
    21642165flonum-copy.o: flonum-copy.c
    21652166flonum-konst.o: flonum-konst.c
  • gas/Makefile.in

    diff -Naur binutils-2.19.orig/gas/Makefile.in binutils-2.19/gas/Makefile.in
    old new  
    30023002dw2gencfi.o: dw2gencfi.c dw2gencfi.h $(INCDIR)/elf/dwarf2.h \
    30033003  subsegs.h $(INCDIR)/obstack.h
    30043004ecoff.o: ecoff.c ecoff.h
    3005 ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h
     3005ehopt.o: ehopt.c subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h \
     3006  struc-symbol.h
    30063007expr.o: expr.c $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h
    30073008flonum-copy.o: flonum-copy.c
    30083009flonum-konst.o: flonum-konst.c
  • gas/testsuite/ChangeLog

    diff -Naur binutils-2.19.orig/gas/testsuite/ChangeLog binutils-2.19/gas/testsuite/ChangeLog
    old new  
     12009-01-08  Adam Nemet  <anemet@caviumnetworks.com>
     2
     3        * gas/mips/mips1-fp.s, gas/mips/mips1-fp.d, gas/mips/mips1-fp.l:
     4        New tests.
     5        * gas/mips/mips.exp: Run them.
     6
    172008-09-15  Alan Modra  <amodra@bigpond.net.au>
    28
    39        * gas/all/gas.exp: Don't run redef tests on a bunch of targets.
  • gas/testsuite/gas/mips/mips1-fp.d

    diff -Naur binutils-2.19.orig/gas/testsuite/gas/mips/mips1-fp.d binutils-2.19/gas/testsuite/gas/mips/mips1-fp.d
    old new  
     1#as: -32
     2#objdump: -M reg-names=numeric -dr
     3#name: MIPS1 FP instructions
     4
     5.*:     file format .*
     6
     7Disassembly of section .text:
     8
     9[0-9a-f]+ <foo>:
     10.*:     46041000        add.s   \$f0,\$f2,\$f4
     11.*:     44420000        cfc1    \$2,\$0
     12#pass
  • gas/testsuite/gas/mips/mips1-fp.l

    diff -Naur binutils-2.19.orig/gas/testsuite/gas/mips/mips1-fp.l binutils-2.19/gas/testsuite/gas/mips/mips1-fp.l
    old new  
     1.*: Assembler messages:
     2.*:6: Error: opcode not supported on this processor: .* \(.*\) `add.s \$f0,\$f2,\$f4'
     3.*:7: Error: opcode not supported on this processor: .* \(.*\) `cfc1 \$2,\$0'
  • gas/testsuite/gas/mips/mips1-fp.s

    diff -Naur binutils-2.19.orig/gas/testsuite/gas/mips/mips1-fp.s binutils-2.19/gas/testsuite/gas/mips/mips1-fp.s
    old new  
     1# Source file used to test -mips1 fp instructions.
     2
     3# This is not a complete list of mips1 FP instructions.
     4
     5foo:
     6        add.s   $f0,$f2,$f4
     7        cfc1    $2,$0
  • gas/testsuite/gas/mips/mips.exp

    diff -Naur binutils-2.19.orig/gas/testsuite/gas/mips/mips.exp binutils-2.19/gas/testsuite/gas/mips/mips.exp
    old new  
    398398    run_dump_test_arches "abs"          [mips_arch_list_matching mips1]
    399399    run_dump_test_arches "add"          [mips_arch_list_matching mips1]
    400400    run_dump_test_arches "and"          [mips_arch_list_matching mips1]
     401    run_dump_test_arches "mips1-fp"     [mips_arch_list_matching mips1]
     402    run_list_test_arches "mips1-fp" "-32 -msoft-float" \
     403                                        [mips_arch_list_matching mips1]
    401404    run_dump_test "break20"
    402405    run_dump_test "trap20"
    403406
  • ld/ChangeLog

    diff -Naur binutils-2.19.orig/ld/ChangeLog binutils-2.19/ld/ChangeLog
    old new  
    1 2008-10-05  Alan Modra  <amodra@bigpond.net.au>
     12009-01-08  Dave Korn  <dave.korn.cygwin@gmail.com>
    22
    3         PR 6943
    4         * scripttempl/avr.sc (.bss): Set lma when relocating.
    5         (.bss, .noinit): No need to set vma when relocating.
    6         (.text, .bss, ,noinit): Set vma to zero when not relocating.
     3Backport bugfix from HEAD:
    74
    8 2008-09-30  Joseph Myers  <joseph@codesourcery.com>
     5  2009-01-03  Dave Korn  <dave.korn.cygwin@gmail.com>
    96
    10         * emulparams/elf64ppc.sh (OTHER_GOT_RELOC_SECTIONS): Add .rela.opd
    11         and .rela.branch_lt.
     7        * pe-dll.c (autofilter_liblist):  Add entry for shared libgcc.
     8        (libnamencmp):  New function.
     9        (auto_export):  Use it in place of strncmp when filtering libraries.
    1210
    13 2008-09-29  Nick Clifton  <nickc@redhat.com>
    14 
    15         * po/vi.po: Updated Vietnamese translation.
    16 
    17 2008-09-09  Peter Rosin  <peda@lysator.liu.se>  (tiny change)
    18 
    19         * emultempl/pe.em (pe_find_data_imports): Add trailing newline
    20         to warning message.
    21         * emultempl/pep.em (pep_find_data_imports): Likewise.
    22 
    23 2008-09-09  Alan Modra  <amodra@bigpond.net.au>
    24 
    25         * Makefile.am: Run "make dep-am".
    26         * Makefile.in: Regenerate.
    27         * po/ld.pot: Regenerate.
    28 
    29 2008-09-09  Alan Modra  <amodra@bigpond.net.au>
    30 
    31         * emultempl/beos.em (gld${EMULATION_NAME}_place_orphan): Updated.
    32         * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): Ditto.
    33 
    34 2008-09-08  Tristan Gingold  <gingold@adacore.com>
    35 
    36         * NEWS: Add a marker for the 2.19 features.
    37 
    38 2008-09-07  Alan Modra  <amodra@bigpond.net.au>
    39 
    40         * ldlang.h (lang_output_section_find): Define.
    41         (lang_output_section_statement_lookup): Update prototype.
    42         * ldlang.c (lang_output_section_find,
    43         lang_output_section_statement_lookup_1): Merge into..
    44         (lang_output_section_statement_lookup): ..here.  Update all callers.
    45         (process_insert_statements): Set constraint negative
    46         for output section statements we might be inserting.  Make error
    47         fatal on not finding insertion section.
    48         (lang_output_section_find): Rather than comparing
    49         output_section_statement.constraint against -1, test whether
    50         it is postive.
    51         (lang_output_section_statement_lookup_1): Likewise.
    52         (output_prev_sec_find, strip_excluded_output_sections): Likewise.
    53         (lang_record_phdrs): Likewise.
    54         * emultempl/elf32.em (output_rel_find): Likewise.
    55         * NEWS: Mention INSERT.
    56 
    57 2008-08-26  Nick Clifton  <nickc@redhat.com>
    58 
    59         PR 6727
    60         * emultempl/armelf.em (arm_elf_set_bfd_for_interworking): Scan all
    61         input sections in all input bfds and always select the last
    62         suitable one, so that interworking stubs are always processed
    63         after all other input sections.
    64         (arm_elf_before_allocation): Remove redundant use of
    65         output_has_begun flag.
    66 
    67 2008-08-24  Alan Modra  <amodra@bigpond.net.au>
    68 
    69         * configure.in: Update a number of obsolete autoconf macros.
    70         * configure: Regenerate.
    71         * aclocal.m4: Regenerate.
    72 
    73 2008-08-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
    74 
    75         PR ld/6833
    76         * ldexp.c (fold_binary <DATA_SEGMENT_ALIGN>): Do not align
    77         EXPLD.DATASEG.MIN_BASE.
    78         * ldlang.c (lang_size_sections): New variable OLD_BASE.  Rename
    79         OLD_MIN_BASE to MIN_BASE with the former alignment from `ldexp.c'.
    80         Use OLD_BASE now for the minimal base check after the base decrease by
    81         the maximum alignment found.
    82 
    83 2008-08-17  Alan Modra  <amodra@bigpond.net.au>
    84 
    85         PR 6478
    86         * ldcref.c (check_local_sym_xref): Use bfd_generic_link_read_symbols.
    87         Don't free symbol pointer array.
    88         (check_refs): Likewise.
    89         * ldmain.c (warning_callback): Likewise.
    90         * ldmisc.c (vfinfo): Likewise.
    91         * pe-dll.c (process_def_file): Likewise.
    92         (pe_walk_relocs_of_symbol, generate_reloc): Likewise.
    93         * emultempl/pe.em (pe_find_data_imports): Likewise.
    94         (gld_${EMULATION_NAME}_after_open): Likewise.
    95         * emultempl/pep.em (pep_find_data_imports): Likewise.
    96         (gld_${EMULATION_NAME}_after_open): Likewise.
    97         * ldlang.h (lang_input_statement_type): Delete asymbols, symbol_count,
    98         passive_position, closed.
    99         * ldlang.c (new_afile): Don't set asymbols and symbol_count.
    100         * ldmain.c (add_archive_element): xcalloc lang_input_statement_type.
    101 
    102 2008-08-15  Alan Modra  <amodra@bigpond.net.au>
    103 
    104         PR 6526
    105         * configure.in: Invoke AC_USE_SYSTEM_EXTENSIONS.
    106         * Makefile.in: Regenerate.
    107         * aclocal.m4: Regenerate.
    108         * config.in: Regenerate.
    109         * configure: Regenerate.
    110 
    111 2008-08-09  Alan Modra  <amodra@bigpond.net.au>
    112 
    113         PR 6753
    114         * ldmain.c (check_for_scripts_dir, set_scripts_dir): Delete.
    115         (main): Don't set_scripts_dir here.
    116         * ldfile.c (check_for_scripts_dir, find_scripts_dir): New functions,
    117         largely based on ldmain.c versions.
    118         (ldfile_find_command_file): Set up search in script dir here without
    119         affecting library search.
    120         * Makefile.am (ldmain.o): No need to define SCRIPTDIR.
    121         (ldfile.o): New rule.
    122         * Makefile.in: Regenerate.
    123 
    124 2008-08-08  Anatoly Sokolov  <aesok@post.ru>
    125 
    126         * Makefile.am (ALL_EMULATIONS): Add eavr25.o, eavr31.o, eavr35.o,
    127         and eavr51.o.
    128         Add rules for eavr25.c, eavr31.c, eavr35.c, eavr51.c.
    129         * Makefile.in: Regenerate.
    130         * configure.tgt (avr-*-*, targ_extra_emuls): Add avr25, avr31, avr35
    131         and avr51.
    132         * emulparams/avr25.sh: New file.
    133         * emulparams/avr31.sh: New file.
    134         * emulparams/avr35.sh: New file.
    135         * emulparams/avr51.sh: New file.
    136 
    137 2008-08-08  Richard Sandiford  <rdsandiford@googlemail.com>
    138             Daniel Jacobowitz  <dan@codesourcery.com>
    139 
    140         * emulparams/elf32bmip.sh (GOT): Define, moving .got.plt to...
    141         (OTHER_RELRO_SECTIONS, OTHER_READWRITE_SECTIONS): ...one of these
    142         two variables.
    143         * emulparams/elf32bmipn32-defs.sh: Likewise.
    144         * emultempl/mipself.em: Include ldctor.h, elf/mips.h and elfxx-mips.h.
    145         (is_mips_elf): New macro.
    146         (stub_file, stub_bfd): New variables.
    147         (hook_stub_info): New structure.
    148         (hook_in_stub): New function.
    149         (mips_add_stub_section): Likewise.
    150         (mips_create_output_section_statements): Likewise.
    151         (mips_before_allocation): Likewise.
    152         (real_func): New variable.
    153         (mips_for_each_input_file_wrapper): New function.
    154         (mips_lang_for_each_input_file): Likewise.
    155         (lang_for_each_input_file): Define.
    156         (LDEMUL_BEFORE_ALLOCATION): Likewise.
    157         (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Likewise.
    158 
    159 2008-08-08  Alan Modra  <amodra@bigpond.net.au>
    160 
    161         * ldfile.c (ldfile_open_file_search): Use concat.
    162         (try_open): Don't use a fixed size pathname buffer.
    163         (ldfile_find_command_file): Likewise.
    164         * emultempl/elf32.em (gld${EMULATION_NAME}_open_dynamic_archive): If
    165         using EXTRA_SHLIB_EXTENSION, don't open twice.
    166 
    167 2008-08-04  Alan Modra  <amodra@bigpond.net.au>
    168 
    169         * Makefile.am (POTFILES.in): Set LC_ALL=C.
    170         * Makefile.in: Regenerate.
    171         * po/POTFILES.in: Regenerate.
    172 
    173 2008-08-03  Alan Modra  <amodra@bigpond.net.au>
    174 
    175         * Makefile.am (spu_ovl.o): Merge rule into..
    176         (spu_ovl.o_c): ..this one.  Only run cpp for spu target.
    177         * Makefile.in: Regenerate.
    178 
    179 2008-08-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
    180 
    181         Include the spu_ovl ASCII form in the repository files.
    182         * emultempl/spuelf.em: No longer use `bin2c', use now `spu_ovl.o_c'.
    183         * Makefile.am (eelf32_spu.c): Depend now on `spu_ovl.o_c'.
    184         ($(srcdir)/emultempl/spu_ovl.o_c): New target.
    185         ($(srcdir)/emultempl/spu_ovl.o): Rename to...
    186         (spu_ovl.o): ...this one.
    187         * Makefile.in: Regenerate.
    188         * emultempl/spu_ovl.o_c: New file.
    189         * emultempl/spu_ovl.o: File removed.
    190 
    191 2008-07-31  Takashi Ono  <t_ono@hkfreak.net>
    192 
    193         * pe-dll.c (generate_relocs): Don't generate relocs for
    194         undefined weak symbols.
    195 
    196 2008-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
    197 
    198         * emultempl/spuelf.em: Abort on the missing required `spu_ovl.o'.
    199 
    200 2008-07-30  Alan Modra  <amodra@bigpond.net.au>
    201 
    202         * emultempl/pe.em, emultempl/pep.em: Silence gcc warnings.
    203 
    204 2008-07-18  Joseph Myers  <joseph@codesourcery.com>
    205 
    206         * ld.texinfo (--no-wchar-size-warning): Document new ARM option.
    207         * emultempl/armelf.em (no_wchar_size_warning): New.
    208         (arm_elf_create_output_section_statements): Pass
    209         no_wchar_size_warning to arm_elf_create_output_section_statements.
    210         (OPTION_NO_WCHAR_SIZE_WARNING): New.
    211         (PARSE_AND_LIST_LONGOPTS): Add no-wchar-size-warning.
    212         (PARSE_AND_LIST_OPTIONS): List --no-wchar-size-warning.
    213         (PARSE_AND_LIST_ARGS_CASES): Handle --no-wchar-size-warning.
    214 
    215 2008-07-15  Jie Zhang  <jie.zhang@analog.com>
    216 
    217         * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define.
    218 
    219 2008-07-12  Craig Silverstein  <csilvers@google.com>
    220 
    221         PR ld/6741
    222         * configure.in: Check for, and include, libz.a if it is present.
    223         * configure: Regenerate.
    224         * config.in: Regenerate.
    225 
    226 2008-07-12  Jie Zhang  <jie.zhang@analog.com>
    227 
    228         Revert
    229         2008-07-12  Jie Zhang  <jie.zhang@analog.com>
    230         * Makefile.am (eelf32bfin.c): Depend on bfin.em.
    231         (eelf32bfinfd.c): Likewise.
    232         * Makefile.in: Regenerate.
    233         * gen-doc.texi: Set Blackfin.
    234         * ld.texinfo: Document --sep-code and Blackfin specific
    235         options.
    236         * ldmain.c (main): Initialize link_info.sep_code.
    237         * lexsup.c (enum option_values): Add OPTION_SEP_CODE.
    238         (ld_options[]): Add --sep-code.
    239         (parse_args): Deal with --sep-code.
    240         * emulparams/bfin.sh (EXTRA_EM_FILE): Define.
    241         * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define.
    242         * emultempl/bfin.em: New file.
    243 
    244 2008-07-12  Jie Zhang  <jie.zhang@analog.com>
    245 
    246         * Makefile.am (eelf32bfin.c): Depend on bfin.em.
    247         (eelf32bfinfd.c): Likewise.
    248         * Makefile.in: Regenerate.
    249         * gen-doc.texi: Set Blackfin.
    250         * ld.texinfo: Document --sep-code and Blackfin specific
    251         options.
    252         * ldmain.c (main): Initialize link_info.sep_code.
    253         * lexsup.c (enum option_values): Add OPTION_SEP_CODE.
    254         (ld_options[]): Add --sep-code.
    255         (parse_args): Deal with --sep-code.
    256         * emulparams/bfin.sh (EXTRA_EM_FILE): Define.
    257         * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define.
    258         * emultempl/bfin.em: New file.
    259 
    260 2008-07-09  Danny Smith  <dannysmith@users.sourceforge.net>
    261 
    262            *pe-dll.c (autofilter_symbolprefixlist): Excude all symbols
    263            starting with ".".
    264            Exclude "_IMPORT_DESCRIPTOR_".
    265            (autofilter_symbolsuffixlist): Exclude "_NULL_THUNK_DATA".
    266            (autofilter_symbollist_generic): Don't check for ".text".
    267            Exclude "_NULL_IMPORT_DESCRIPTOR".
    268            (autofilter_symbollist_i386): Likewise.
    269 
    270 2008-07-07  Alan Modra  <amodra@bigpond.net.au>
    271 
    272         * emultempl/armelf.em (elf32_arm_add_stub_section): Use
    273         bfd_make_section_with_flags.
    274         * emultempl/avrelf.em (avr_elf_create_output_section_statements):
    275         Likewise.
    276         * emultempl/hppaelf.em (hppaelf_add_stub_section): Likewise.
    277         * emultempl/m68hc1xelf.em (m68hc11elf_add_stub_section): Likewise.
    278         * emultempl/m68kcoff.em (gld${EMULATION_NAME}_after_open): Likewise.
    279         * emultempl/m68kelf.em (m68k_elf_after_open): Likewise.
    280         * emultempl/ppc64elf.em (ppc_add_stub_section): Likewise.
    281         * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation):
    282         Likewise.
    283 
    284 2008-07-06  Nathan Sidwell  <nathan@codesourcery.com>
    285 
    286         * ld.texinfo (File Commands): Document that INCLUDE can be used in
    287         several different places.
    288         * ldgram.y (statement, memory_spec, section): Allow INCLUDE.
    289         (memory, memory_spec_list): Simplify BNF
    290         (memory_spec_list_opt): New rule.
    291         * ldlex.l (INCLUDE): Recognize in EXPRESSION.
    292 
    293 2008-06-20  Alan Modra  <amodra@bigpond.net.au>
    294 
    295         * emultempl/spuelf.em (gld${EMULATION_NAME}_finish): Make "can not
    296         build overlay stubs" a fatal error.
    297 
    298 2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
    299 
    300         * config.in: Regenerate.
    301         * configure: Regenerate.
    302 
    303 2008-06-17  Alan Modra  <amodra@bigpond.net.au>
    304 
    305         * emultempl/spuelf.em (extra_stack_space): New variable.
    306         (gld${EMULATION_NAME}_finish): Pass it to spu_elf_check_vma.
    307         (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS,
    308         PARSE_AND_LIST_ARGS_CASES): Handle --extra-stack-space.
    309         * emultempl/spu_ovl.S: Mask interrupts during dma and update of
    310         overlay manager structures.
    311         * emultempl/spu_ovl.o: Regenerate.
    312 
    313 2008-06-16  Hans-Peter Nilsson  <hp@bitrange.com>
    314 
    315         * ld.texinfo (@node MMIX): For the __.MMIX.start. prefix, only
    316         mention it as being special for global symbols.
    317 
    318 2008-06-12  Nick Clifton  <nickc@redhat.com>
    319 
    320         * ldlang.c (print_output_section_statement): If the output section
    321         statement has an update_dot_tree expression, apply it to
    322         print_dot.
    323         (print_input_section): Do not update print_dot if it would move
    324         print_dot backwards.
    325         (lang_do_assignments_1): If the output section statement has an
    326         update_dot_tree expression apply it to dot.
    327 
    328 2008-06-07  Alan Modra  <amodra@bigpond.net.au>
    329 
    330         * NEWS: Mention archive:path patterns.
    331         * ld.texinfo: Likewise.
    332         * ldlang.c: Formatting throughout.
    333         (archive_path): Only assume "[A-Za-z]:" is a dos drive.
    334         (input_statement_is_archive_path): New function, extracted from..
    335         (walk_wild): ..here.
    336         (walk_wild_consider_section): Match archive:path here too.
    337         (init_map_userdata, sort_def_symbol): Convert to ISO C.
    338         * ldmain.c (main): Set link_info.path_separator.
    339         * emultempl/spuelf.em (choose_target): Don't set it here.
    340 
    341 2008-06-06  Alan Modra  <amodra@bigpond.net.au>
    342 
    343         * ldlang.c (name_match): New function.
    344         (unique_section_p, walk_wild_consider_section): Use it here.
    345         (walk_wild_section_general): And here.
    346         (archive_path): New function.
    347         (walk_wild): Match archive:path filespecs.
    348         (open_input_bfds): Don't load archive:path files.
    349         * emultempl/spuelf.em (choose_target): Set path_separator.
    350         * emulparams/elf32_spu.sh: Add ._ea.* sections to ._ea output.
    351 
    352 2008-06-04  Nick Clifton  <nickc@redhat.com>
    353 
    354         * ld.texinfo (Orphan Sections): Fix texi typo.
    355 
    356 2008-06-04  Chris Metcalf  <cmetcalf@tilera.com>
    357 
    358         * lexsup.c (option_values): Add OPTION_NO_WARN_FATAL.
    359         (ld_options): Add entry for --no-fatal-warnings.
    360         (parse_args): Handle OPTION_NO_WARN_FATAL.
    361         * ld.texinfo (Options): Document new command line switch.
    362 
    363 2008-06-04  Alan Modra  <amodra@bigpond.net.au>
    364 
    365         * emultempl/spuelf.em (spu_elf_relink): Correct --no-auto-overlay arg.
    366 
    367 2008-06-02  Nathan Sidwell  <nathan@codesourcery.com>
    368 
    369         * ldlang.c (closest_target_match): Skip generic big and little
    370         endian ELF targets.
    371 
    372 2008-05-31  Evandro Menezes  <evandro@yahoo.com>
    373 
    374         PR ld/6430
    375         * ld.h (enum sort_order): New.
    376         * ldlang.c (lang_check: Fix comment.
    377         (lang_common): Sort commons in ascending or descending order.
    378         (lang_one_common): Likewise.
    379         * lexsup.c (ld_options): Have --sort-common take an option
    380         argument.
    381         (parse_args): Handle argument to --sort-common.
    382         * ld.texinfo (--sort-common): Document new optional argument.
    383         * NEWS: Mention new feature.
    384 
    385 2008-05-28  Christophe Lyon  <christophe.lyon@st.com>
    386        
    387         * ld.texinfo: State that farcalls stubs are supported for ARM-EABI
    388         only.
    389 
    390 2008-05-27  Kai Tietz  <kai.tietz@onevision.com>
    391 
    392         * pe-dll.c (fill_edata): Make sure we calculate vma's in
    393         type bfd_vma.
    394         (generate_reloc): Likewise.
    395         (pe_implied_import_dll): Likewise.
    396 
    397 2008-05-21  Nick Clifton  <nickc@redhat.com>
    398 
    399         PR ld/6519
    400         * ld.texinfo (Orphan Sections): Mention that the linker will
    401         provide start and stop symbols for orphaned sections if their
    402         names are valid C identifiers.
    403         * NEWS: Add an addendum to the description of the linker feature
    404         for providing orphan section start and end symbols.
    405 
    406 2008-05-21  Maxim Kuvyrkov  <maxim@codesourcery.com>
    407 
    408         * configure.in (--enable-got): New option.  Handle it.
    409         * configure: Regenerate.
    410         * config.in: Regenerate.
    411         * emultempl/m68kelf.em: (got_handling_target_default): New shell
    412         variable.
    413         (GOT_HANDLING_TARGET_DEFAULT): New macro.
    414         (GOT_HANDLING_DEFAULT): New macro.  Initialize it from configure
    415         option if one was given.
    416         (got_handling): New static variable.
    417         (elf_m68k_create_output_section_statements): New static function
    418         implementing hook.
    419         (PARSE_AND_LIST_PROLOGUE): Define shell variable.
    420         (OPTION_GOT): New macro.
    421         (PARSE_AND_LIST_LONGOPTS): Define shell variable.  Specify
    422         --got option.
    423         (got): New linker option.
    424         (PARSE_AND_LIST_OPTIONS): Define shell variable.  Print help string
    425         for --got option.
    426         (PARSE_AND_LIST_ARGS_CASES): Define shell variable.  Handle --got
    427         option.
    428         * ld.texinfo: Document --got=<type> option.
    429         * gen-doc.texi: Add M68K.
    430         * NEWS: Mention the new feature.
    431 
    432 2008-05-21  Evandro Menezes  <evandro@yahoo.com>
    433 
    434         PR ld/6430
    435         * ld.texinfo (--sort-common): Correct documentation to indicate
    436         that sorting is performed by alignment, not size, biggest
    437         alignment first.
    438 
    439 2008-05-21  Christophe Lyon  <christophe.lyon@st.com>
    440             Nick Clifton  <nickc@redhat.com>
    441 
    442         * ld.texinfo (ARM): Document --stub-group-size=N option.
    443         Move description of --pic-veneer option into the ARM section.
    444         * NEWS: Mention the support for long function calls.
    445 
    446 2008-05-15  Christophe Lyon  <christophe.lyon@st.com>
    447        
    448         * emultempl/armelf.em (build_section_lists): New function.
    449         (stub_file): Define.
    450         (need_laying_out): Define.
    451         (group_size): Define.
    452         (hook_stub_info): Define.
    453         (hook_in_stub): New function.
    454         (elf32_arm_add_stub_section): New function.
    455         (gldarm_layout_sections_again): New function.
    456         (gld${EMULATION_NAME}_finish): Replace arm_elf_finish(). Generate
    457         stubs for long calls if needed.
    458         (arm_elf_create_output_section_statements): create stub_file bfd.
    459         (arm_for_each_input_file_wrapper): New function.
    460         (arm_lang_for_each_input_file): New function.
    461         (lang_for_each_input_file): Define.
    462         (PARSE_AND_LIST_PROLOGUE): Add option token OPTION_STUBGROUP_SIZE.
    463         (PARSE_AND_LIST_LONGOPTS): Add option stub-group-size.
    464         (PARSE_AND_LIST_OPTIONS): Add option stub-group-size.
    465         (PARSE_AND_LIST_ARGS_CASES): Add OPTION_STUBGROUP_SIZE case.
    466         (LDEMUL_FINISH): Update to gld${EMULATION_NAME}_finish.
    467         * lang.c (print_input_statement): Skip if bfd has
    468         BFD_LINKER_CREATED.
    469 
    470 2008-05-14  Alan Modra  <amodra@bigpond.net.au>
    471 
    472         * Makefile.in: Regenerate.
    473 
    474 2008-05-09  Kai Tietz  <kai.tietz@onevision.com>
    475 
    476         ld/PR6502
    477         * emultempl/pep.em (compute_dll_image_base): Use bfd_vma instead
    478         of long and change return type to bfd_vma.
    479         (definfo): Change type of address from long to bfd_vma.
    480         (set_pep_value): Replace strtoul to strtoull.
    481         (gld_${EMULATION_NAME}_set_symbols): use bfd_vma instead of long..
    482         * pe-dll.c (pe_dll_generate_def_file): Use fprintf_vma to print
    483         ImageBase.
    484         (quick_reloc): Change argument address from int to bfd_size_type.
    485 
    486 2008-05-08  Tom Tromey  <tromey@redhat.com>
    487 
    488         * ld.texinfo (PowerPC64 ELF64): Fix typo.
    489 
    490 2008-05-08  Alan Modra  <amodra@bigpond.net.au>
    491 
    492         * elf32_spu.sh (OTHER_SECTIONS): Add "._ea".
    493         * elf32ppc.sh: If building with spu support, put ".data.spehandle"
    494         sections at the start of ".data" and provide a symbol to locate
    495         the directory of embedded spe programs.
    496 
    497 2008-05-08  Alan Modra  <amodra@bigpond.net.au>
    498 
    499         * ldexp.c (exp_print_token): Add ABSOLUTE, MIN_K, ASSERT_K.  Correct
    500         MAX_K.
    501         (fold_binary <SEGMENT_START>): Set expld.result.section to
    502         current section.  Expand comment.  Formatting.
    503         (fold_name <DEFINED>): Set expld.result.section to current section.
    504 
    505 2008-04-28  Nathan Sidwell  <nathan@codesourcery.com>
    506 
    507         * ldlang.c (lang_size_sections_1): Don't check LMA overflow on
    508         non-load sections.
    509 
    510 2008-04-25  Michael Frysinger  <vapier@gentoo.org>
    511 
    512         * configure.tgt (bfin-*-linux-uclibc*): Set targ_emul to elf32bfinfd
    513         and targ_extra_emuls to elf32bfin.
    514 
    515 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
    516 
    517         * aclocal.m4: Regenerate.
    518         * configure: Regenerate.
    519 
    520 2008-04-03  Kai Tietz  <kai.tietz@onevision.com>
    521 
    522         * scripttempl/pep.sc: Align start of symbol __CTOR_LIST__.
    523 
    524 2008-04-08  Alan Modra  <amodra@bigpond.net.au>
    525 
    526         * po/POTFILES.in: Regenerate.
    527 
    528 2008-04-08  Alan Modra  <amodra@bigpond.net.au>
    529 
    530         * emultempl/spuelf.em (auto_overlay, auto_overlay_file,
    531         auto_overlay_fixed, auto_overlay_reserved, my_argc, my_argv): New vars.
    532         (spu_before_allocation): Warn on --auto-overlay and existing overlays.
    533         (struct tflist, clean_tmp): Move.
    534         (new_tmp_file): New function, extracted from..
    535         (embedded_spu_file): ..here.
    536         (spu_elf_open_overlay_script, spu_elf_relink): New function.
    537         (gld${EMULATION_NAME}_finish): Pass a bunch of --auto-overlay params.
    538         Warn on --auto-overlay and zero local store.
    539         (gld${EMULATION_NAME}_choose_target): New function to stash argv.
    540         (OPTION_SPU_AUTO_OVERLAY, OPTION_SPU_AUTO_RELINK,
    541         OPTION_SPU_OVERLAY_RODATA, OPTION_SPU_FIXED_SPACE,
    542         OPTION_SPU_RESERVED_SPACE, OPTION_SPU_NO_AUTO_OVERLAY): Define.
    543         (PARSE_AND_LIST_LONGOPTS): Add entries for new options.
    544         (PARSE_AND_LIST_OPTIONS): Likewise.
    545         (PARSE_AND_LIST_ARGS_CASES): Likewise.
    546         (LDEMUL_CHOOSE_TARGET): Define.
    547 
    548 2008-04-03  Kai Tietz  <kai.tietz@onevision.com>
    549 
    550         PR ld/6026
    551         * pe-dll.c (make_head): Fix iat and thunk addend offset.
    552 
    553 2008-03-31  Nick Clifton  <nickc@redhat.com>
    554 
    555         * po/fr.po: Updated French translation.
    556 
    557 2008-03-24  Ian Lance Taylor  <iant@google.com>
    558 
    559         The sha1 code is now in libiberty.
    560         * sha1.c: Remove.
    561         * sha1.h: Remove.
    562         * Makefile.am (CFILES): Remove sha1.c.
    563         (HFILES): Remove sha1.h.
    564         (OFILES): Remove sha1.o.
    565         (ld_new_SOURCES): Remove sha1.c.
    566         (sha1.o): Remove target.
    567         * Makefile.in: Rebuild.
    568 
    569 2008-03-20  Alan Modra  <amodra@bigpond.net.au>
    570 
    571         * emultempl/spuelf.em: Update calls to elf32-spu.c funcs.
    572 
    573 2008-03-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
    574 
    575         * aclocal.m4: Regenerate.
    576         * configure: Likewise.
    577         * Makefile.in: Likewise.
    578 
    579 2008-03-14  Alan Modra  <amodra@bigpond.net.au>
    580 
    581         * emultempl/spuelf.em (gld${EMULATION_NAME}_finish): Protect
    582         spu_elf_build_stubs with is_spu_target.
    583 
    584 2008-03-13  Alan Modra  <amodra@bigpond.net.au>
    585 
    586         * Makefile.am: Run "make dep-am".
    587         * Makefile.in: Regenerate.
    588         * configure: Regenerate.
    589 
    590 2008-03-06  Joseph Myers  <joseph@codesourcery.com>
    591             Roman Zippel  <zippel@linux-m68k.org>
    592 
    593         * emulparams/m68kelf.sh (GENERATE_PIE_SCRIPT): Define.
    594         (COMMONPAGESIZE): Define.
    595 
    596 2008-02-22  Nick Clifton  <nickc@redhat.com>
    597 
    598         PR ld/5785
    599         * ldlang.c (lang_size_sections_1): Honour the setting of an
    600         lma_region even if there is no vma region set, or the vma region
    601         is the same as the lma region.
    602 
    603 2008-02-18  Nick Clifton  <nickc@redhat.com>
    604 
    605         * scripttempl/armbpabi.sc (ENTRY): Do not define when performing a
    606         relocatable link.
    607         * scripttempl/elf32cr16.sc: Likewise.
    608         * scripttempl/elf32cr16c.sc: Likewise.
    609         * scripttempl/elf32crx.sc: Likewise.
    610         * scripttempl/elf32sh-symbian.sc: Likewise.
    611         * scripttempl/elf_chaos.sc: Likewise.
    612         * scripttempl/elfd10v.sc: Likewise.
    613         * scripttempl/elfi370.sc: Likewise.
    614         * scripttempl/elfm68hc11.sc: Likewise.
    615         * scripttempl/elfm68hc12.sc: Likewise.
    616         * scripttempl/ip2k.sc: Likewise.
    617         * scripttempl/iq2000.sc: Likewise.
    618         * scripttempl/mep.sc: Likewise.
    619         * scripttempl/v850.sc: Likewise.
    620         * scripttempl/xstormy16.sc: Likewise.
    621 
    622 2008-02-16  Alan Modra  <amodra@bigpond.net.au>
    623 
    624         PR ld/5761
    625         * ldexp.c (fold_name <LOADADDR>): Check result of evaluating
    626         load_base before calling make_abs.
    627 
    628 2008-02-15  Alan Modra  <amodra@bigpond.net.au>
    629 
    630         * emultempl/alphaelf.em (alpha_after_open): Use elf_object_id.
    631         * emultempl/hppaelf.em (hppaelf_create_output_section_statements):
    632         Likewise.
    633         * emultempl/ppc64elf.em (ppc_create_output_section_statements):
    634         Likewise.
    635         * emultempl/ppc32elf.em (is_ppc_elf32_vec): Delete.  Replace all
    636         uses with..
    637         (is_ppc_elf): ..this new macro.
    638 
    639 2008-02-15  Alan Modra  <amodra@bigpond.net.au>
    640 
    641         * ldmain.h (output_bfd): Delete.
    642         * ldmain.c (output_bfd): Delete.
    643         Replace all occurrences of output_bfd with link_info.output_bfd.
    644         * ldcref.c: Likewise.
    645         * ldctor.c: Likewise.
    646         * ldemul.c: Likewise.
    647         * ldexp.c: Likewise.
    648         * ldfile.c: Likewise.
    649         * ldlang.c: Likewise.
    650         * ldmisc.c: Likewise.
    651         * ldwrite.c: Likewise.
    652         * pe-dll.c: Likewise.
    653         * emultempl/aix.em: Likewise.
    654         * emultempl/alphaelf.em: Likewise.
    655         * emultempl/armcoff.em: Likewise.
    656         * emultempl/armelf.em: Likewise.
    657         * emultempl/avrelf.em: Likewise.
    658         * emultempl/beos.em: Likewise.
    659         * emultempl/elf-generic.em: Likewise.
    660         * emultempl/elf32.em: Likewise.
    661         * emultempl/gld960.em: Likewise.
    662         * emultempl/hppaelf.em: Likewise.
    663         * emultempl/irix.em: Likewise.
    664         * emultempl/linux.em: Likewise.
    665         * emultempl/lnk960.em: Likewise.
    666         * emultempl/m68hc1xelf.em: Likewise.
    667         * emultempl/mmix-elfnmmo.em: Likewise.
    668         * emultempl/mmo.em: Likewise.
    669         * emultempl/pe.em: Likewise.
    670         * emultempl/pep.em: Likewise.
    671         * emultempl/ppc32elf.em: Likewise.
    672         * emultempl/ppc64elf.em: Likewise.
    673         * emultempl/scoreelf.em: Likewise.
    674         * emultempl/sh64elf.em: Likewise.
    675         * emultempl/spuelf.em: Likewise.
    676         * emultempl/sunos.em: Likewise.
    677         * emultempl/vanilla.em: Likewise.
    678         * emultempl/vxworks.em: Likewise.
    679         * emultempl/xtensaelf.em: Likewise.
    680         * emultempl/z80.em: Likewise.
    681         * ldlang.c (open_output): Don't return output, instead write
    682         link_info_output_bfd directly.
    683         * emultempl/alphaelf.em: Replace occurrences of link_info.hash->creator
    684         with link_info.output_bfd->xvec.
    685         * emultempl/hppaelf.em: Likewise.
    686         * emultempl/ppc32elf.em: Likewise.
    687         * emultempl/ppc64elf.em: Likewise.
    688         * emultempl/spuelf.em: Likewise.
    689 
    690 2008-02-07  Alan Modra  <amodra@bigpond.net.au>
    691 
    692         * ldlang.c (new_afile): Don't pass unadorned NULL to concat.
    693         * ldfile.c (ldfile_add_library_path): Likewise.
    694         * emultempl/elf32.em (check_ld_elf_hints, check_ld_so_conf): Likewise.
    695         * emultempl/lnk960.em (lnk960_before_parse): Likewise.
    696         * emultempl/spuelf.em (embedded_spu_file): Likewise.
    697 
    698 2008-02-07  Alan Modra  <amodra@bigpond.net.au>
    699 
    700         * emultempl/spu_ovl.S: Use low bit of _ovly_table.size as
    701         a "present" bit rather than low bit of .buf.  Correct indexing
    702         into _ovly_buf_table.  Use relative loads and stores to access
    703         overlay manager local vars.
    704         * emultempl/spu_ovl.o: Regenerate.
    705 
    706 2008-02-04  H.J. Lu  <hongjiu.lu@intel.com>
    707 
    708         PR 5715
    709         * configure: Regenerated.
    710 
    711 2008-01-31  Marc Gauthier  <marc@tensilica.com>
    712 
    713         * configure.tgt (xtensa*-*-*): Recognize processor variants.
    714 
    715 2008-01-28  Fabian Groffen  <grobian@gentoo.org>
    716 
    717         * configure.tgt (x86_64-*-solaris2): Add support for this target.
    718 
    719 2008-01-28  Vincent Riviere  <vincent.riviere@freesbee.fr>
    720 
    721         PR ld/5652
    722         * genscripts.sh: Check for the existence of BASH_LINENO not just
    723         the BASH shell before generating line numbers in the emulation
    724         file.
    725 
    726 2008-01-28  Alan Modra  <amodra@bigpond.net.au>
    727 
    728         * emultempl/spu_ovl.S: Rewrite.
    729         * emultempl/spu_ovl.o: Regenerate.
    730         * emultempl/spuelf.em (toe): Delete.
    731         (spu_place_special_section): Add param to control section placement.
    732         Adjust callers.
    733         (spu_elf_load_ovl_mgr): Adjust for struct _spu_elf_section_data
    734         changes.
    735         (spu_before_allocation): Adjust spu_elf_size_stubs call.
    736         (gld${EMULATION_NAME}_finish): Adjust spu_elf_build_stubs call.
    737 
    738 2008-01-25  H.J. Lu  <hongjiu.lu@intel.com>
    739 
    740         PR ld/5670
    741         * ldlang.c (process_insert_statements): Silence gcc 4.1 alias
    742         warning.
    743 
    744 2008-01-25  Alan Modra  <amodra@bigpond.net.au>
    745 
    746         * ld.texinfo (INSERT): Describe.
    747         * ldgram.y (ldgram_in_script, ldgram_had_equals): Delete.
    748         (INSERT_K, AFTER, BEFORE): Add as tokens.
    749         (ifile_p1): Handle INSERT statements.
    750         (saved_script_handle, force_make_executable): Move to..
    751         * ldmain.c: ..here.
    752         (previous_script_handle): New global var.
    753         * ldmain.h (saved_script_handle, force_make_executable): Declare.
    754         (previous_script_handle): Likewise.
    755         * ldlex.l (INSERT_K, AFTER, BEFORE): Add tokens.
    756         * lexsup.c (parge_args <-T>): Set previous_script_handle.
    757         * ldlang.c (lang_for_each_statement_worker): Handle insert statement.
    758         (map_input_to_output_sections, print_statement): Likewise.
    759         (lang_size_sections_1, lang_do_assignments_1): Likewise.
    760         (insert_os_after): New function, extracted from..
    761         (lang_insert_orphan): ..here.
    762         (process_insert_statements): New function.
    763         (lang_process): Call it.
    764         (lang_add_insert): New function.
    765         * ldlang.h (lang_insert_statement_enum): New.
    766         (lang_insert_statement_type): New.
    767         (lang_statement_union_type): Add insert_statement.
    768         (lang_add_insert): Declare.
    769 
    770 2008-01-18  Bob Wilson  <bob.wilson@acm.org>
    771 
    772         * scripttempl/elfxtensa.sc: Merge ENTRY and .note.gnu.build-id
    773         changes from elf.sc.
    774 
    775 2008-01-16  Alan Modra  <amodra@bigpond.net.au>
    776 
    777         * ldlang.c (lang_size_sections_1): Simplify SEC_NEVER_LOAD test.
    778 
    779 2008-01-16  Alan Modra  <amodra@bigpond.net.au>
    780 
    781         * ldlang.h (lang_afile_asection_pair_statement_enum): Delete.
    782         (lang_afile_asection_pair_statement_type): Delete.
    783         (lang_statement_union_type): Delete afile_asection_pair_statement.
    784         * ldlang.c (lang_insert_orphan): Delete case handling the above.
    785         (map_input_to_output_sections, print_statement): Likewise.
    786 
    787 2008-01-15  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
    788 
    789         * emulparams/shlelf_linux.sh (DATA_START_SYMBOLS): Use PROVIDE
    790         with __data_start.
    791         * emulparams/shelf_nbsd.sh (DATA_START_SYMBOLS): Likewise.
    792 
    793 2008-01-15  Alan Modra  <amodra@bigpond.net.au>
    794 
    795         PR 5604
    796         * ldlang.c (lang_gc_sections): Move code to set SEC_KEEP on entry
    797         syms to _bfd_elf_gc_keep.
    798         * emultempl/ppc64elf.em (ppc_before_allocation): Don't call
    799         ppc64_elf_edit_opd if no_opd_opt.
    800 
    801 2008-01-11  Tristan Gingold  <gingold@adacore.com>
    802             Eric Botcazou  <ebotcazou@adacore.com>
    803 
    804         * ldlang.c (lang_end): Warns if the entry point is not found when
    805         --gc-sections.
    806         Emit an error if no root is specified when --gc-sections -r.
    807         * ld.texinfo (Options): Document that --gc-sections is compatible
    808         with -r and -q.
    809         * ldmain.c (main): Do not error out if -r and --gc-sections.
    810         * scripttempl/elf.sc: Emit ENTRY command only if relocating.
    811 
    812 2008-01-10  Daniel Jacobowitz  <drow@sources.redhat.com>
    813 
    814         PR ld/5533
    815         * ldlang.c (lang_end): Issue a warning for a missing start symbol
    816         of a shared library if the symbol was specified on the command
    817         line.
    818 
    819 2008-01-10  Alan Modra  <amodra@bigpond.net.au>
    820 
    821         * ld.texinfo (--gc-sections): Describe linker behaviour.
    822 
    823 For older changes see ChangeLog-2007
     11For older changes see ChangeLog-2008
    82412
    82513
    82614Local Variables:
  • ld/ChangeLog-2008

     mode: change-log
    @@ -828,3 +16,4 @@
     fill-column: 74
     version-control: never
     End:
    +
    diff -Naur binutils-2.19.orig/ld/ChangeLog-2008 binutils-2.19/ld/ChangeLog-2008
    old new  
     12008-12-23  Tristan Gingold  <gingold@adacore.com>
     2
     3        * Makefile.am (EXTRA_DIST): Add deffilep.c and deffilep.h
     4        * Makefile.in: Regenerate.
     5
     62008-11-14  Alan Modra  <amodra@bigpond.net.au>
     7
     8        * Makefile.am (spu_ovl.o_c): Add missing line continuations.
     9        * Makefile.in: Regenerate.
     10
     112008-10-05  Alan Modra  <amodra@bigpond.net.au>
     12
     13        PR 6943
     14        * scripttempl/avr.sc (.bss): Set lma when relocating.
     15        (.bss, .noinit): No need to set vma when relocating.
     16        (.text, .bss, ,noinit): Set vma to zero when not relocating.
     17
     182008-09-30  Joseph Myers  <joseph@codesourcery.com>
     19
     20        * emulparams/elf64ppc.sh (OTHER_GOT_RELOC_SECTIONS): Add .rela.opd
     21        and .rela.branch_lt.
     22
     232008-09-29  Nick Clifton  <nickc@redhat.com>
     24
     25        * po/vi.po: Updated Vietnamese translation.
     26
     272008-09-09  Peter Rosin  <peda@lysator.liu.se>  (tiny change)
     28
     29        * emultempl/pe.em (pe_find_data_imports): Add trailing newline
     30        to warning message.
     31        * emultempl/pep.em (pep_find_data_imports): Likewise.
     32
     332008-09-09  Alan Modra  <amodra@bigpond.net.au>
     34
     35        * Makefile.am: Run "make dep-am".
     36        * Makefile.in: Regenerate.
     37        * po/ld.pot: Regenerate.
     38
     392008-09-09  Alan Modra  <amodra@bigpond.net.au>
     40
     41        * emultempl/beos.em (gld${EMULATION_NAME}_place_orphan): Updated.
     42        * emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): Ditto.
     43
     442008-09-08  Tristan Gingold  <gingold@adacore.com>
     45
     46        * NEWS: Add a marker for the 2.19 features.
     47
     482008-09-07  Alan Modra  <amodra@bigpond.net.au>
     49
     50        * ldlang.h (lang_output_section_find): Define.
     51        (lang_output_section_statement_lookup): Update prototype.
     52        * ldlang.c (lang_output_section_find,
     53        lang_output_section_statement_lookup_1): Merge into..
     54        (lang_output_section_statement_lookup): ..here.  Update all callers.
     55        (process_insert_statements): Set constraint negative
     56        for output section statements we might be inserting.  Make error
     57        fatal on not finding insertion section.
     58        (lang_output_section_find): Rather than comparing
     59        output_section_statement.constraint against -1, test whether
     60        it is postive.
     61        (lang_output_section_statement_lookup_1): Likewise.
     62        (output_prev_sec_find, strip_excluded_output_sections): Likewise.
     63        (lang_record_phdrs): Likewise.
     64        * emultempl/elf32.em (output_rel_find): Likewise.
     65        * NEWS: Mention INSERT.
     66
     672008-08-26  Nick Clifton  <nickc@redhat.com>
     68
     69        PR 6727
     70        * emultempl/armelf.em (arm_elf_set_bfd_for_interworking): Scan all
     71        input sections in all input bfds and always select the last
     72        suitable one, so that interworking stubs are always processed
     73        after all other input sections.
     74        (arm_elf_before_allocation): Remove redundant use of
     75        output_has_begun flag.
     76
     772008-08-24  Alan Modra  <amodra@bigpond.net.au>
     78
     79        * configure.in: Update a number of obsolete autoconf macros.
     80        * configure: Regenerate.
     81        * aclocal.m4: Regenerate.
     82
     832008-08-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
     84
     85        PR ld/6833
     86        * ldexp.c (fold_binary <DATA_SEGMENT_ALIGN>): Do not align
     87        EXPLD.DATASEG.MIN_BASE.
     88        * ldlang.c (lang_size_sections): New variable OLD_BASE.  Rename
     89        OLD_MIN_BASE to MIN_BASE with the former alignment from `ldexp.c'.
     90        Use OLD_BASE now for the minimal base check after the base decrease by
     91        the maximum alignment found.
     92
     932008-08-17  Alan Modra  <amodra@bigpond.net.au>
     94
     95        PR 6478
     96        * ldcref.c (check_local_sym_xref): Use bfd_generic_link_read_symbols.
     97        Don't free symbol pointer array.
     98        (check_refs): Likewise.
     99        * ldmain.c (warning_callback): Likewise.
     100        * ldmisc.c (vfinfo): Likewise.
     101        * pe-dll.c (process_def_file): Likewise.
     102        (pe_walk_relocs_of_symbol, generate_reloc): Likewise.
     103        * emultempl/pe.em (pe_find_data_imports): Likewise.
     104        (gld_${EMULATION_NAME}_after_open): Likewise.
     105        * emultempl/pep.em (pep_find_data_imports): Likewise.
     106        (gld_${EMULATION_NAME}_after_open): Likewise.
     107        * ldlang.h (lang_input_statement_type): Delete asymbols, symbol_count,
     108        passive_position, closed.
     109        * ldlang.c (new_afile): Don't set asymbols and symbol_count.
     110        * ldmain.c (add_archive_element): xcalloc lang_input_statement_type.
     111
     1122008-08-15  Alan Modra  <amodra@bigpond.net.au>
     113
     114        PR 6526
     115        * configure.in: Invoke AC_USE_SYSTEM_EXTENSIONS.
     116        * Makefile.in: Regenerate.
     117        * aclocal.m4: Regenerate.
     118        * config.in: Regenerate.
     119        * configure: Regenerate.
     120
     1212008-08-09  Alan Modra  <amodra@bigpond.net.au>
     122
     123        PR 6753
     124        * ldmain.c (check_for_scripts_dir, set_scripts_dir): Delete.
     125        (main): Don't set_scripts_dir here.
     126        * ldfile.c (check_for_scripts_dir, find_scripts_dir): New functions,
     127        largely based on ldmain.c versions.
     128        (ldfile_find_command_file): Set up search in script dir here without
     129        affecting library search.
     130        * Makefile.am (ldmain.o): No need to define SCRIPTDIR.
     131        (ldfile.o): New rule.
     132        * Makefile.in: Regenerate.
     133
     1342008-08-08  Anatoly Sokolov  <aesok@post.ru>
     135
     136        * Makefile.am (ALL_EMULATIONS): Add eavr25.o, eavr31.o, eavr35.o,
     137        and eavr51.o.
     138        Add rules for eavr25.c, eavr31.c, eavr35.c, eavr51.c.
     139        * Makefile.in: Regenerate.
     140        * configure.tgt (avr-*-*, targ_extra_emuls): Add avr25, avr31, avr35
     141        and avr51.
     142        * emulparams/avr25.sh: New file.
     143        * emulparams/avr31.sh: New file.
     144        * emulparams/avr35.sh: New file.
     145        * emulparams/avr51.sh: New file.
     146
     1472008-08-08  Richard Sandiford  <rdsandiford@googlemail.com>
     148            Daniel Jacobowitz  <dan@codesourcery.com>
     149
     150        * emulparams/elf32bmip.sh (GOT): Define, moving .got.plt to...
     151        (OTHER_RELRO_SECTIONS, OTHER_READWRITE_SECTIONS): ...one of these
     152        two variables.
     153        * emulparams/elf32bmipn32-defs.sh: Likewise.
     154        * emultempl/mipself.em: Include ldctor.h, elf/mips.h and elfxx-mips.h.
     155        (is_mips_elf): New macro.
     156        (stub_file, stub_bfd): New variables.
     157        (hook_stub_info): New structure.
     158        (hook_in_stub): New function.
     159        (mips_add_stub_section): Likewise.
     160        (mips_create_output_section_statements): Likewise.
     161        (mips_before_allocation): Likewise.
     162        (real_func): New variable.
     163        (mips_for_each_input_file_wrapper): New function.
     164        (mips_lang_for_each_input_file): Likewise.
     165        (lang_for_each_input_file): Define.
     166        (LDEMUL_BEFORE_ALLOCATION): Likewise.
     167        (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Likewise.
     168
     1692008-08-08  Alan Modra  <amodra@bigpond.net.au>
     170
     171        * ldfile.c (ldfile_open_file_search): Use concat.
     172        (try_open): Don't use a fixed size pathname buffer.
     173        (ldfile_find_command_file): Likewise.
     174        * emultempl/elf32.em (gld${EMULATION_NAME}_open_dynamic_archive): If
     175        using EXTRA_SHLIB_EXTENSION, don't open twice.
     176
     1772008-08-04  Alan Modra  <amodra@bigpond.net.au>
     178
     179        * Makefile.am (POTFILES.in): Set LC_ALL=C.
     180        * Makefile.in: Regenerate.
     181        * po/POTFILES.in: Regenerate.
     182
     1832008-08-03  Alan Modra  <amodra@bigpond.net.au>
     184
     185        * Makefile.am (spu_ovl.o): Merge rule into..
     186        (spu_ovl.o_c): ..this one.  Only run cpp for spu target.
     187        * Makefile.in: Regenerate.
     188
     1892008-08-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
     190
     191        Include the spu_ovl ASCII form in the repository files.
     192        * emultempl/spuelf.em: No longer use `bin2c', use now `spu_ovl.o_c'.
     193        * Makefile.am (eelf32_spu.c): Depend now on `spu_ovl.o_c'.
     194        ($(srcdir)/emultempl/spu_ovl.o_c): New target.
     195        ($(srcdir)/emultempl/spu_ovl.o): Rename to...
     196        (spu_ovl.o): ...this one.
     197        * Makefile.in: Regenerate.
     198        * emultempl/spu_ovl.o_c: New file.
     199        * emultempl/spu_ovl.o: File removed.
     200
     2012008-07-31  Takashi Ono  <t_ono@hkfreak.net>
     202
     203        * pe-dll.c (generate_relocs): Don't generate relocs for
     204        undefined weak symbols.
     205
     2062008-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
     207
     208        * emultempl/spuelf.em: Abort on the missing required `spu_ovl.o'.
     209
     2102008-07-30  Alan Modra  <amodra@bigpond.net.au>
     211
     212        * emultempl/pe.em, emultempl/pep.em: Silence gcc warnings.
     213
     2142008-07-18  Joseph Myers  <joseph@codesourcery.com>
     215
     216        * ld.texinfo (--no-wchar-size-warning): Document new ARM option.
     217        * emultempl/armelf.em (no_wchar_size_warning): New.
     218        (arm_elf_create_output_section_statements): Pass
     219        no_wchar_size_warning to arm_elf_create_output_section_statements.
     220        (OPTION_NO_WCHAR_SIZE_WARNING): New.
     221        (PARSE_AND_LIST_LONGOPTS): Add no-wchar-size-warning.
     222        (PARSE_AND_LIST_OPTIONS): List --no-wchar-size-warning.
     223        (PARSE_AND_LIST_ARGS_CASES): Handle --no-wchar-size-warning.
     224
     2252008-07-15  Jie Zhang  <jie.zhang@analog.com>
     226
     227        * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define.
     228
     2292008-07-12  Craig Silverstein  <csilvers@google.com>
     230
     231        PR ld/6741
     232        * configure.in: Check for, and include, libz.a if it is present.
     233        * configure: Regenerate.
     234        * config.in: Regenerate.
     235
     2362008-07-12  Jie Zhang  <jie.zhang@analog.com>
     237
     238        Revert
     239        2008-07-12  Jie Zhang  <jie.zhang@analog.com>
     240        * Makefile.am (eelf32bfin.c): Depend on bfin.em.
     241        (eelf32bfinfd.c): Likewise.
     242        * Makefile.in: Regenerate.
     243        * gen-doc.texi: Set Blackfin.
     244        * ld.texinfo: Document --sep-code and Blackfin specific
     245        options.
     246        * ldmain.c (main): Initialize link_info.sep_code.
     247        * lexsup.c (enum option_values): Add OPTION_SEP_CODE.
     248        (ld_options[]): Add --sep-code.
     249        (parse_args): Deal with --sep-code.
     250        * emulparams/bfin.sh (EXTRA_EM_FILE): Define.
     251        * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define.
     252        * emultempl/bfin.em: New file.
     253
     2542008-07-12  Jie Zhang  <jie.zhang@analog.com>
     255
     256        * Makefile.am (eelf32bfin.c): Depend on bfin.em.
     257        (eelf32bfinfd.c): Likewise.
     258        * Makefile.in: Regenerate.
     259        * gen-doc.texi: Set Blackfin.
     260        * ld.texinfo: Document --sep-code and Blackfin specific
     261        options.
     262        * ldmain.c (main): Initialize link_info.sep_code.
     263        * lexsup.c (enum option_values): Add OPTION_SEP_CODE.
     264        (ld_options[]): Add --sep-code.
     265        (parse_args): Deal with --sep-code.
     266        * emulparams/bfin.sh (EXTRA_EM_FILE): Define.
     267        * emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define.
     268        * emultempl/bfin.em: New file.
     269
     2702008-07-09  Danny Smith  <dannysmith@users.sourceforge.net>
     271
     272           *pe-dll.c (autofilter_symbolprefixlist): Excude all symbols
     273           starting with ".".
     274           Exclude "_IMPORT_DESCRIPTOR_".
     275           (autofilter_symbolsuffixlist): Exclude "_NULL_THUNK_DATA".
     276           (autofilter_symbollist_generic): Don't check for ".text".
     277           Exclude "_NULL_IMPORT_DESCRIPTOR".
     278           (autofilter_symbollist_i386): Likewise.
     279
     2802008-07-07  Alan Modra  <amodra@bigpond.net.au>
     281
     282        * emultempl/armelf.em (elf32_arm_add_stub_section): Use
     283        bfd_make_section_with_flags.
     284        * emultempl/avrelf.em (avr_elf_create_output_section_statements):
     285        Likewise.
     286        * emultempl/hppaelf.em (hppaelf_add_stub_section): Likewise.
     287        * emultempl/m68hc1xelf.em (m68hc11elf_add_stub_section): Likewise.
     288        * emultempl/m68kcoff.em (gld${EMULATION_NAME}_after_open): Likewise.
     289        * emultempl/m68kelf.em (m68k_elf_after_open): Likewise.
     290        * emultempl/ppc64elf.em (ppc_add_stub_section): Likewise.
     291        * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation):
     292        Likewise.
     293
     2942008-07-06  Nathan Sidwell  <nathan@codesourcery.com>
     295
     296        * ld.texinfo (File Commands): Document that INCLUDE can be used in
     297        several different places.
     298        * ldgram.y (statement, memory_spec, section): Allow INCLUDE.
     299        (memory, memory_spec_list): Simplify BNF
     300        (memory_spec_list_opt): New rule.
     301        * ldlex.l (INCLUDE): Recognize in EXPRESSION.
     302
     3032008-06-20  Alan Modra  <amodra@bigpond.net.au>
     304
     305        * emultempl/spuelf.em (gld${EMULATION_NAME}_finish): Make "can not
     306        build overlay stubs" a fatal error.
     307
     3082008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
     309
     310        * config.in: Regenerate.
     311        * configure: Regenerate.
     312
     3132008-06-17  Alan Modra  <amodra@bigpond.net.au>
     314
     315        * emultempl/spuelf.em (extra_stack_space): New variable.
     316        (gld${EMULATION_NAME}_finish): Pass it to spu_elf_check_vma.
     317        (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS,
     318        PARSE_AND_LIST_ARGS_CASES): Handle --extra-stack-space.
     319        * emultempl/spu_ovl.S: Mask interrupts during dma and update of
     320        overlay manager structures.
     321        * emultempl/spu_ovl.o: Regenerate.
     322
     3232008-06-16  Hans-Peter Nilsson  <hp@bitrange.com>
     324
     325        * ld.texinfo (@node MMIX): For the __.MMIX.start. prefix, only
     326        mention it as being special for global symbols.
     327
     3282008-06-12  Nick Clifton  <nickc@redhat.com>
     329
     330        * ldlang.c (print_output_section_statement): If the output section
     331        statement has an update_dot_tree expression, apply it to
     332        print_dot.
     333        (print_input_section): Do not update print_dot if it would move
     334        print_dot backwards.
     335        (lang_do_assignments_1): If the output section statement has an
     336        update_dot_tree expression apply it to dot.
     337
     3382008-06-07  Alan Modra  <amodra@bigpond.net.au>
     339
     340        * NEWS: Mention archive:path patterns.
     341        * ld.texinfo: Likewise.
     342        * ldlang.c: Formatting throughout.
     343        (archive_path): Only assume "[A-Za-z]:" is a dos drive.
     344        (input_statement_is_archive_path): New function, extracted from..
     345        (walk_wild): ..here.
     346        (walk_wild_consider_section): Match archive:path here too.
     347        (init_map_userdata, sort_def_symbol): Convert to ISO C.
     348        * ldmain.c (main): Set link_info.path_separator.
     349        * emultempl/spuelf.em (choose_target): Don't set it here.
     350
     3512008-06-06  Alan Modra  <amodra@bigpond.net.au>
     352
     353        * ldlang.c (name_match): New function.
     354        (unique_section_p, walk_wild_consider_section): Use it here.
     355        (walk_wild_section_general): And here.
     356        (archive_path): New function.
     357        (walk_wild): Match archive:path filespecs.
     358        (open_input_bfds): Don't load archive:path files.
     359        * emultempl/spuelf.em (choose_target): Set path_separator.
     360        * emulparams/elf32_spu.sh: Add ._ea.* sections to ._ea output.
     361
     3622008-06-04  Nick Clifton  <nickc@redhat.com>
     363
     364        * ld.texinfo (Orphan Sections): Fix texi typo.
     365
     3662008-06-04  Chris Metcalf  <cmetcalf@tilera.com>
     367
     368        * lexsup.c (option_values): Add OPTION_NO_WARN_FATAL.
     369        (ld_options): Add entry for --no-fatal-warnings.
     370        (parse_args): Handle OPTION_NO_WARN_FATAL.
     371        * ld.texinfo (Options): Document new command line switch.
     372
     3732008-06-04  Alan Modra  <amodra@bigpond.net.au>
     374
     375        * emultempl/spuelf.em (spu_elf_relink): Correct --no-auto-overlay arg.
     376
     3772008-06-02  Nathan Sidwell  <nathan@codesourcery.com>
     378
     379        * ldlang.c (closest_target_match): Skip generic big and little
     380        endian ELF targets.
     381
     3822008-05-31  Evandro Menezes  <evandro@yahoo.com>
     383
     384        PR ld/6430
     385        * ld.h (enum sort_order): New.
     386        * ldlang.c (lang_check: Fix comment.
     387        (lang_common): Sort commons in ascending or descending order.
     388        (lang_one_common): Likewise.
     389        * lexsup.c (ld_options): Have --sort-common take an option
     390        argument.
     391        (parse_args): Handle argument to --sort-common.
     392        * ld.texinfo (--sort-common): Document new optional argument.
     393        * NEWS: Mention new feature.
     394
     3952008-05-28  Christophe Lyon  <christophe.lyon@st.com>
     396       
     397        * ld.texinfo: State that farcalls stubs are supported for ARM-EABI
     398        only.
     399
     4002008-05-27  Kai Tietz  <kai.tietz@onevision.com>
     401
     402        * pe-dll.c (fill_edata): Make sure we calculate vma's in
     403        type bfd_vma.
     404        (generate_reloc): Likewise.
     405        (pe_implied_import_dll): Likewise.
     406
     4072008-05-21  Nick Clifton  <nickc@redhat.com>
     408
     409        PR ld/6519
     410        * ld.texinfo (Orphan Sections): Mention that the linker will
     411        provide start and stop symbols for orphaned sections if their
     412        names are valid C identifiers.
     413        * NEWS: Add an addendum to the description of the linker feature
     414        for providing orphan section start and end symbols.
     415
     4162008-05-21  Maxim Kuvyrkov  <maxim@codesourcery.com>
     417
     418        * configure.in (--enable-got): New option.  Handle it.
     419        * configure: Regenerate.
     420        * config.in: Regenerate.
     421        * emultempl/m68kelf.em: (got_handling_target_default): New shell
     422        variable.
     423        (GOT_HANDLING_TARGET_DEFAULT): New macro.
     424        (GOT_HANDLING_DEFAULT): New macro.  Initialize it from configure
     425        option if one was given.
     426        (got_handling): New static variable.
     427        (elf_m68k_create_output_section_statements): New static function
     428        implementing hook.
     429        (PARSE_AND_LIST_PROLOGUE): Define shell variable.
     430        (OPTION_GOT): New macro.
     431        (PARSE_AND_LIST_LONGOPTS): Define shell variable.  Specify
     432        --got option.
     433        (got): New linker option.
     434        (PARSE_AND_LIST_OPTIONS): Define shell variable.  Print help string
     435        for --got option.
     436        (PARSE_AND_LIST_ARGS_CASES): Define shell variable.  Handle --got
     437        option.
     438        * ld.texinfo: Document --got=<type> option.
     439        * gen-doc.texi: Add M68K.
     440        * NEWS: Mention the new feature.
     441
     4422008-05-21  Evandro Menezes  <evandro@yahoo.com>
     443
     444        PR ld/6430
     445        * ld.texinfo (--sort-common): Correct documentation to indicate
     446        that sorting is performed by alignment, not size, biggest
     447        alignment first.
     448
     4492008-05-21  Christophe Lyon  <christophe.lyon@st.com>
     450            Nick Clifton  <nickc@redhat.com>
     451
     452        * ld.texinfo (ARM): Document --stub-group-size=N option.
     453        Move description of --pic-veneer option into the ARM section.
     454        * NEWS: Mention the support for long function calls.
     455
     4562008-05-15  Christophe Lyon  <christophe.lyon@st.com>
     457       
     458        * emultempl/armelf.em (build_section_lists): New function.
     459        (stub_file): Define.
     460        (need_laying_out): Define.
     461        (group_size): Define.
     462        (hook_stub_info): Define.
     463        (hook_in_stub): New function.
     464        (elf32_arm_add_stub_section): New function.
     465        (gldarm_layout_sections_again): New function.
     466        (gld${EMULATION_NAME}_finish): Replace arm_elf_finish(). Generate
     467        stubs for long calls if needed.
     468        (arm_elf_create_output_section_statements): create stub_file bfd.
     469        (arm_for_each_input_file_wrapper): New function.
     470        (arm_lang_for_each_input_file): New function.
     471        (lang_for_each_input_file): Define.
     472        (PARSE_AND_LIST_PROLOGUE): Add option token OPTION_STUBGROUP_SIZE.
     473        (PARSE_AND_LIST_LONGOPTS): Add option stub-group-size.
     474        (PARSE_AND_LIST_OPTIONS): Add option stub-group-size.
     475        (PARSE_AND_LIST_ARGS_CASES): Add OPTION_STUBGROUP_SIZE case.
     476        (LDEMUL_FINISH): Update to gld${EMULATION_NAME}_finish.
     477        * lang.c (print_input_statement): Skip if bfd has
     478        BFD_LINKER_CREATED.
     479
     4802008-05-14  Alan Modra  <amodra@bigpond.net.au>
     481
     482        * Makefile.in: Regenerate.
     483
     4842008-05-09  Kai Tietz  <kai.tietz@onevision.com>
     485
     486        ld/PR6502
     487        * emultempl/pep.em (compute_dll_image_base): Use bfd_vma instead
     488        of long and change return type to bfd_vma.
     489        (definfo): Change type of address from long to bfd_vma.
     490        (set_pep_value): Replace strtoul to strtoull.
     491        (gld_${EMULATION_NAME}_set_symbols): use bfd_vma instead of long..
     492        * pe-dll.c (pe_dll_generate_def_file): Use fprintf_vma to print
     493        ImageBase.
     494        (quick_reloc): Change argument address from int to bfd_size_type.
     495
     4962008-05-08  Tom Tromey  <tromey@redhat.com>
     497
     498        * ld.texinfo (PowerPC64 ELF64): Fix typo.
     499
     5002008-05-08  Alan Modra  <amodra@bigpond.net.au>
     501
     502        * elf32_spu.sh (OTHER_SECTIONS): Add "._ea".
     503        * elf32ppc.sh: If building with spu support, put ".data.spehandle"
     504        sections at the start of ".data" and provide a symbol to locate
     505        the directory of embedded spe programs.
     506
     5072008-05-08  Alan Modra  <amodra@bigpond.net.au>
     508
     509        * ldexp.c (exp_print_token): Add ABSOLUTE, MIN_K, ASSERT_K.  Correct
     510        MAX_K.
     511        (fold_binary <SEGMENT_START>): Set expld.result.section to
     512        current section.  Expand comment.  Formatting.
     513        (fold_name <DEFINED>): Set expld.result.section to current section.
     514
     5152008-04-28  Nathan Sidwell  <nathan@codesourcery.com>
     516
     517        * ldlang.c (lang_size_sections_1): Don't check LMA overflow on
     518        non-load sections.
     519
     5202008-04-25  Michael Frysinger  <vapier@gentoo.org>
     521
     522        * configure.tgt (bfin-*-linux-uclibc*): Set targ_emul to elf32bfinfd
     523        and targ_extra_emuls to elf32bfin.
     524
     5252008-04-23  Paolo Bonzini  <bonzini@gnu.org>
     526
     527        * aclocal.m4: Regenerate.
     528        * configure: Regenerate.
     529
     5302008-04-03  Kai Tietz  <kai.tietz@onevision.com>
     531
     532        * scripttempl/pep.sc: Align start of symbol __CTOR_LIST__.
     533
     5342008-04-08  Alan Modra  <amodra@bigpond.net.au>
     535
     536        * po/POTFILES.in: Regenerate.
     537
     5382008-04-08  Alan Modra  <amodra@bigpond.net.au>
     539
     540        * emultempl/spuelf.em (auto_overlay, auto_overlay_file,
     541        auto_overlay_fixed, auto_overlay_reserved, my_argc, my_argv): New vars.
     542        (spu_before_allocation): Warn on --auto-overlay and existing overlays.
     543        (struct tflist, clean_tmp): Move.
     544        (new_tmp_file): New function, extracted from..
     545        (embedded_spu_file): ..here.
     546        (spu_elf_open_overlay_script, spu_elf_relink): New function.
     547        (gld${EMULATION_NAME}_finish): Pass a bunch of --auto-overlay params.
     548        Warn on --auto-overlay and zero local store.
     549        (gld${EMULATION_NAME}_choose_target): New function to stash argv.
     550        (OPTION_SPU_AUTO_OVERLAY, OPTION_SPU_AUTO_RELINK,
     551        OPTION_SPU_OVERLAY_RODATA, OPTION_SPU_FIXED_SPACE,
     552        OPTION_SPU_RESERVED_SPACE, OPTION_SPU_NO_AUTO_OVERLAY): Define.
     553        (PARSE_AND_LIST_LONGOPTS): Add entries for new options.
     554        (PARSE_AND_LIST_OPTIONS): Likewise.
     555        (PARSE_AND_LIST_ARGS_CASES): Likewise.
     556        (LDEMUL_CHOOSE_TARGET): Define.
     557
     5582008-04-03  Kai Tietz  <kai.tietz@onevision.com>
     559
     560        PR ld/6026
     561        * pe-dll.c (make_head): Fix iat and thunk addend offset.
     562
     5632008-03-31  Nick Clifton  <nickc@redhat.com>
     564
     565        * po/fr.po: Updated French translation.
     566
     5672008-03-24  Ian Lance Taylor  <iant@google.com>
     568
     569        The sha1 code is now in libiberty.
     570        * sha1.c: Remove.
     571        * sha1.h: Remove.
     572        * Makefile.am (CFILES): Remove sha1.c.
     573        (HFILES): Remove sha1.h.
     574        (OFILES): Remove sha1.o.
     575        (ld_new_SOURCES): Remove sha1.c.
     576        (sha1.o): Remove target.
     577        * Makefile.in: Rebuild.
     578
     5792008-03-20  Alan Modra  <amodra@bigpond.net.au>
     580
     581        * emultempl/spuelf.em: Update calls to elf32-spu.c funcs.
     582
     5832008-03-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
     584
     585        * aclocal.m4: Regenerate.
     586        * configure: Likewise.
     587        * Makefile.in: Likewise.
     588
     5892008-03-14  Alan Modra  <amodra@bigpond.net.au>
     590
     591        * emultempl/spuelf.em (gld${EMULATION_NAME}_finish): Protect
     592        spu_elf_build_stubs with is_spu_target.
     593
     5942008-03-13  Alan Modra  <amodra@bigpond.net.au>
     595
     596        * Makefile.am: Run "make dep-am".
     597        * Makefile.in: Regenerate.
     598        * configure: Regenerate.
     599
     6002008-03-06  Joseph Myers  <joseph@codesourcery.com>
     601            Roman Zippel  <zippel@linux-m68k.org>
     602
     603        * emulparams/m68kelf.sh (GENERATE_PIE_SCRIPT): Define.
     604        (COMMONPAGESIZE): Define.
     605
     6062008-02-22  Nick Clifton  <nickc@redhat.com>
     607
     608        PR ld/5785
     609        * ldlang.c (lang_size_sections_1): Honour the setting of an
     610        lma_region even if there is no vma region set, or the vma region
     611        is the same as the lma region.
     612
     6132008-02-18  Nick Clifton  <nickc@redhat.com>
     614
     615        * scripttempl/armbpabi.sc (ENTRY): Do not define when performing a
     616        relocatable link.
     617        * scripttempl/elf32cr16.sc: Likewise.
     618        * scripttempl/elf32cr16c.sc: Likewise.
     619        * scripttempl/elf32crx.sc: Likewise.
     620        * scripttempl/elf32sh-symbian.sc: Likewise.
     621        * scripttempl/elf_chaos.sc: Likewise.
     622        * scripttempl/elfd10v.sc: Likewise.
     623        * scripttempl/elfi370.sc: Likewise.
     624        * scripttempl/elfm68hc11.sc: Likewise.
     625        * scripttempl/elfm68hc12.sc: Likewise.
     626        * scripttempl/ip2k.sc: Likewise.
     627        * scripttempl/iq2000.sc: Likewise.
     628        * scripttempl/mep.sc: Likewise.
     629        * scripttempl/v850.sc: Likewise.
     630        * scripttempl/xstormy16.sc: Likewise.
     631
     6322008-02-16  Alan Modra  <amodra@bigpond.net.au>
     633
     634        PR ld/5761
     635        * ldexp.c (fold_name <LOADADDR>): Check result of evaluating
     636        load_base before calling make_abs.
     637
     6382008-02-15  Alan Modra  <amodra@bigpond.net.au>
     639
     640        * emultempl/alphaelf.em (alpha_after_open): Use elf_object_id.
     641        * emultempl/hppaelf.em (hppaelf_create_output_section_statements):
     642        Likewise.
     643        * emultempl/ppc64elf.em (ppc_create_output_section_statements):
     644        Likewise.
     645        * emultempl/ppc32elf.em (is_ppc_elf32_vec): Delete.  Replace all
     646        uses with..
     647        (is_ppc_elf): ..this new macro.
     648
     6492008-02-15  Alan Modra  <amodra@bigpond.net.au>
     650
     651        * ldmain.h (output_bfd): Delete.
     652        * ldmain.c (output_bfd): Delete.
     653        Replace all occurrences of output_bfd with link_info.output_bfd.
     654        * ldcref.c: Likewise.
     655        * ldctor.c: Likewise.
     656        * ldemul.c: Likewise.
     657        * ldexp.c: Likewise.
     658        * ldfile.c: Likewise.
     659        * ldlang.c: Likewise.
     660        * ldmisc.c: Likewise.
     661        * ldwrite.c: Likewise.
     662        * pe-dll.c: Likewise.
     663        * emultempl/aix.em: Likewise.
     664        * emultempl/alphaelf.em: Likewise.
     665        * emultempl/armcoff.em: Likewise.
     666        * emultempl/armelf.em: Likewise.
     667        * emultempl/avrelf.em: Likewise.
     668        * emultempl/beos.em: Likewise.
     669        * emultempl/elf-generic.em: Likewise.
     670        * emultempl/elf32.em: Likewise.
     671        * emultempl/gld960.em: Likewise.
     672        * emultempl/hppaelf.em: Likewise.
     673        * emultempl/irix.em: Likewise.
     674        * emultempl/linux.em: Likewise.
     675        * emultempl/lnk960.em: Likewise.
     676        * emultempl/m68hc1xelf.em: Likewise.
     677        * emultempl/mmix-elfnmmo.em: Likewise.
     678        * emultempl/mmo.em: Likewise.
     679        * emultempl/pe.em: Likewise.
     680        * emultempl/pep.em: Likewise.
     681        * emultempl/ppc32elf.em: Likewise.
     682        * emultempl/ppc64elf.em: Likewise.
     683        * emultempl/scoreelf.em: Likewise.
     684        * emultempl/sh64elf.em: Likewise.
     685        * emultempl/spuelf.em: Likewise.
     686        * emultempl/sunos.em: Likewise.
     687        * emultempl/vanilla.em: Likewise.
     688        * emultempl/vxworks.em: Likewise.
     689        * emultempl/xtensaelf.em: Likewise.
     690        * emultempl/z80.em: Likewise.
     691        * ldlang.c (open_output): Don't return output, instead write
     692        link_info_output_bfd directly.
     693        * emultempl/alphaelf.em: Replace occurrences of link_info.hash->creator
     694        with link_info.output_bfd->xvec.
     695        * emultempl/hppaelf.em: Likewise.
     696        * emultempl/ppc32elf.em: Likewise.
     697        * emultempl/ppc64elf.em: Likewise.
     698        * emultempl/spuelf.em: Likewise.
     699
     7002008-02-07  Alan Modra  <amodra@bigpond.net.au>
     701
     702        * ldlang.c (new_afile): Don't pass unadorned NULL to concat.
     703        * ldfile.c (ldfile_add_library_path): Likewise.
     704        * emultempl/elf32.em (check_ld_elf_hints, check_ld_so_conf): Likewise.
     705        * emultempl/lnk960.em (lnk960_before_parse): Likewise.
     706        * emultempl/spuelf.em (embedded_spu_file): Likewise.
     707
     7082008-02-07  Alan Modra  <amodra@bigpond.net.au>
     709
     710        * emultempl/spu_ovl.S: Use low bit of _ovly_table.size as
     711        a "present" bit rather than low bit of .buf.  Correct indexing
     712        into _ovly_buf_table.  Use relative loads and stores to access
     713        overlay manager local vars.
     714        * emultempl/spu_ovl.o: Regenerate.
     715
     7162008-02-04  H.J. Lu  <hongjiu.lu@intel.com>
     717
     718        PR 5715
     719        * configure: Regenerated.
     720
     7212008-01-31  Marc Gauthier  <marc@tensilica.com>
     722
     723        * configure.tgt (xtensa*-*-*): Recognize processor variants.
     724
     7252008-01-28  Fabian Groffen  <grobian@gentoo.org>
     726
     727        * configure.tgt (x86_64-*-solaris2): Add support for this target.
     728
     7292008-01-28  Vincent Riviere  <vincent.riviere@freesbee.fr>
     730
     731        PR ld/5652
     732        * genscripts.sh: Check for the existence of BASH_LINENO not just
     733        the BASH shell before generating line numbers in the emulation
     734        file.
     735
     7362008-01-28  Alan Modra  <amodra@bigpond.net.au>
     737
     738        * emultempl/spu_ovl.S: Rewrite.
     739        * emultempl/spu_ovl.o: Regenerate.
     740        * emultempl/spuelf.em (toe): Delete.
     741        (spu_place_special_section): Add param to control section placement.
     742        Adjust callers.
     743        (spu_elf_load_ovl_mgr): Adjust for struct _spu_elf_section_data
     744        changes.
     745        (spu_before_allocation): Adjust spu_elf_size_stubs call.
     746        (gld${EMULATION_NAME}_finish): Adjust spu_elf_build_stubs call.
     747
     7482008-01-25  H.J. Lu  <hongjiu.lu@intel.com>
     749
     750        PR ld/5670
     751        * ldlang.c (process_insert_statements): Silence gcc 4.1 alias
     752        warning.
     753
     7542008-01-25  Alan Modra  <amodra@bigpond.net.au>
     755
     756        * ld.texinfo (INSERT): Describe.
     757        * ldgram.y (ldgram_in_script, ldgram_had_equals): Delete.
     758        (INSERT_K, AFTER, BEFORE): Add as tokens.
     759        (ifile_p1): Handle INSERT statements.
     760        (saved_script_handle, force_make_executable): Move to..
     761        * ldmain.c: ..here.
     762        (previous_script_handle): New global var.
     763        * ldmain.h (saved_script_handle, force_make_executable): Declare.
     764        (previous_script_handle): Likewise.
     765        * ldlex.l (INSERT_K, AFTER, BEFORE): Add tokens.
     766        * lexsup.c (parge_args <-T>): Set previous_script_handle.
     767        * ldlang.c (lang_for_each_statement_worker): Handle insert statement.
     768        (map_input_to_output_sections, print_statement): Likewise.
     769        (lang_size_sections_1, lang_do_assignments_1): Likewise.
     770        (insert_os_after): New function, extracted from..
     771        (lang_insert_orphan): ..here.
     772        (process_insert_statements): New function.
     773        (lang_process): Call it.
     774        (lang_add_insert): New function.
     775        * ldlang.h (lang_insert_statement_enum): New.
     776        (lang_insert_statement_type): New.
     777        (lang_statement_union_type): Add insert_statement.
     778        (lang_add_insert): Declare.
     779
     7802008-01-18  Bob Wilson  <bob.wilson@acm.org>
     781
     782        * scripttempl/elfxtensa.sc: Merge ENTRY and .note.gnu.build-id
     783        changes from elf.sc.
     784
     7852008-01-16  Alan Modra  <amodra@bigpond.net.au>
     786
     787        * ldlang.c (lang_size_sections_1): Simplify SEC_NEVER_LOAD test.
     788
     7892008-01-16  Alan Modra  <amodra@bigpond.net.au>
     790
     791        * ldlang.h (lang_afile_asection_pair_statement_enum): Delete.
     792        (lang_afile_asection_pair_statement_type): Delete.
     793        (lang_statement_union_type): Delete afile_asection_pair_statement.
     794        * ldlang.c (lang_insert_orphan): Delete case handling the above.
     795        (map_input_to_output_sections, print_statement): Likewise.
     796
     7972008-01-15  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
     798
     799        * emulparams/shlelf_linux.sh (DATA_START_SYMBOLS): Use PROVIDE
     800        with __data_start.
     801        * emulparams/shelf_nbsd.sh (DATA_START_SYMBOLS): Likewise.
     802
     8032008-01-15  Alan Modra  <amodra@bigpond.net.au>
     804
     805        PR 5604
     806        * ldlang.c (lang_gc_sections): Move code to set SEC_KEEP on entry
     807        syms to _bfd_elf_gc_keep.
     808        * emultempl/ppc64elf.em (ppc_before_allocation): Don't call
     809        ppc64_elf_edit_opd if no_opd_opt.
     810
     8112008-01-11  Tristan Gingold  <gingold@adacore.com>
     812            Eric Botcazou  <ebotcazou@adacore.com>
     813
     814        * ldlang.c (lang_end): Warns if the entry point is not found when
     815        --gc-sections.
     816        Emit an error if no root is specified when --gc-sections -r.
     817        * ld.texinfo (Options): Document that --gc-sections is compatible
     818        with -r and -q.
     819        * ldmain.c (main): Do not error out if -r and --gc-sections.
     820        * scripttempl/elf.sc: Emit ENTRY command only if relocating.
     821
     8222008-01-10  Daniel Jacobowitz  <drow@sources.redhat.com>
     823
     824        PR ld/5533
     825        * ldlang.c (lang_end): Issue a warning for a missing start symbol
     826        of a shared library if the symbol was specified on the command
     827        line.
     828
     8292008-01-10  Alan Modra  <amodra@bigpond.net.au>
     830
     831        * ld.texinfo (--gc-sections): Describe linker behaviour.
     832
     833For older changes see ChangeLog-2007
     834
    0835
     836Local Variables:
     837mode: change-log
     838left-margin: 8
     839fill-column: 74
     840version-control: never
  • ld/Makefile.am

    +End:
    diff -Naur binutils-2.19.orig/ld/Makefile.am binutils-2.19/ld/Makefile.am
    old new  
    758758$(srcdir)/emultempl/spu_ovl.o_c: @MAINT@ $(srcdir)/emultempl/spu_ovl.S
    759759        if ../gas/as-new --version \
    760760                | grep 'target.*spu' >/dev/null 2>/dev/null; then \
    761           cpp -DOVLY_IRQ_SAVE $(srcdir)/emultempl/spu_ovl.S spu_ovl.s
     761          cpp -DOVLY_IRQ_SAVE $(srcdir)/emultempl/spu_ovl.S spu_ovl.s; \
    762762          ../gas/as-new -o spu_ovl.o spu_ovl.s; \
    763           ../binutils/bin2c <spu_ovl.o >$@
     763          ../binutils/bin2c <spu_ovl.o >$@; \
    764764        fi
    765765eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \
    766766  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
     
    19141914
    19151915# Stuff that should be included in a distribution.  The diststuff
    19161916# target is run by the taz target in ../Makefile.in.
    1917 EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c $(man_MANS)
     1917EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c \
     1918           deffilep.c deffilep.h $(man_MANS)
    19181919diststuff: info $(EXTRA_DIST)
    19191920all: info ld.1
    19201921
  • ld/Makefile.in

    diff -Naur binutils-2.19.orig/ld/Makefile.in binutils-2.19/ld/Makefile.in
    old new  
    730730
    731731# Stuff that should be included in a distribution.  The diststuff
    732732# target is run by the taz target in ../Makefile.in.
    733 EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c $(man_MANS)
     733EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c \
     734           deffilep.c deffilep.h $(man_MANS)
     735
    734736DISTCLEANFILES = tdirs site.exp site.bak stringify.sed $(am__append_1)
    735737all: config.h
    736738        $(MAKE) $(AM_MAKEFLAGS) all-recursive
     
    15881590$(srcdir)/emultempl/spu_ovl.o_c: @MAINT@ $(srcdir)/emultempl/spu_ovl.S
    15891591        if ../gas/as-new --version \
    15901592                | grep 'target.*spu' >/dev/null 2>/dev/null; then \
    1591           cpp -DOVLY_IRQ_SAVE $(srcdir)/emultempl/spu_ovl.S spu_ovl.s
     1593          cpp -DOVLY_IRQ_SAVE $(srcdir)/emultempl/spu_ovl.S spu_ovl.s; \
    15921594          ../gas/as-new -o spu_ovl.o spu_ovl.s; \
    1593           ../binutils/bin2c <spu_ovl.o >$@
     1595          ../binutils/bin2c <spu_ovl.o >$@; \
    15941596        fi
    15951597eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \
    15961598  $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  • binutils-2.19

    diff -Naur binutils-2.19.orig/ld/pe-dll.c binutils-2.19/ld/pe-dll.c
    old new  
    11/* Routines to help build PEI-format DLLs (Win32 etc)
    22   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
    3    2008 Free Software Foundation, Inc.
     3   2008, 2009 Free Software Foundation, Inc.
    44   Written by DJ Delorie <dj@cygnus.com>
    55
    66   This file is part of the GNU Binutils.
     
    314314  { STRING_COMMA_LEN ("libcegcc") },
    315315  { STRING_COMMA_LEN ("libcygwin") },
    316316  { STRING_COMMA_LEN ("libgcc") },
     317  { STRING_COMMA_LEN ("libgcc_s") },
    317318  { STRING_COMMA_LEN ("libstdc++") },
    318319  { STRING_COMMA_LEN ("libmingw32") },
    319320  { STRING_COMMA_LEN ("libmingwex") },
     
    324325  { NULL, 0 }
    325326};
    326327
     328/* Regardless of the suffix issue mentioned above, we must ensure that
     329  we do not falsely match on a leading substring, such as when libtool
     330  builds libstdc++ as a DLL using libsupc++convenience.a as an intermediate.
     331  This routine ensures that the leading part of the name matches and that
     332  it is followed by only an optional version suffix and a file extension,
     333  returning zero if so or -1 if not.  */
     334static int libnamencmp (const char *libname, const autofilter_entry_type *afptr)
     335{
     336  if (strncmp (libname, afptr->name, afptr->len))
     337    return -1;
     338
     339  libname += afptr->len;
     340
     341  /* Be liberal in interpreting what counts as a version suffix; we
     342    accept anything that has a dash to separate it from the name and
     343    begins with a digit.  */
     344  if (libname[0] == '-')
     345    {
     346      if (!ISDIGIT (*++libname))
     347        return -1;
     348      /* Ensure the filename has an extension.  */
     349      while (*++libname != '.')
     350        if (!*libname)
     351          return -1;
     352    }
     353  else if (libname[0] != '.')
     354    return -1;
     355
     356  return 0;
     357}
     358
    327359static const autofilter_entry_type autofilter_objlist[] =
    328360{
    329361  { STRING_COMMA_LEN ("crt0.o") },
     
    501533
    502534          while (afptr->name)
    503535            {
    504               if (strncmp (libname, afptr->name, afptr->len) == 0 )
     536              if (libnamencmp (libname, afptr) == 0 )
    505537                return 0;
    506538              afptr++;
    507539            }
  • ld/testsuite/ChangeLog

    diff -Naur binutils-2.19.orig/ld/testsuite/ChangeLog binutils-2.19/ld/testsuite/ChangeLog
    old new  
     12009-01-14  Joseph Myers  <joseph@codesourcery.com>
     2
     3        * ld-arm/thumb2-bl-undefweak.d, ld-arm/thumb2-bl-undefweak.s: New.
     4        * ld-arm/arm-elf.exp: Run thumb2-bl-undefweak test.
     5
    162008-09-30  Alan Modra  <amodra@bigpond.net.au>
    27
    38        * ld-elf/extract-symbol-1sec.d: Correct section lma.
  • ld/testsuite/ld-arm/arm-elf.exp

    diff -Naur binutils-2.19.orig/ld/testsuite/ld-arm/arm-elf.exp binutils-2.19/ld/testsuite/ld-arm/arm-elf.exp
    old new  
    184184run_dump_test "group-relocs-ldr-bad"
    185185run_dump_test "group-relocs-ldrs-bad"
    186186run_dump_test "group-relocs-ldc-bad"
     187run_dump_test "thumb2-bl-undefweak"
    187188run_dump_test "emit-relocs1"
    188189
    189190# Exclude non-ARM-EABI targets.
  • opcodes/ChangeLog

    diff -Naur binutils-2.19.orig/opcodes/ChangeLog binutils-2.19/opcodes/ChangeLog
    old new  
     12008-11-27  Alan Modra  <amodra@bigpond.net.au>
     2
     3        * ppc-opc.c (extract_sprg): Correct operand range check.
     4
     52008-11-26  Andreas Schwab  <schwab@suse.de>
     6
     7        * m68k-dis.c (NEXTBYTE, NEXTWORD, NEXTLONG, NEXTULONG, NEXTSINGLE)
     8        (NEXTDOUBLE, NEXTEXTEND, NEXTPACKED): Fix error handling.
     9        (save_printer, save_print_address): Remove.
     10        (fetch_data): Don't use them.
     11        (match_insn_m68k): Always restore printing functions.
     12        (print_insn_m68k): Don't save/restore printing functions.
     13
     142008-11-25  Nick Clifton  <nickc@redhat.com>
     15
     16        * m68k-dis.c: Rewrite to remove use of setjmp/longjmp.
     17
    1182008-09-29  Nick Clifton  <nickc@redhat.com>
    219
    320        * po/vi.po: Updated Vietnamese translation.
  • opcodes/m68k-dis.c

    diff -Naur binutils-2.19.orig/opcodes/m68k-dis.c binutils-2.19/opcodes/m68k-dis.c
    old new  
    6060#endif
    6161
    6262/* Get a 1 byte signed integer.  */
    63 #define NEXTBYTE(p)  (p += 2, FETCH_DATA (info, p), COERCE_SIGNED_CHAR(p[-1]))
     63#define NEXTBYTE(p, val)                        \
     64  do                                            \
     65    {                                           \
     66      p += 2;                                   \
     67      if (!FETCH_DATA (info, p))                \
     68        return -3;                              \
     69      val = COERCE_SIGNED_CHAR (p[-1]);         \
     70    }                                           \
     71  while (0)
    6472
    6573/* Get a 2 byte signed integer.  */
    6674#define COERCE16(x) ((int) (((x) ^ 0x8000) - 0x8000))
    67 #define NEXTWORD(p)  \
    68   (p += 2, FETCH_DATA (info, p), \
    69    COERCE16 ((p[-2] << 8) + p[-1]))
     75
     76#define NEXTWORD(p, val, ret_val)               \
     77  do                                            \
     78    {                                           \
     79      p += 2;                                   \
     80      if (!FETCH_DATA (info, p))                \
     81        return ret_val;                         \
     82      val = COERCE16 ((p[-2] << 8) + p[-1]);    \
     83    }                                           \
     84  while (0)                                             
    7085
    7186/* Get a 4 byte signed integer.  */
    7287#define COERCE32(x) ((bfd_signed_vma) ((x) ^ 0x80000000) - 0x80000000)
    73 #define NEXTLONG(p)  \
    74   (p += 4, FETCH_DATA (info, p), \
    75    (COERCE32 ((((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1])))
     88
     89#define NEXTLONG(p, val, ret_val)                                       \
     90  do                                                                    \
     91    {                                                                   \
     92      p += 4;                                                           \
     93      if (!FETCH_DATA (info, p))                                        \
     94        return ret_val;                                                 \
     95      val = COERCE32 ((((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1]); \
     96    }                                                                   \
     97  while (0)
    7698
    7799/* Get a 4 byte unsigned integer.  */
    78 #define NEXTULONG(p)  \
    79   (p += 4, FETCH_DATA (info, p), \
    80    (unsigned int) ((((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1]))
     100#define NEXTULONG(p, val)                                               \
     101  do                                                                    \
     102    {                                                                   \
     103      p += 4;                                                           \
     104      if (!FETCH_DATA (info, p))                                        \
     105        return -3;                                                      \
     106      val = (unsigned int) ((((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1]); \
     107    }                                                                   \
     108  while (0)
    81109
    82110/* Get a single precision float.  */
    83 #define NEXTSINGLE(val, p) \
    84   (p += 4, FETCH_DATA (info, p), \
    85    floatformat_to_double (&floatformat_ieee_single_big, (char *) p - 4, &val))
     111#define NEXTSINGLE(val, p)                                      \
     112  do                                                            \
     113    {                                                           \
     114      p += 4;                                                   \
     115      if (!FETCH_DATA (info, p))                                \
     116        return -3;                                              \
     117      floatformat_to_double (& floatformat_ieee_single_big,     \
     118                             (char *) p - 4, & val);            \
     119    }                                                           \
     120  while (0)
    86121
    87122/* Get a double precision float.  */
    88 #define NEXTDOUBLE(val, p) \
    89   (p += 8, FETCH_DATA (info, p), \
    90    floatformat_to_double (&floatformat_ieee_double_big, (char *) p - 8, &val))
     123#define NEXTDOUBLE(val, p)                                      \
     124  do                                                            \
     125    {                                                           \
     126      p += 8;                                                   \
     127      if (!FETCH_DATA (info, p))                                \
     128        return -3;                                              \
     129      floatformat_to_double (& floatformat_ieee_double_big,     \
     130                             (char *) p - 8, & val);            \
     131    }                                                           \
     132  while (0)
    91133
    92134/* Get an extended precision float.  */
    93 #define NEXTEXTEND(val, p) \
    94   (p += 12, FETCH_DATA (info, p), \
    95    floatformat_to_double (&floatformat_m68881_ext, (char *) p - 12, &val))
     135#define NEXTEXTEND(val, p)                              \
     136  do                                                    \
     137    {                                                   \
     138      p += 12;                                          \
     139      if (!FETCH_DATA (info, p))                        \
     140        return -3;                                      \
     141      floatformat_to_double (& floatformat_m68881_ext,  \
     142                             (char *) p - 12, & val);   \
     143    }                                                   \
     144  while (0)
    96145
    97146/* Need a function to convert from packed to double
    98147   precision.   Actually, it's easier to print a
    99148   packed number than a double anyway, so maybe
    100149   there should be a special case to handle this... */
    101 #define NEXTPACKED(p) \
    102   (p += 12, FETCH_DATA (info, p), 0.0)
     150#define NEXTPACKED(p, val)                      \
     151  do                                            \
     152    {                                           \
     153      p += 12;                                  \
     154      if (!FETCH_DATA (info, p))                \
     155        return -3;                              \
     156      val = 0.0;                                \
     157    }                                           \
     158  while (0)
     159
    103160
    104161
    105162/* Maximum length of an instruction.  */
  • opcodes/ppc-opc.c

     #define MAXLEN 22
    @@ -112,12 +169,10 @@
       bfd_byte *max_fetched;
       bfd_byte the_buffer[MAXLEN];
       bfd_vma insn_start;
    -  jmp_buf bailout;
     };
     
     /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
    -   to ADDR (exclusive) are valid.  Returns 1 for success, longjmps
    -   on error.  */
    +   to ADDR (exclusive) are valid.  Returns 1 for success, 0 on error.  */
     #define FETCH_DATA(info, addr) \
       ((addr) <= ((struct private *) (info->private_data))->max_fetched \
        ? 1 : fetch_data ((info), (addr)))
    @@ -136,7 +191,7 @@
       if (status != 0)
         {
           (*info->memory_error_func) (status, start, info);
    -      longjmp (priv->bailout, 1);
    +      return 0;
         }
       else
         priv->max_fetched = addr;
    @@ -161,7 +216,8 @@
     /* Fetch BITS bits from a position in the instruction specified by CODE.
        CODE is a "place to put an argument", or 'x' for a destination
        that is a general address (mode and register).
    -   BUFFER contains the instruction.  */
    +   BUFFER contains the instruction.
    +   Returns -1 on failure.  */
     
     static int
     fetch_arg (unsigned char *buffer,
    @@ -216,64 +272,75 @@
           break;
     
         case 'k':
    -      FETCH_DATA (info, buffer + 3);
    +      if (! FETCH_DATA (info, buffer + 3))
    +	return -1;
           val = (buffer[3] >> 4);
           break;
     
         case 'C':
    -      FETCH_DATA (info, buffer + 3);
    +      if (! FETCH_DATA (info, buffer + 3))
    +	return -1;
           val = buffer[3];
           break;
     
         case '1':
    -      FETCH_DATA (info, buffer + 3);
    +      if (! FETCH_DATA (info, buffer + 3))
    +	return -1;
           val = (buffer[2] << 8) + buffer[3];
           val >>= 12;
           break;
     
         case '2':
    -      FETCH_DATA (info, buffer + 3);
    +      if (! FETCH_DATA (info, buffer + 3))
    +	return -1;
           val = (buffer[2] << 8) + buffer[3];
           val >>= 6;
           break;
     
         case '3':
         case 'j':
    -      FETCH_DATA (info, buffer + 3);
    +      if (! FETCH_DATA (info, buffer + 3))
    +	return -1;
           val = (buffer[2] << 8) + buffer[3];
           break;
     
         case '4':
    -      FETCH_DATA (info, buffer + 5);
    +      if (! FETCH_DATA (info, buffer + 5))
    +	return -1;
           val = (buffer[4] << 8) + buffer[5];
           val >>= 12;
           break;
     
         case '5':
    -      FETCH_DATA (info, buffer + 5);
    +      if (! FETCH_DATA (info, buffer + 5))
    +	return -1;
           val = (buffer[4] << 8) + buffer[5];
           val >>= 6;
           break;
     
         case '6':
    -      FETCH_DATA (info, buffer + 5);
    +      if (! FETCH_DATA (info, buffer + 5))
    +	return -1;
           val = (buffer[4] << 8) + buffer[5];
           break;
     
         case '7':
    -      FETCH_DATA (info, buffer + 3);
    +      if (! FETCH_DATA (info, buffer + 3))
    +	return -1;
           val = (buffer[2] << 8) + buffer[3];
           val >>= 7;
           break;
     
         case '8':
    -      FETCH_DATA (info, buffer + 3);
    +      if (! FETCH_DATA (info, buffer + 3))
    +	return -1;
           val = (buffer[2] << 8) + buffer[3];
           val >>= 10;
           break;
     
         case '9':
    -      FETCH_DATA (info, buffer + 3);
    +      if (! FETCH_DATA (info, buffer + 3))
    +	return -1;
           val = (buffer[2] << 8) + buffer[3];
           val >>= 5;
           break;
    @@ -283,7 +350,8 @@
           break;
     
         case 'E':
    -      FETCH_DATA (info, buffer + 3);
    +      if (! FETCH_DATA (info, buffer + 3))
    +	return -1;
           val = (buffer[2] >> 1);
           break;
     
    @@ -450,7 +518,8 @@
     
     /* Print an indexed argument.  The base register is BASEREG (-1 for pc).
        P points to extension word, in buffer.
    -   ADDR is the nominal core address of that extension word.  */
    +   ADDR is the nominal core address of that extension word.
    +   Returns NULL upon error.  */
     
     static unsigned char *
     print_indexed (int basereg,
    @@ -465,7 +534,7 @@
       char buf[40];
       char vmabuf[50];
     
    -  word = NEXTWORD (p);
    +  NEXTWORD (p, word, NULL);
     
       /* Generate the text for the index register.
          Where this will be output is not yet determined.  */
    @@ -503,10 +572,10 @@
       switch ((word >> 4) & 3)
         {
         case 2:
    -      base_disp = NEXTWORD (p);
    +      NEXTWORD (p, base_disp, NULL);
           break;
         case 3:
    -      base_disp = NEXTLONG (p);
    +      NEXTLONG (p, base_disp, NULL);
         }
       if (basereg == -1)
         base_disp += addr;
    @@ -526,10 +595,10 @@
       switch (word & 3)
         {
         case 2:
    -      outer_disp = NEXTWORD (p);
    +      NEXTWORD (p, outer_disp, NULL);
           break;
         case 3:
    -      outer_disp = NEXTLONG (p);
    +      NEXTLONG (p, outer_disp, NULL);
         }
     
       print_base (basereg, base_disp, info);
    @@ -547,9 +616,18 @@
       return p;
     }
     
    +#define FETCH_ARG(size, val)				\
    +  do							\
    +    {							\
    +      val = fetch_arg (buffer, place, size, info);	\
    +      if (val < 0)					\
    +	return -3;					\
    +    }							\
    +  while (0)
    +
     /* Returns number of bytes "eaten" by the operand, or
        return -1 if an invalid operand was found, or -2 if
    -   an opcode tabe error was found.
    +   an opcode tabe error was found or -3 to simply abort.
        ADDR is the pc for this arg to be relative to.  */
     
     static int
    @@ -575,23 +653,21 @@
         case 'c':		/* Cache identifier.  */
           {
             static char *const cacheFieldName[] = { "nc", "dc", "ic", "bc" };
    -        val = fetch_arg (buffer, place, 2, info);
    -        (*info->fprintf_func) (info->stream, cacheFieldName[val]);
    +        FETCH_ARG (2, val);
    +	(*info->fprintf_func) (info->stream, cacheFieldName[val]);
             break;
           }
     
         case 'a':		/* Address register indirect only. Cf. case '+'.  */
           {
    -        (*info->fprintf_func)
    -	  (info->stream,
    -	   "%s@",
    -	   reg_names[fetch_arg (buffer, place, 3, info) + 8]);
    +	FETCH_ARG (3, val);
    +	(*info->fprintf_func) (info->stream, "%s@", reg_names[val + 8]);
             break;
           }
     
         case '_':		/* 32-bit absolute address for move16.  */
           {
    -        uval = NEXTULONG (p);
    +        NEXTULONG (p, uval);
     	(*info->print_address_func) (uval, info);
             break;
           }
    @@ -643,7 +719,7 @@
     	     /* Fido added these.  */
                  {"%cac", 0xffe}, {"%mbo", 0xfff}};
     
    -	val = fetch_arg (buffer, place, 12, info);
    +	FETCH_ARG (12, val);
     	for (regno = sizeof names / sizeof names[0] - 1; regno >= 0; regno--)
     	  if (names[regno].value == val)
     	    {
    @@ -656,7 +732,7 @@
           break;
     
         case 'Q':
    -      val = fetch_arg (buffer, place, 3, info);
    +      FETCH_ARG (3, val);
           /* 0 means 8, except for the bkpt instruction... */
           if (val == 0 && d[1] != 's')
     	val = 8;
    @@ -664,7 +740,7 @@
           break;
     
         case 'x':
    -      val = fetch_arg (buffer, place, 3, info);
    +      FETCH_ARG (3, val);
           /* 0 means -1.  */
           if (val == 0)
     	val = -1;
    @@ -672,12 +748,12 @@
           break;
     
         case 'j':
    -      val = fetch_arg (buffer, place, 3, info);
    +      FETCH_ARG (3, val);
           (*info->fprintf_func) (info->stream, "#%d", val+1);
           break;
     
         case 'K':
    -      val = fetch_arg (buffer, place, 9, info);
    +      FETCH_ARG (9, val);
           (*info->fprintf_func) (info->stream, "#%d", val);
           break;
     
    @@ -685,12 +761,13 @@
           if (place == 'h')
     	{
     	  static char *const scalefactor_name[] = { "<<", ">>" };
    -	  val = fetch_arg (buffer, place, 1, info);
    +
    +	  FETCH_ARG (1, val);
     	  (*info->fprintf_func) (info->stream, scalefactor_name[val]);
     	}
           else
     	{
    -	  val = fetch_arg (buffer, place, 8, info);
    +	  FETCH_ARG (8, val);
     	  if (val & 0x80)
     	    val = val - 0x100;
     	  (*info->fprintf_func) (info->stream, "#%d", val);
    @@ -698,29 +775,27 @@
           break;
     
         case 'T':
    -      val = fetch_arg (buffer, place, 4, info);
    +      FETCH_ARG (4, val);
           (*info->fprintf_func) (info->stream, "#%d", val);
           break;
     
         case 'D':
    -      (*info->fprintf_func) (info->stream, "%s",
    -			     reg_names[fetch_arg (buffer, place, 3, info)]);
    +      FETCH_ARG (3, val);
    +      (*info->fprintf_func) (info->stream, "%s", reg_names[val]);
           break;
     
         case 'A':
    -      (*info->fprintf_func)
    -	(info->stream, "%s",
    -	 reg_names[fetch_arg (buffer, place, 3, info) + 010]);
    +      FETCH_ARG (3, val);
    +      (*info->fprintf_func) (info->stream, "%s", reg_names[val + 010]);
           break;
     
         case 'R':
    -      (*info->fprintf_func)
    -	(info->stream, "%s",
    -	 reg_names[fetch_arg (buffer, place, 4, info)]);
    +      FETCH_ARG (4, val);
    +      (*info->fprintf_func) (info->stream, "%s", reg_names[val]);
           break;
     
         case 'r':
    -      regno = fetch_arg (buffer, place, 4, info);
    +      FETCH_ARG (4, regno);
           if (regno > 7)
     	(*info->fprintf_func) (info->stream, "%s@", reg_names[regno]);
           else
    @@ -728,13 +803,12 @@
           break;
     
         case 'F':
    -      (*info->fprintf_func)
    -	(info->stream, "%%fp%d",
    -	 fetch_arg (buffer, place, 3, info));
    +      FETCH_ARG (3, val);
    +      (*info->fprintf_func) (info->stream, "%%fp%d", val);
           break;
     
         case 'O':
    -      val = fetch_arg (buffer, place, 6, info);
    +      FETCH_ARG (6, val);
           if (val & 0x20)
     	(*info->fprintf_func) (info->stream, "%s", reg_names[val & 7]);
           else
    @@ -742,78 +816,78 @@
           break;
     
         case '+':
    -      (*info->fprintf_func)
    -	(info->stream, "%s@+",
    -	 reg_names[fetch_arg (buffer, place, 3, info) + 8]);
    +      FETCH_ARG (3, val);
    +      (*info->fprintf_func) (info->stream, "%s@+", reg_names[val + 8]);
           break;
     
         case '-':
    -      (*info->fprintf_func)
    -	(info->stream, "%s@-",
    -	 reg_names[fetch_arg (buffer, place, 3, info) + 8]);
    +      FETCH_ARG (3, val);
    +      (*info->fprintf_func) (info->stream, "%s@-", reg_names[val + 8]);
           break;
     
         case 'k':
           if (place == 'k')
    -	(*info->fprintf_func)
    -	  (info->stream, "{%s}",
    -	   reg_names[fetch_arg (buffer, place, 3, info)]);
    +	{
    +	  FETCH_ARG (3, val);
    +	  (*info->fprintf_func) (info->stream, "{%s}", reg_names[val]);
    +	}
           else if (place == 'C')
     	{
    -	  val = fetch_arg (buffer, place, 7, info);
    +	  FETCH_ARG (7, val);
     	  if (val > 63)		/* This is a signed constant.  */
     	    val -= 128;
     	  (*info->fprintf_func) (info->stream, "{#%d}", val);
     	}
           else
    -	return -2;
    +	return -1;
           break;
     
         case '#':
         case '^':
           p1 = buffer + (*d == '#' ? 2 : 4);
           if (place == 's')
    -	val = fetch_arg (buffer, place, 4, info);
    +	FETCH_ARG (4, val);
           else if (place == 'C')
    -	val = fetch_arg (buffer, place, 7, info);
    +	FETCH_ARG (7, val);
           else if (place == '8')
    -	val = fetch_arg (buffer, place, 3, info);
    +	FETCH_ARG (3, val);
           else if (place == '3')
    -	val = fetch_arg (buffer, place, 8, info);
    +	FETCH_ARG (8, val);
           else if (place == 'b')
    -	val = NEXTBYTE (p1);
    +	NEXTBYTE (p1, val);
           else if (place == 'w' || place == 'W')
    -	val = NEXTWORD (p1);
    +	NEXTWORD (p1, val, -3);
           else if (place == 'l')
    -	val = NEXTLONG (p1);
    +	NEXTLONG (p1, val, -3);
           else
     	return -2;
    +
           (*info->fprintf_func) (info->stream, "#%d", val);
           break;
     
         case 'B':
           if (place == 'b')
    -	disp = NEXTBYTE (p);
    +	NEXTBYTE (p, disp);
           else if (place == 'B')
     	disp = COERCE_SIGNED_CHAR (buffer[1]);
           else if (place == 'w' || place == 'W')
    -	disp = NEXTWORD (p);
    +	NEXTWORD (p, disp, -3);
           else if (place == 'l' || place == 'L' || place == 'C')
    -	disp = NEXTLONG (p);
    +	NEXTLONG (p, disp, -3);
           else if (place == 'g')
     	{
    -	  disp = NEXTBYTE (buffer);
    +	  NEXTBYTE (buffer, disp);
     	  if (disp == 0)
    -	    disp = NEXTWORD (p);
    +	    NEXTWORD (p, disp, -3);
     	  else if (disp == -1)
    -	    disp = NEXTLONG (p);
    +	    NEXTLONG (p, disp, -3);
     	}
           else if (place == 'c')
     	{
     	  if (buffer[1] & 0x40)		/* If bit six is one, long offset.  */
    -	    disp = NEXTLONG (p);
    +	    NEXTLONG (p, disp, -3);
     	  else
    -	    disp = NEXTWORD (p);
    +	    NEXTWORD (p, disp, -3);
     	}
           else
     	return -2;
    @@ -822,29 +896,32 @@
           break;
     
         case 'd':
    -      val = NEXTWORD (p);
    -      (*info->fprintf_func)
    -	(info->stream, "%s@(%d)",
    -	 reg_names[fetch_arg (buffer, place, 3, info) + 8], val);
    -      break;
    +      {
    +	int val1;
    +
    +	NEXTWORD (p, val, -3);
    +	FETCH_ARG (3, val1);
    +	(*info->fprintf_func) (info->stream, "%s@(%d)", reg_names[val1 + 8], val);
    +	break;
    +      }
     
         case 's':
    -      (*info->fprintf_func) (info->stream, "%s",
    -			     fpcr_names[fetch_arg (buffer, place, 3, info)]);
    +      FETCH_ARG (3, val);
    +      (*info->fprintf_func) (info->stream, "%s", fpcr_names[val]);
           break;
     
         case 'e':
    -      val = fetch_arg(buffer, place, 2, info);
    +      FETCH_ARG (2, val);
           (*info->fprintf_func) (info->stream, "%%acc%d", val);
           break;
     
         case 'g':
    -      val = fetch_arg(buffer, place, 1, info);
    -      (*info->fprintf_func) (info->stream, "%%accext%s", val==0 ? "01" : "23");
    +      FETCH_ARG (1, val);
    +      (*info->fprintf_func) (info->stream, "%%accext%s", val == 0 ? "01" : "23");
           break;
     
         case 'i':
    -      val = fetch_arg(buffer, place, 2, info);
    +      FETCH_ARG (2, val);
           if (val == 1)
     	(*info->fprintf_func) (info->stream, "<<");
           else if (val == 3)
    @@ -856,7 +933,8 @@
         case 'I':
           /* Get coprocessor ID... */
           val = fetch_arg (buffer, 'd', 3, info);
    -
    +      if (val < 0)
    +	return -3;
           if (val != 1)				/* Unusual coprocessor ID?  */
     	(*info->fprintf_func) (info->stream, "(cpid=%d) ", val);
           break;
    @@ -888,10 +966,16 @@
           if (place == 'd')
     	{
     	  val = fetch_arg (buffer, 'x', 6, info);
    +	  if (val < 0)
    +	    return -3;
     	  val = ((val & 7) << 3) + ((val >> 3) & 7);
     	}
           else
    -	val = fetch_arg (buffer, 's', 6, info);
    +	{
    +	  val = fetch_arg (buffer, 's', 6, info);
    +	  if (val < 0)
    +	    return -3;
    +	}
     
           /* If the <ea> is invalid for *d, then reject this match.  */
           if (!m68k_valid_ea (*d, val))
    @@ -923,29 +1007,31 @@
     	  break;
     
     	case 5:
    -	  val = NEXTWORD (p);
    +	  NEXTWORD (p, val, -3);
     	  (*info->fprintf_func) (info->stream, "%s@(%d)", regname, val);
     	  break;
     
     	case 6:
     	  p = print_indexed (regno, p, addr, info);
    +	  if (p == NULL)
    +	    return -3;
     	  break;
     
     	case 7:
     	  switch (val & 7)
     	    {
     	    case 0:
    -	      val = NEXTWORD (p);
    +	      NEXTWORD (p, val, -3);
     	      (*info->print_address_func) (val, info);
     	      break;
     
     	    case 1:
    -	      uval = NEXTULONG (p);
    +	      NEXTULONG (p, uval);
     	      (*info->print_address_func) (uval, info);
     	      break;
     
     	    case 2:
    -	      val = NEXTWORD (p);
    +	      NEXTWORD (p, val, -3);
     	      (*info->fprintf_func) (info->stream, "%%pc@(");
     	      (*info->print_address_func) (addr + val, info);
     	      (*info->fprintf_func) (info->stream, ")");
    @@ -953,6 +1039,8 @@
     
     	    case 3:
     	      p = print_indexed (-1, p, addr, info);
    +	      if (p == NULL)
    +		return -3;
     	      break;
     
     	    case 4:
    @@ -960,17 +1048,17 @@
     	      switch (place)
     	      {
     		case 'b':
    -		  val = NEXTBYTE (p);
    +		  NEXTBYTE (p, val);
     		  flt_p = 0;
     		  break;
     
     		case 'w':
    -		  val = NEXTWORD (p);
    +		  NEXTWORD (p, val, -3);
     		  flt_p = 0;
     		  break;
     
     		case 'l':
    -		  val = NEXTLONG (p);
    +		  NEXTLONG (p, val, -3);
     		  flt_p = 0;
     		  break;
     
    @@ -987,7 +1075,7 @@
     		  break;
     
     		case 'p':
    -		  flval = NEXTPACKED (p);
    +		  NEXTPACKED (p, flval);
     		  break;
     
     		default:
    @@ -1009,7 +1097,7 @@
     	 mask bit and if set, add a '&' to the arg.  */
           if (place == '/')
     	{
    -	  val = fetch_arg (buffer, place, 1, info);
    +	  FETCH_ARG (1, val);
     	  if (val)
     	    info->fprintf_func (info->stream, "&");
     	}
    @@ -1021,7 +1109,7 @@
     	  {
     	    char doneany;
     	    p1 = buffer + 2;
    -	    val = NEXTWORD (p1);
    +	    NEXTWORD (p1, val, -3);
     	    /* Move the pointer ahead if this point is farther ahead
     	       than the last.  */
     	    p = p1 > p ? p1 : p;
    @@ -1062,7 +1150,8 @@
     	  {
     	    /* `fmovem' insn.  */
     	    char doneany;
    -	    val = fetch_arg (buffer, place, 8, info);
    +
    +	    FETCH_ARG (8, val);
     	    if (val == 0)
     	      {
     		(*info->fprintf_func) (info->stream, "#0");
    @@ -1096,10 +1185,9 @@
     	  }
     	else if (place == '8')
     	  {
    +	    FETCH_ARG (3, val);
     	    /* fmoveml for FP status registers.  */
    -	    (*info->fprintf_func) (info->stream, "%s",
    -				   fpcr_names[fetch_arg (buffer, place, 3,
    -							 info)]);
    +	    (*info->fprintf_func) (info->stream, "%s", fpcr_names[val]);
     	  }
     	else
     	  return -2;
    @@ -1115,9 +1203,10 @@
         case '2':
         case '3':
           {
    -	int val = fetch_arg (buffer, place, 5, info);
    +	int val;
     	char *name = 0;
     
    +	FETCH_ARG (5, val);
     	switch (val)
     	  {
     	  case 2: name = "%tt0"; break;
    @@ -1152,8 +1241,9 @@
     
         case 'f':
           {
    -	int fc = fetch_arg (buffer, place, 5, info);
    +	int fc;
     
    +	FETCH_ARG (5, fc);
     	if (fc == 1)
     	  (*info->fprintf_func) (info->stream, "%%dfc");
     	else if (fc == 0)
    @@ -1170,8 +1260,9 @@
     
         case 't':
           {
    -	int level = fetch_arg (buffer, place, 3, info);
    +	int level;
     
    +	FETCH_ARG (3, level);
     	(*info->fprintf_func) (info->stream, "%d", level);
           }
           break;
    @@ -1179,8 +1270,9 @@
         case 'u':
           {
     	short is_upper = 0;
    -	int reg = fetch_arg (buffer, place, 5, info);
    +	int reg;
     
    +	FETCH_ARG (5, reg);
     	if (reg & 0x10)
     	  {
     	    is_upper = 1;
    @@ -1303,7 +1395,7 @@
     
           if (eaten >= 0)
     	p += eaten;
    -      else if (eaten == -1)
    +      else if (eaten == -1 || eaten == -3)
     	{
     	  info->fprintf_func = save_printer;
     	  info->print_address_func = save_print_address;
    @@ -1318,7 +1410,7 @@
     	  info->fprintf_func (info->stream,
     			      /* xgettext:c-format */
     			      _("<internal error in opcode table: %s %s>\n"),
    -			      best->name,  best->args);
    +			      best->name, best->args);
     	  return 2;
     	}
         }
    @@ -1439,6 +1531,8 @@
     		  if (d[0] == 's' && d[1] == '8')
     		    {
     		      val = fetch_arg (buffer, d[1], 3, info);
    +		      if (val < 0)
    +			return 0;
     		      if ((val & (val - 1)) != 0)
     			break;
     		    }
    @@ -1479,13 +1573,7 @@
     
       bfd_byte *buffer = priv.the_buffer;
     
    -  /* Save these printing functions in case we need to restore them
    -     later.  */
    -  fprintf_ftype save_printer = info->fprintf_func;
    -  void (* save_print_address) (bfd_vma, struct disassemble_info *)
    -    = info->print_address_func;
    -
    -  info->private_data = (PTR) &priv;
    +  info->private_data = & priv;
       /* Tell objdump to use two bytes per chunk
          and six bytes per line for displaying raw data.  */
       info->bytes_per_chunk = 2;
    @@ -1494,49 +1582,23 @@
       priv.max_fetched = priv.the_buffer;
       priv.insn_start = memaddr;
     
    -  if (setjmp (priv.bailout) != 0)
    -    {
    -      /* longjmp may be called while these printing functions are
    -	 temporarily replaced with dummy functions.  Restore them
    -	 before we leave.
    -
    -	 Admittedly, this save-and-restore operation is somewhat ugly
    -	 in that we are exposing the fact that match_insn_m68k
    -	 temporarily replaces insn->fprintf_func and
    -	 insn->print_address_func.  Perhaps, a real fix is to report a
    -	 FETCH_DATA failure with a return value of some sort, without
    -	 using setjmp/longjmp.  A better fix may be to teach the m68k
    -	 disassembler do its job without temporarily replacing
    -	 insn->fprintf_func and insn->print_address_func, but that's a
    -	 task for another day.  */
    -      info->fprintf_func = save_printer;
    -      info->print_address_func = save_print_address;
    -
    -      /* Error return.  */
    -      return -1;
    -    }
    -
       arch_mask = bfd_m68k_mach_to_features (info->mach);
       if (!arch_mask)
         {
           /* First try printing an m680x0 instruction.  Try printing a Coldfire
     	 one if that fails.  */
           val = m68k_scan_mask (memaddr, info, m68k_mask);
    -      if (val)
    -	return val;
    -
    -      val = m68k_scan_mask (memaddr, info, mcf_mask);
    -      if (val)
    -	return val;
    +      if (val == 0)
    +	val = m68k_scan_mask (memaddr, info, mcf_mask);
         }
       else
         {
           val = m68k_scan_mask (memaddr, info, arch_mask);
    -      if (val)
    -	return val;
         }
     
    -  /* Handle undefined instructions.  */
    -  info->fprintf_func (info->stream, "0%o", (buffer[0] << 8) + buffer[1]);
    -  return 2;
    +  if (val == 0)
    +    /* Handle undefined instructions.  */
    +    info->fprintf_func (info->stream, "0%o", (buffer[0] << 8) + buffer[1]);
    +
    +  return val ? val : 2;
     }
    diff -Naur binutils-2.19.orig/opcodes/ppc-opc.c binutils-2.19/opcodes/ppc-opc.c
    old new  
    12811281
    12821282  /* mfsprg can use 260..263 and 272..279.  mtsprg only uses spr 272..279
    12831283     If not BOOKE or 405, then both use only 272..275.  */
    1284   if (val <= 3
    1285       || (val < 0x10 && (insn & 0x100) != 0)
    1286       || (val - 0x10 > 3
    1287           && (dialect & (PPC_OPCODE_BOOKE | PPC_OPCODE_403)) == 0))
     1284  if ((val - 0x10 > 3 && (dialect & (PPC_OPCODE_BOOKE | PPC_OPCODE_405)) == 0)
     1285      || (val - 0x10 > 7 && (insn & 0x100) != 0)
     1286      || val <= 3
     1287      || (val & 8) != 0)
    12881288    *invalid = 1;
    12891289  return val & 7;
    12901290}
Note: See TracBrowser for help on using the repository browser.