Ignore:
Timestamp:
Feb 6, 2017, 1:00:00 PM (8 years ago)
Author:
Silvan Scherrer
Message:

binutils: update trunk to version 2.27

Location:
binutils/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • binutils/trunk

  • TabularUnified binutils/trunk/bfd/elf32-cr16.c

    r970 r1973  
    11/* BFD back-end for National Semiconductor's CR16 ELF
    2    Copyright (C) 2007-2014 Free Software Foundation, Inc.
     2   Copyright (C) 2007-2016 Free Software Foundation, Inc.
    33   Written by M R Swami Reddy.
    44
     
    116116  HOWTO (R_CR16_NONE,              /* type */
    117117         0,                        /* rightshift */
    118          2,                        /* size */
    119          32,                       /* bitsize */
     118         3,                        /* size */
     119         0,                        /* bitsize */
    120120         FALSE,                    /* pc_relative */
    121121         0,                        /* bitpos */
     
    674674  unsigned int r_type = ELF32_R_TYPE (dst->r_info);
    675675
    676   BFD_ASSERT (r_type < (unsigned int) R_CR16_MAX);
     676  if (r_type >= R_CR16_MAX)
     677    {
     678      (*_bfd_error_handler) (_("%B: unrecognised CR16 reloc number: %d"),
     679                             abfd, r_type);
     680      bfd_set_error (bfd_error_bad_value);
     681      r_type = R_CR16_NONE;
     682    }
    677683  cache_ptr->howto = cr16_elf_howto_table + r_type;
    678684}
     
    700706  bfd_boolean result = FALSE;
    701707
    702   if (info->relocatable)
     708  if (bfd_link_relocatable (info))
    703709    return TRUE;
    704710
     
    762768
    763769          if (srelgot == NULL
    764               && (h != NULL || info->executable))
     770              && (h != NULL || bfd_link_executable (info)))
    765771            {
    766772              srelgot = bfd_get_linker_section (dynobj, ".rela.got");
     
    823829              local_got_offsets[r_symndx] = sgot->size;
    824830
    825               if (info->executable)
     831              if (bfd_link_executable (info))
    826832                /* If we are generating a shared object, we need to
    827833                   output a R_CR16_RELATIVE reloc so that the dynamic
     
    14381444                                         rel, 1, relend, howto, 0, contents);
    14391445
    1440       if (info->relocatable)
     1446      if (bfd_link_relocatable (info))
    14411447        continue;
    14421448
     
    14671473            {
    14681474             case bfd_reloc_overflow:
    1469                if (!((*info->callbacks->reloc_overflow)
    1470                      (info, (h ? &h->root : NULL), name, howto->name,
    1471                       (bfd_vma) 0, input_bfd, input_section,
    1472                       rel->r_offset)))
    1473                  return FALSE;
     1475               (*info->callbacks->reloc_overflow)
     1476                 (info, (h ? &h->root : NULL), name, howto->name,
     1477                  (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
    14741478               break;
    14751479
    14761480             case bfd_reloc_undefined:
    1477                if (!((*info->callbacks->undefined_symbol)
    1478                      (info, name, input_bfd, input_section,
    1479                       rel->r_offset, TRUE)))
    1480                  return FALSE;
     1481               (*info->callbacks->undefined_symbol)
     1482                 (info, name, input_bfd, input_section, rel->r_offset, TRUE);
    14811483               break;
    14821484
     
    14981500
    14991501             common_error:
    1500                if (!((*info->callbacks->warning)
    1501                      (info, msg, name, input_bfd, input_section,
    1502                       rel->r_offset)))
    1503                  return FALSE;
     1502               (*info->callbacks->warning) (info, msg, name, input_bfd,
     1503                                            input_section, rel->r_offset);
    15041504               break;
    15051505            }
     
    17711771     this section does not have relocs, or if this is not a
    17721772     code section.  */
    1773   if (link_info->relocatable
     1773  if (bfd_link_relocatable (link_info)
    17741774      || (sec->flags & SEC_RELOC) == 0
    17751775      || sec->reloc_count == 0
     
    23042304         section when generating a shared object, since they do not use
    23052305         copy relocs.  */
    2306       if (! info->executable)
     2306      if (! bfd_link_executable (info))
    23072307        {
    23082308          s = bfd_make_section_anyway_with_flags (abfd,
     
    23492349      || h->needs_plt)
    23502350    {
    2351       if (! info->executable
     2351      if (! bfd_link_executable (info)
    23522352          && !h->def_dynamic
    23532353          && !h->ref_dynamic)
     
    24042404     For such cases we need not do anything here; the relocations will
    24052405     be handled correctly by relocate_section.  */
    2406   if (info->executable)
     2406  if (bfd_link_executable (info))
    24072407    return TRUE;
    24082408
     
    24392439    }
    24402440
    2441   return _bfd_elf_adjust_dynamic_copy (h, s);
     2441  return _bfd_elf_adjust_dynamic_copy (info, h, s);
    24422442}
    24432443
     
    24602460    {
    24612461      /* Set the contents of the .interp section to the interpreter.  */
    2462       if (info->executable)
     2462      if (bfd_link_executable (info) && !info->nointerp)
    24632463        {
    24642464#if 0
     
    25772577         size for the .dynamic section.  The DT_DEBUG entry is filled
    25782578         in by the dynamic linker and used by the debugger.  */
    2579       if (! info->executable)
     2579      if (! bfd_link_executable (info))
    25802580        {
    25812581          if (!_bfd_elf_add_dynamic_entry (info, DT_DEBUG, 0))
     
    26452645         The entry in the global offset table will already have been
    26462646         initialized in the relocate_section function.  */
    2647       if (info->executable
     2647      if (bfd_link_executable (info)
    26482648          && (info->symbolic || h->dynindx == -1)
    26492649          && h->def_regular)
     
    27392739
    27402740            case DT_PLTGOT:
    2741               name = ".got";
     2741              name = ".got.plt";
    27422742              goto get_vma;
    27432743
     
    27452745              name = ".rela.plt";
    27462746            get_vma:
    2747               s = bfd_get_section_by_name (output_bfd, name);
    2748               BFD_ASSERT (s != NULL);
    2749               dyn.d_un.d_ptr = s->vma;
     2747              s = bfd_get_linker_section (dynobj, name);
     2748              dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
    27502749              bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
    27512750              break;
    27522751
    27532752            case DT_PLTRELSZ:
    2754               s = bfd_get_section_by_name (output_bfd, ".rela.plt");
    2755               BFD_ASSERT (s != NULL);
     2753              s = bfd_get_linker_section (dynobj, ".rela.plt");
    27562754              dyn.d_un.d_val = s->size;
    27572755              bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
     
    27682766                 other relocation sections, we don't have to worry
    27692767                 about changing the DT_RELA entry.  */
    2770               s = bfd_get_section_by_name (output_bfd, ".rela.plt");
     2768              s = bfd_get_linker_section (dynobj, ".rela.plt");
    27712769              if (s != NULL)
    27722770                dyn.d_un.d_val -= s->size;
     
    28152813  bfd_size_type amt;
    28162814
    2817   BFD_ASSERT (! info->relocatable);
     2815  BFD_ASSERT (! bfd_link_relocatable (info));
    28182816
    28192817  *errmsg = NULL;
Note: See TracChangeset for help on using the changeset viewer.