source: rtems/contrib/crossrpms/patches/binutils-2.17-rtems4.8-20061021.diff @ 92b61a71

4.104.114.84.95
Last change on this file since 92b61a71 was f4884049, checked in by Ralf Corsepius <ralf.corsepius@…>, on Nov 14, 2006 at 5:50:23 PM

Add.

  • Property mode set to 100644
File size: 19.4 KB
  • bfd/bfd-in2.h

    diff -uNr binutils-2.17.orig/bfd/bfd-in2.h binutils-2.17/bfd/bfd-in2.h
    old new  
    643643  DYN_NO_NEEDED = 8
    644644};
    645645
     646enum notice_asneeded_action {
     647  notice_as_needed,
     648  notice_not_needed,
     649  notice_needed
     650};
     651
    646652extern bfd_boolean bfd_elf_record_link_assignment
    647653  (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
    648654   bfd_boolean);
  • bfd/bfd-in.h

    diff -uNr binutils-2.17.orig/bfd/bfd-in.h binutils-2.17/bfd/bfd-in.h
    old new  
    636636  DYN_NO_NEEDED = 8
    637637};
    638638
     639enum notice_asneeded_action {
     640  notice_as_needed,
     641  notice_not_needed,
     642  notice_needed
     643};
     644
    639645extern bfd_boolean bfd_elf_record_link_assignment
    640646  (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
    641647   bfd_boolean);
  • bfd/ChangeLog

    diff -uNr binutils-2.17.orig/bfd/ChangeLog binutils-2.17/bfd/ChangeLog
    old new  
     12006-08-08  Nick Clifton  <nickc@redhat.com>
     2
     3        PR binutils/2724
     4        * coffcode.h (coff_new_section_hook): Only modify the section
     5        symbol of sections which were created by the user.
     6
     72006-07-19  Alan Modra  <amodra@bigpond.net.au>
     8
     9        * bfd-in.h (enum notice_asneeded_action): Define.
     10        * bfd-in2.h: Regenerate.
     11        * elflink.c (elf_link_add_object_symbols): Call linker "notice"
     12        function with NULL name for as-needed handling.
     13
     142006-07-12  Matthew R. Dempsky  <mrd@alkemio.org>
     15
     16        * cpu-m68k.c (bfd_m68k_compatible): Handle CPU32.
     17
     182006-06-23  Daniel Jacobowitz  <dan@codesourcery.com>
     19
     20        * Makefile.am: Clear RELEASE.
     21        * Makefile.in: Regenerated.
     22
    1232006-06-23  Daniel Jacobowitz  <dan@codesourcery.com>
    224
    325        * configure.in: Update version to 2.17.
  • bfd/coffcode.h

    diff -uNr binutils-2.17.orig/bfd/coffcode.h binutils-2.17/bfd/coffcode.h
    old new  
    15461546static bfd_boolean
    15471547coff_new_section_hook (bfd * abfd, asection * section)
    15481548{
    1549   combined_entry_type *native;
    1550   bfd_size_type amt;
    1551 
    15521549  section->alignment_power = COFF_DEFAULT_SECTION_ALIGNMENT_POWER;
    15531550
    15541551#ifdef RS6000COFF_C
     
    15601557    section->alignment_power = bfd_xcoff_data_align_power (abfd);
    15611558#endif
    15621559
    1563   /* Allocate aux records for section symbols, to store size and
    1564      related info.
    1565 
    1566      @@ The 10 is a guess at a plausible maximum number of aux entries
    1567      (but shouldn't be a constant).  */
    1568   amt = sizeof (combined_entry_type) * 10;
    1569   native = bfd_zalloc (abfd, amt);
    1570   if (native == NULL)
    1571     return FALSE;
    1572 
    1573   /* We don't need to set up n_name, n_value, or n_scnum in the native
    1574      symbol information, since they'll be overridden by the BFD symbol
    1575      anyhow.  However, we do need to set the type and storage class,
    1576      in case this symbol winds up getting written out.  The value 0
    1577      for n_numaux is already correct.  */
    1578 
    1579   native->u.syment.n_type = T_NULL;
    1580   native->u.syment.n_sclass = C_STAT;
     1560  /* PR binutils/2724: Only real sections have a symbol that
     1561     has the coff_symbol_type structure allocated for it.  */
     1562  if (! bfd_is_const_section (section))
     1563    {
     1564      combined_entry_type *native;
     1565      bfd_size_type amt;
     1566
     1567      /* Allocate aux records for section symbols, to store size and
     1568         related info.
     1569
     1570         @@ The 10 is a guess at a plausible maximum number of aux entries
     1571         (but shouldn't be a constant).  */
     1572      amt = sizeof (combined_entry_type) * 10;
     1573      native = bfd_zalloc (abfd, amt);
     1574      if (native == NULL)
     1575        return FALSE;
    15811576
    1582   coffsymbol (section->symbol)->native = native;
     1577      /* We don't need to set up n_name, n_value, or n_scnum in the native
     1578         symbol information, since they'll be overridden by the BFD symbol
     1579         anyhow.  However, we do need to set the type and storage class,
     1580         in case this symbol winds up getting written out.  The value 0
     1581         for n_numaux is already correct.  */
     1582      native->u.syment.n_type = T_NULL;
     1583      native->u.syment.n_sclass = C_STAT;
    15831584
     1585      coffsymbol (section->symbol)->native = native;
     1586    }
     1587 
    15841588  coff_set_custom_section_alignment (abfd, section,
    15851589                                     coff_section_alignment_table,
    15861590                                     coff_section_alignment_table_size);
  • bfd/cpu-m68k.c

    diff -uNr binutils-2.17.orig/bfd/cpu-m68k.c binutils-2.17/bfd/cpu-m68k.c
    old new  
    202202  if (a->mach <= bfd_mach_m68060 && b->mach <= bfd_mach_m68060)
    203203    /* Merge m68k machine. */
    204204    return a->mach > b->mach ? a : b;
     205  else if (a->mach == bfd_mach_cpu32 && b->mach == bfd_mach_cpu32)
     206    /* CPU32 is compatible with itself. */
     207    return a;
    205208  else if (a->mach >= bfd_mach_mcf_isa_a_nodiv
    206209           && b->mach >= bfd_mach_mcf_isa_a_nodiv)
    207210    {
  • bfd/elflink.c

    diff -uNr binutils-2.17.orig/bfd/elflink.c binutils-2.17/bfd/elflink.c
    old new  
    34963496      if (alloc_mark == NULL)
    34973497        goto error_free_vers;
    34983498
     3499      /* Make a special call to the linker "notice" function to
     3500         tell it that we are about to handle an as-needed lib.  */
     3501      if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
     3502                                       notice_as_needed))
     3503        return FALSE;
     3504
     3505
    34993506      /* Clone the symbol table and sym hashes.  Remember some
    35003507         pointers into the symbol table, and dynamic symbol count.  */
    35013508      old_hash = (char *) old_tab + tabsize;
     
    41694176            }
    41704177        }
    41714178
     4179      /* Make a special call to the linker "notice" function to
     4180         tell it that symbols added for crefs may need to be removed.  */
     4181      if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
     4182                                       notice_not_needed))
     4183        return FALSE;
     4184
    41724185      free (old_tab);
    41734186      objalloc_free_block ((struct objalloc *) htab->root.table.memory,
    41744187                           alloc_mark);
     
    41794192
    41804193  if (old_tab != NULL)
    41814194    {
     4195      if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
     4196                                       notice_needed))
     4197        return FALSE;
    41824198      free (old_tab);
    41834199      old_tab = NULL;
    41844200    }
  • bfd/version.h

    diff -uNr binutils-2.17.orig/bfd/version.h binutils-2.17/bfd/version.h
    old new  
    1 #define BFD_VERSION_DATE 20060623
     1#define BFD_VERSION_DATE 20061021
    22#define BFD_VERSION @bfd_version@
    33#define BFD_VERSION_STRING @bfd_version_string@
  • binutils/ChangeLog

    diff -uNr binutils-2.17.orig/binutils/ChangeLog binutils-2.17/binutils/ChangeLog
    old new  
     12006-08-15  Nick Clifton  <nickc@redhat.com>
     2
     3        PR binutils/3039
     4        * wrstabs.c (stab_tag_type): Initialize 'size'.
     5
    162006-06-07  Joseph S. Myers  <joseph@codesourcery.com>
    27
    38        * po/Make-in (pdf, ps): New dummy targets.
  • binutils/wrstabs.c

    diff -uNr binutils-2.17.orig/binutils/wrstabs.c binutils-2.17/binutils/wrstabs.c
    old new  
    18691869{
    18701870  struct stab_write_handle *info = (struct stab_write_handle *) p;
    18711871  long index;
    1872   unsigned int size;
     1872  unsigned int size = 0;
    18731873
    18741874  index = stab_get_struct_index (info, name, id, kind, &size);
    18751875  if (index < 0)
  • gas/ChangeLog

    diff -uNr binutils-2.17.orig/gas/ChangeLog binutils-2.17/gas/ChangeLog
    old new  
     12006-07-19  Mat Hostetter  <mat@lcs.mit.edu>
     2
     3        * symbols.c (report_op_error): Fix pasto.  Don't use as_bad_where
     4        when file and line unknown.
     5
    162006-06-07  Joseph S. Myers  <joseph@codesourcery.com>
    27
    38        * po/Make-in (pdf, ps): New dummy targets.
  • gas/symbols.c

    diff -uNr binutils-2.17.orig/gas/symbols.c binutils-2.17/gas/symbols.c
    old new  
    928928          && seg_right != undefined_section)
    929929        {
    930930          if (right)
    931             as_bad_where (file, line,
    932                           _("invalid sections for operation on `%s' and `%s' setting `%s'"),
    933                           S_GET_NAME (left), S_GET_NAME (right), S_GET_NAME (symp));
     931            as_bad (_("invalid sections for operation on `%s' and `%s' setting `%s'"),
     932                    S_GET_NAME (left), S_GET_NAME (right), S_GET_NAME (symp));
    934933          else
    935             as_bad_where (file, line,
    936                           _("invalid section for operation on `%s' setting `%s'"),
    937                           S_GET_NAME (left), S_GET_NAME (symp));
     934            as_bad (_("invalid section for operation on `%s' setting `%s'"),
     935                    S_GET_NAME (left), S_GET_NAME (symp));
    938936        }
    939937    }
    940938}
  • ld/ChangeLog

    diff -uNr binutils-2.17.orig/ld/ChangeLog binutils-2.17/ld/ChangeLog
    old new  
     12006-07-19  Alan Modra  <amodra@bigpond.net.au>
     2
     3        * ld.h (handle_asneeded_cref): Declare.
     4        * ldcref.c: Include objalloc.h.
     5        (old_table, old_tab, alloc_mark): New variables.
     6        (tabsize, entsize, refsize, old_symcount): Likewise.
     7        (add_cref): Use bfd_hash_allocate for refs.
     8        (handle_asneeded_cref): New function.
     9        * ldmain.c (notice): Call handle_asneeded_cref for NULL name.
     10
     112006-07-04  Daniel Jacobowitz  <dan@codesourcery.com>
     12
     13        Backport:
     14        2006-05-19  Alan Modra  <amodra@bigpond.net.au>
     15        * ldlang.c (lang_size_sections_1): Don't check mem regions for
     16        os->ignored sections.
     17
    1182006-06-12  Fred Fish  <fnf@specifix.com>
    219
    320        * emulparams/elf32bmip.sh (OTHER_SECTIONS): Keep the
  • ld/configure.tgt

    diff -uNr binutils-2.17.orig/ld/configure.tgt binutils-2.17/ld/configure.tgt
    old new  
    8383avr-*-*)                targ_emul=avr2
    8484                        targ_extra_emuls="avr1 avr3 avr4 avr5"
    8585                        ;;
    86 bfin-*-elf)             targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" ;;
     86bfin-*-elf | bfin-*-rtems*)
     87                        targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" ;;
    8788bfin-*-uclinux*)        targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" ;;
    8889cr16c-*-elf*)           targ_emul=elf32cr16c
    8990                        ;;
  • ld/emulparams/h8300elf.sh

    diff -uNr binutils-2.17.orig/ld/emulparams/h8300elf.sh binutils-2.17/ld/emulparams/h8300elf.sh
    old new  
    1717TINY_DATA_SECTION=".tinydata    0xff8000 :
    1818  {
    1919        *(.tinydata)
    20         _tinydata = .;
     20        ${RELOCATING+ _tinydata = .; }
    2121  }"
    2222TINY_BSS_SECTION=".tinybss      : AT (_tinydata)
    2323  {
  • binutils-2.17

    diff -uNr binutils-2.17.orig/ld/ldcref.c binutils-2.17/ld/ldcref.c
    old new  
    2727#include "sysdep.h"
    2828#include "bfdlink.h"
    2929#include "libiberty.h"
     30#include "objalloc.h"
    3031
    3132#include "ld.h"
    3233#include "ldmain.h"
     
    101102
    102103static size_t cref_symcount;
    103104
     105/* Used to take a snapshot of the cref hash table when starting to
     106   add syms from an as-needed library.  */
     107static struct bfd_hash_entry **old_table;
     108static unsigned int old_size;
     109static void *old_tab;
     110static void *alloc_mark;
     111static size_t tabsize, entsize, refsize;
     112static size_t old_symcount;
     113
    104114/* Create an entry in a cref hash table.  */
    105115
    106116static struct bfd_hash_entry *
     
    165175
    166176  if (r == NULL)
    167177    {
    168       r = xmalloc (sizeof *r);
     178      r = bfd_hash_allocate (&cref_table.root, sizeof *r);
     179      if (r == NULL)
     180        einfo (_("%X%P: cref alloc failed: %E\n"));
    169181      r->next = h->refs;
    170182      h->refs = r;
    171183      r->abfd = abfd;
     
    182194    r->def = TRUE;
    183195}
    184196
     197/* Called before loading an as-needed library to take a snapshot of
     198   the cref hash table, and after we have loaded or found that the
     199   library was not needed.  */
     200
     201bfd_boolean
     202handle_asneeded_cref (bfd *abfd ATTRIBUTE_UNUSED,
     203                      enum notice_asneeded_action act)
     204{
     205  unsigned int i;
     206
     207  if (!cref_initialized)
     208    return TRUE;
     209
     210  if (act == notice_as_needed)
     211    {
     212      char *old_ent, *old_ref;
     213
     214      for (i = 0; i < cref_table.root.size; i++)
     215        {
     216          struct bfd_hash_entry *p;
     217          struct cref_hash_entry *c;
     218          struct cref_ref *r;
     219
     220          for (p = cref_table.root.table[i]; p != NULL; p = p->next)
     221            {
     222              entsize += cref_table.root.entsize;
     223              c = (struct cref_hash_entry *) p;
     224              for (r = c->refs; r != NULL; r = r->next)
     225                refsize += sizeof (struct cref_hash_entry);
     226            }
     227        }
     228
     229      tabsize = cref_table.root.size * sizeof (struct bfd_hash_entry *);
     230      old_tab = xmalloc (tabsize + entsize + refsize);
     231
     232      alloc_mark = bfd_hash_allocate (&cref_table.root, 1);
     233      if (alloc_mark == NULL)
     234        return FALSE;
     235
     236      memcpy (old_tab, cref_table.root.table, tabsize);
     237      old_ent = (char *) old_tab + tabsize;
     238      old_ref = (char *) old_ent + entsize;
     239      old_table = cref_table.root.table;
     240      old_size = cref_table.root.size;
     241      old_symcount = cref_symcount;
     242
     243      for (i = 0; i < cref_table.root.size; i++)
     244        {
     245          struct bfd_hash_entry *p;
     246          struct cref_hash_entry *c;
     247          struct cref_ref *r;
     248
     249          for (p = cref_table.root.table[i]; p != NULL; p = p->next)
     250            {
     251              memcpy (old_ent, p, cref_table.root.entsize);
     252              old_ent = (char *) old_ent + cref_table.root.entsize;
     253              c = (struct cref_hash_entry *) p;
     254              for (r = c->refs; r != NULL; r = r->next)
     255                {
     256                  memcpy (old_ref, r, sizeof (struct cref_hash_entry));
     257                  old_ref = (char *) old_ref + sizeof (struct cref_hash_entry);
     258                }
     259            }
     260        }
     261      return TRUE;
     262    }
     263
     264  if (act == notice_not_needed)
     265    {
     266      char *old_ent, *old_ref;
     267
     268      if (old_tab == NULL)
     269        {
     270          /* The only way old_tab can be NULL is if the cref hash table
     271             had not been initialised when notice_as_needed.  */
     272          bfd_hash_table_free (&cref_table.root);
     273          cref_initialized = FALSE;
     274          return TRUE;
     275        }
     276
     277      old_ent = (char *) old_tab + tabsize;
     278      old_ref = (char *) old_ent + entsize;
     279      cref_table.root.table = old_table;
     280      cref_table.root.size = old_size;
     281      memcpy (cref_table.root.table, old_tab, tabsize);
     282      cref_symcount = old_symcount;
     283
     284      for (i = 0; i < cref_table.root.size; i++)
     285        {
     286          struct bfd_hash_entry *p;
     287          struct cref_hash_entry *c;
     288          struct cref_ref *r;
     289
     290          for (p = cref_table.root.table[i]; p != NULL; p = p->next)
     291            {
     292              memcpy (p, old_ent, cref_table.root.entsize);
     293              old_ent = (char *) old_ent + cref_table.root.entsize;
     294              c = (struct cref_hash_entry *) p;
     295              for (r = c->refs; r != NULL; r = r->next)
     296                {
     297                  memcpy (r, old_ref, sizeof (struct cref_hash_entry));
     298                  old_ref = (char *) old_ref + sizeof (struct cref_hash_entry);
     299                }
     300            }
     301        }
     302
     303      objalloc_free_block ((struct objalloc *) cref_table.root.memory,
     304                           alloc_mark);
     305    }
     306  else if (act != notice_needed)
     307    return FALSE;
     308
     309  free (old_tab);
     310  old_tab = NULL;
     311  return TRUE;
     312}
     313
    185314/* Copy the addresses of the hash table entries into an array.  This
    186315   is called via cref_hash_traverse.  We also fill in the demangled
    187316   name.  */
  • binutils-2.17

    diff -uNr binutils-2.17.orig/ld/ld.h binutils-2.17/ld/ld.h
    old new  
    11/* ld.h -- general linker header file
    22   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
    3    2001, 2002, 2003, 2004, 2005
     3   2001, 2002, 2003, 2004, 2005, 2006
    44   Free Software Foundation, Inc.
    55
    66   This file is part of GLD, the Gnu Linker.
     
    282282
    283283extern int yyparse (void);
    284284extern void add_cref (const char *, bfd *, asection *, bfd_vma);
     285extern bfd_boolean handle_asneeded_cref (bfd *, enum notice_asneeded_action);
    285286extern void output_cref (FILE *);
    286287extern void check_nocrossrefs (void);
    287288extern void ld_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
  • binutils-2.17

    diff -uNr binutils-2.17.orig/ld/ldlang.c binutils-2.17/ld/ldlang.c
    old new  
    42074207                    /* If a loadable section is using the default memory
    42084208                       region, and some non default memory regions were
    42094209                       defined, issue an error message.  */
    4210                     if (!IGNORE_SECTION (os->bfd_section)
     4210                    if (!os->ignored
     4211                        && !IGNORE_SECTION (os->bfd_section)
    42114212                        && ! link_info.relocatable
    42124213                        && check_regions
    42134214                        && strcmp (os->region->name,
  • binutils-2.17

    diff -uNr binutils-2.17.orig/ld/ldmain.c binutils-2.17/ld/ldmain.c
    old new  
    15111511        asection *section,
    15121512        bfd_vma value)
    15131513{
     1514  if (name == NULL)
     1515    {
     1516      if (command_line.cref || nocrossref_list != NULL)
     1517        return handle_asneeded_cref (abfd, value);
     1518      return TRUE;
     1519    }
     1520
    15141521  if (! info->notice_all
    15151522      || (info->notice_hash != NULL
    15161523          && bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != NULL))
  • ld/testsuite/ChangeLog

    diff -uNr binutils-2.17.orig/ld/testsuite/ChangeLog binutils-2.17/ld/testsuite/ChangeLog
    old new  
     12006-07-12  Richard Sandiford  <richard@codesourcery.com>
     2
     3        * ld-m68k/merge-ok-1c.d: New test.
     4        * ld-m68k/m68k.exp: Run it.
     5
     62006-07-04  Daniel Jacobowitz  <dan@codesourcery.com>
     7
     8        Backport:
     9        2006-05-19  Alan Modra  <amodra@bigpond.net.au>
     10        * ld-scripts/empty-orphan.d: Update again.
     11
     12        * ld-scripts/empty-orphan.t: Discard .reginfo.
     13        * ld-scripts/empty-orphan.d: Update.
     14
    1152006-06-12  Daniel Jacobowitz  <dan@codesourcery.com>
    216
    317        Backport:
  • ld/testsuite/ld-m68k/m68k.exp

    diff -uNr binutils-2.17.orig/ld/testsuite/ld-m68k/m68k.exp binutils-2.17/ld/testsuite/ld-m68k/m68k.exp
    old new  
    5353run_dump_test "merge-error-1e"
    5454run_dump_test "merge-ok-1a"
    5555run_dump_test "merge-ok-1b"
     56run_dump_test "merge-ok-1c"
  • ld/testsuite/ld-scripts/empty-orphan.d

    diff -uNr binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.d binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.d
    old new  
    11#source: empty-orphan.s
    22#ld: -T empty-orphan.t
    3 #error: no memory region specified for loadable section
     3#readelf: -l --wide
     4#...
     5 +LOAD +[x0-9a-f]+ [x0]+70000000 [x0]+70000000 [x0]+(2|4|8|10|20|40|80) .*
     6#pass
  • ld/testsuite/ld-scripts/empty-orphan.t

    diff -uNr binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.t binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.t
    old new  
    1717   .text : { *(.text) } > text_mem : text_phdr
    1818   .data : { *(.data) } > data_mem : data_phdr
    1919   .bss : { *(.bss) } > data_mem : data_phdr
     20   /DISCARD/ : { *(.reginfo) }
    2021   /* .orphan_data is an orphan */
    2122}
Note: See TracBrowser for help on using the repository browser.