Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/binutils merge the non-aout-shlib changes forward f...



details:   https://anonhg.NetBSD.org/src/rev/f241c3336821
branches:  trunk
changeset: 555759:f241c3336821
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Nov 27 09:45:33 2003 +0000

description:
merge the non-aout-shlib changes forward from gnu/dist/toolchain.

diffstat:

 gnu/dist/binutils/bfd/archive.c                    |   25 +-
 gnu/dist/binutils/bfd/coff-alpha.c                 |    2 +
 gnu/dist/binutils/bfd/config.bfd                   |   28 +-
 gnu/dist/binutils/bfd/configure                    |    3 +-
 gnu/dist/binutils/bfd/configure.in                 |    3 +-
 gnu/dist/binutils/bfd/elf.c                        |    2 +-
 gnu/dist/binutils/bfd/elf32-vax.c                  |   52 ++-
 gnu/dist/binutils/bfd/elf64-alpha.c                |   27 +-
 gnu/dist/binutils/bfd/elf64-sparc.c                |   13 +-
 gnu/dist/binutils/bfd/elflink.h                    |    6 +-
 gnu/dist/binutils/bfd/format.c                     |   13 +-
 gnu/dist/binutils/bfd/libbfd.h                     |    4 +
 gnu/dist/binutils/bfd/reloc.c                      |   11 +
 gnu/dist/binutils/binutils/objcopy.c               |  111 +++++++-
 gnu/dist/binutils/binutils/strings.c               |    4 +-
 gnu/dist/binutils/gas/config/tc-arm.c              |  305 ++++++++++++++++++++-
 gnu/dist/binutils/gas/config/tc-arm.h              |    3 +
 gnu/dist/binutils/gas/config/tc-hppa.c             |   27 +-
 gnu/dist/binutils/gas/config/tc-hppa.h             |   11 +-
 gnu/dist/binutils/gas/config/tc-i386.c             |    1 +
 gnu/dist/binutils/gas/config/tc-mips.c             |    4 +-
 gnu/dist/binutils/gas/config/tc-vax.c              |   63 +++-
 gnu/dist/binutils/gas/config/vax-inst.h            |    2 +
 gnu/dist/binutils/gas/configure                    |    2 +-
 gnu/dist/binutils/gas/configure.in                 |    2 +-
 gnu/dist/binutils/gprof/corefile.c                 |    5 +-
 gnu/dist/binutils/gprof/gprof.c                    |    2 +
 gnu/dist/binutils/ld/configure.host                |   14 +-
 gnu/dist/binutils/ld/configure.tgt                 |   10 +-
 gnu/dist/binutils/ld/emulparams/armelf_nbsd.sh     |    1 +
 gnu/dist/binutils/ld/emulparams/elf32_sparc.sh     |    1 +
 gnu/dist/binutils/ld/emulparams/elf64alpha_nbsd.sh |    6 +
 gnu/dist/binutils/ld/emulparams/elf_i386.sh        |    1 +
 gnu/dist/binutils/ld/emulparams/hppalinux.sh       |    2 +-
 gnu/dist/binutils/ld/emulparams/hppanbsd.sh        |    2 -
 gnu/dist/binutils/ld/emulparams/hppaobsd.sh        |    3 +-
 gnu/dist/binutils/ld/emulparams/m68kelf.sh         |    1 +
 gnu/dist/binutils/ld/emulparams/m68kelfnbsd.sh     |    2 +-
 gnu/dist/binutils/ld/emulparams/sh.sh              |    4 +-
 gnu/dist/binutils/ld/emulparams/shelf_nbsd.sh      |    6 +-
 gnu/dist/binutils/ld/emultempl/elf32.em            |    2 +-
 gnu/dist/binutils/ld/lexsup.c                      |    2 +-
 gnu/dist/binutils/ld/scripttempl/sh.sc             |   23 +-
 gnu/dist/binutils/opcodes/sh-opc.h                 |    2 +-
 gnu/dist/binutils/opcodes/sparc-dis.c              |    2 +-
 45 files changed, 700 insertions(+), 115 deletions(-)

diffs (truncated from 1685 to 300 lines):

diff -r 73df4603f3dc -r f241c3336821 gnu/dist/binutils/bfd/archive.c
--- a/gnu/dist/binutils/bfd/archive.c   Thu Nov 27 09:40:38 2003 +0000
+++ b/gnu/dist/binutils/bfd/archive.c   Thu Nov 27 09:45:33 2003 +0000
@@ -592,7 +592,9 @@
         Note that last_file->origin can be odd in the case of
         BSD-4.4-style element with a long odd size.  */
       filestart = last_file->origin + size;
-      filestart += filestart % 2;
+      if (!strncmp(arch_hdr (last_file)->ar_name, "#1/", 3))
+       size += strlen(normalize(last_file, last_file->filename));
+      filestart += size % 2;
     }
 
   return _bfd_get_elt_at_filepos (archive, filestart);
@@ -1774,13 +1776,23 @@
   for (current = arch->archive_head; current; current = current->next)
     {
       char buffer[DEFAULT_BUFFERSIZE];
-      unsigned int remaining = arelt_size (current);
+      unsigned int saved_size = arelt_size (current);
+      unsigned int remaining = saved_size;
       struct ar_hdr *hdr = arch_hdr (current);
 
       /* Write ar header.  */
       if (bfd_bwrite ((PTR) hdr, (bfd_size_type) sizeof (*hdr), arch)
          != sizeof (*hdr))
        return FALSE;
+      /* Write filename if it is a 4.4BSD extended file, and add to size.  */
+      if (!strncmp (hdr->ar_name, "#1/", 3))
+       {
+         const char *normal = normalize (current, current->filename);
+         unsigned int thislen = strlen (normal);
+         if (bfd_write (normal, 1, thislen, arch) != thislen)
+           return FALSE;
+         saved_size += thislen;
+       }
       if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0)
        return FALSE;
       while (remaining)
@@ -1799,7 +1811,7 @@
            return FALSE;
          remaining -= amt;
        }
-      if ((arelt_size (current) % 2) == 1)
+      if ((saved_size % 2) == 1)
        {
          if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1)
            return FALSE;
@@ -2030,8 +2042,11 @@
        {
          do
            {
-             firstreal += arelt_size (current) + sizeof (struct ar_hdr);
-             firstreal += firstreal % 2;
+             unsigned int size = arelt_size (current);
+             if (!strncmp(arch_hdr (current)->ar_name, "#1/", 3))
+               size += strlen(normalize(current, current->filename));
+             firstreal += size + sizeof (struct ar_hdr);
+             firstreal += size % 2;
              current = current->next;
            }
          while (current != map[count].u.abfd);
diff -r 73df4603f3dc -r f241c3336821 gnu/dist/binutils/bfd/coff-alpha.c
--- a/gnu/dist/binutils/bfd/coff-alpha.c        Thu Nov 27 09:40:38 2003 +0000
+++ b/gnu/dist/binutils/bfd/coff-alpha.c        Thu Nov 27 09:45:33 2003 +0000
@@ -668,7 +668,9 @@
     case ALPHA_R_OP_STORE:
       /* The STORE reloc needs the size and offset fields.  We store
         them in the addend.  */
+#if 0
       BFD_ASSERT (intern->r_offset <= 256 && intern->r_size <= 256);
+#endif
       rptr->addend = (intern->r_offset << 8) + intern->r_size;
       break;
 
diff -r 73df4603f3dc -r f241c3336821 gnu/dist/binutils/bfd/config.bfd
--- a/gnu/dist/binutils/bfd/config.bfd  Thu Nov 27 09:40:38 2003 +0000
+++ b/gnu/dist/binutils/bfd/config.bfd  Thu Nov 27 09:45:33 2003 +0000
@@ -128,7 +128,7 @@
     targ_defvec=bfd_elf32_ia64_hpux_big_vec
     targ_selvecs="bfd_elf64_ia64_hpux_big_vec"
     ;;
-  sparc64-*-freebsd* | sparc64-*-netbsd* | sparc64-*-openbsd*)
+  sparc64-*-freebsd* | sparc64-*-openbsd*)
     targ_defvec=bfd_elf64_sparc_vec
     targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
     ;;
@@ -141,15 +141,15 @@
 
   armeb-*-netbsdelf*)
     targ_defvec=bfd_elf32_bigarm_vec
-    targ_selvecs="bfd_elf32_littlearm_vec armnetbsd_vec"
+    targ_selvecs="bfd_elf32_littlearm_vec armnetbsd_vec armcoff_little_vec armcoff_big_vec"
     ;;
   arm-*-netbsdelf*)
     targ_defvec=bfd_elf32_littlearm_vec
-    targ_selvecs="bfd_elf32_bigarm_vec armnetbsd_vec"
+    targ_selvecs="bfd_elf32_bigarm_vec armnetbsd_vec armcoff_little_vec armcoff_big_vec"
     ;;
   arm-*-netbsd* | arm-*-openbsd*)
     targ_defvec=armnetbsd_vec
-    targ_selvecs="bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec"
+    targ_selvecs="bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec armcoff_little_vec armcoff_big_vec"
     targ_underscore=yes
     ;;
   arm-*-nto* | nto*arm*)
@@ -351,11 +351,11 @@
     ;;
 #endif
 
-  hppa*-*-linux-gnu*)
+  hppa*-*-linux-gnu* | hppa*-*-netbsd* )
     targ_defvec=bfd_elf32_hppa_linux_vec
     targ_selvecs=bfd_elf32_hppa_vec
     ;;
-  hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-netbsd* | hppa*-*-sysv4* | hppa*-*-rtems* | hppa*-*-openbsd*)
+  hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems* | hppa*-*-openbsd*)
     targ_defvec=bfd_elf32_hppa_vec
     targ_selvecs=bfd_elf32_hppa_linux_vec
     ;;
@@ -446,7 +446,7 @@
        targ_cflags=-DOLD_FREEBSD_ABI_LABEL ;;
     esac
     ;;
-  i[3456]86-*-netbsdelf*) 
+  i[3456]86-*-netbsdelf*)
     targ_defvec=bfd_elf32_i386_vec
     targ_selvecs=i386netbsd_vec
     ;;
@@ -655,9 +655,9 @@
     targ_defvec=m68klynx_coff_vec
     targ_selvecs=m68klynx_aout_vec
     ;;
-  m68*-hp*-netbsd*)
+  m68k4k*-*-netbsd*)
     targ_defvec=m68k4knetbsd_vec
-    targ_selvecs="m68knetbsd_vec hp300bsd_vec sunos_big_vec"
+    targ_selvecs="m68knetbsd_vec hp300bsd_vec sunos_big_vec bfd_elf32_m68k_vec"
     targ_underscore=yes
     ;;
   m68*-*-netbsdelf*) 
@@ -1105,11 +1105,11 @@
     ;;
   sparc-*-netbsdelf*)
     targ_defvec=bfd_elf32_sparc_vec
-    targ_selvecs=sparcnetbsd_vec
+    targ_selvecs="sparcnetbsd_vec sunos_big_vec"
     ;;
-  sparc-*-netbsdaout* | sparc-*-netbsd*)
+  sparc-*-netbsd*)
     targ_defvec=sparcnetbsd_vec
-    targ_selvecs=bfd_elf32_sparc_vec
+    targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
     targ_underscore=yes
     ;;
   sparc-*-openbsd*)
@@ -1142,6 +1142,10 @@
     targ_defvec=bfd_elf64_sparc_vec
     targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
     ;;
+  sparc64-*-netbsd*)
+    targ_defvec=bfd_elf64_sparc_vec
+    targ_selvecs="bfd_elf32_sparc_vec sparcnetbsd_vec sunos_big_vec"
+    ;;
   sparc64-*-elf*)
     targ_defvec=bfd_elf64_sparc_vec
     targ_selvecs=bfd_elf32_sparc_vec
diff -r 73df4603f3dc -r f241c3336821 gnu/dist/binutils/bfd/configure
--- a/gnu/dist/binutils/bfd/configure   Thu Nov 27 09:40:38 2003 +0000
+++ b/gnu/dist/binutils/bfd/configure   Thu Nov 27 09:45:33 2003 +0000
@@ -5111,6 +5111,7 @@
   arm-*-freebsd*)      COREFILE='' ;;
   arm-*-netbsd*)       COREFILE=netbsd-core.lo ;;
   arm-*-riscix)                COREFILE=trad-core.lo ;;
+  arm*-*-netbsd*)      COREFILE=netbsd-core.lo ;;
   hppa*-*-hpux*)       COREFILE=hpux-core.lo ;;
   hppa*-*-hiux*)       COREFILE=hpux-core.lo ;;
   hppa*-*-mpeix*)      COREFILE=hpux-core.lo ;;
@@ -5177,7 +5178,7 @@
        COREFILE=trad-core.lo
        TRAD_HEADER='"hosts/mipsmach3.h"'
        ;;
-  mips-*-netbsd* | mips*-*-openbsd*)
+  mips*-*-netbsd* | mips*-*-openbsd*)
        COREFILE=netbsd-core.lo
        ;;
   mips-dec-*)
diff -r 73df4603f3dc -r f241c3336821 gnu/dist/binutils/bfd/configure.in
--- a/gnu/dist/binutils/bfd/configure.in        Thu Nov 27 09:40:38 2003 +0000
+++ b/gnu/dist/binutils/bfd/configure.in        Thu Nov 27 09:45:33 2003 +0000
@@ -164,6 +164,7 @@
   arm-*-freebsd*)      COREFILE='' ;;
   arm-*-netbsd*)       COREFILE=netbsd-core.lo ;;
   arm-*-riscix)                COREFILE=trad-core.lo ;;
+  arm*-*-netbsd*)      COREFILE=netbsd-core.lo ;;
   hppa*-*-hpux*)       COREFILE=hpux-core.lo ;;
   hppa*-*-hiux*)       COREFILE=hpux-core.lo ;;
   hppa*-*-mpeix*)      COREFILE=hpux-core.lo ;;
@@ -254,7 +255,7 @@
        COREFILE=trad-core.lo
        TRAD_HEADER='"hosts/mipsmach3.h"'
        ;;
-  mips-*-netbsd* | mips*-*-openbsd*)
+  mips*-*-netbsd* | mips*-*-openbsd*)
        COREFILE=netbsd-core.lo
        ;;
   mips-dec-*)
diff -r 73df4603f3dc -r f241c3336821 gnu/dist/binutils/bfd/elf.c
--- a/gnu/dist/binutils/bfd/elf.c       Thu Nov 27 09:40:38 2003 +0000
+++ b/gnu/dist/binutils/bfd/elf.c       Thu Nov 27 09:45:33 2003 +0000
@@ -3892,7 +3892,7 @@
                  if ((abfd->flags & D_PAGED) != 0)
                    adjust = (sec->vma - voff) % bed->maxpagesize;
                  else
-                   adjust = (sec->vma - voff) % align;
+                   adjust = (sec->vma - (p->p_paddr + p->p_memsz)) % align;
                }
              else
                adjust = 0;
diff -r 73df4603f3dc -r f241c3336821 gnu/dist/binutils/bfd/elf32-vax.c
--- a/gnu/dist/binutils/bfd/elf32-vax.c Thu Nov 27 09:40:38 2003 +0000
+++ b/gnu/dist/binutils/bfd/elf32-vax.c Thu Nov 27 09:45:33 2003 +0000
@@ -58,6 +58,8 @@
 
 static bfd_boolean elf32_vax_set_private_flags
   PARAMS ((bfd *, flagword));
+static bfd_boolean elf32_vax_copy_private_bfd_data
+  PARAMS ((bfd *, bfd *));
 static bfd_boolean elf32_vax_merge_private_bfd_data
   PARAMS ((bfd *, bfd *));
 static bfd_boolean elf32_vax_print_private_bfd_data
@@ -474,16 +476,16 @@
      bfd *abfd;
 {
   struct elf_vax_link_hash_table *ret;
-  bfd_size_type amt = sizeof (struct elf_vax_link_hash_table);
 
-  ret = (struct elf_vax_link_hash_table *) bfd_malloc (amt);
+  ret = ((struct elf_vax_link_hash_table *)
+        bfd_alloc (abfd, sizeof (struct elf_vax_link_hash_table)));
   if (ret == (struct elf_vax_link_hash_table *) NULL)
     return NULL;
 
   if (! _bfd_elf_link_hash_table_init (&ret->root, abfd,
                                       elf_vax_link_hash_newfunc))
     {
-      free (ret);
+      bfd_release (abfd, ret);
       return NULL;
     }
 
@@ -501,6 +503,26 @@
   return TRUE;
 }
 
+/* Copy vax-specific data from one module to another */
+static boolean
+elf32_vax_copy_private_bfd_data (ibfd, obfd)
+     bfd *ibfd;
+     bfd *obfd;
+{
+  flagword in_flags;
+
+  if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+    return true;
+ 
+  in_flags = elf_elfheader (ibfd)->e_flags;
+ 
+  elf_elfheader (obfd)->e_flags = in_flags;
+  elf_flags_init (obfd) = true;
+ 
+  return true;
+}
+
 /* Merge backend specific data from an object file to the output
    object file when linking.  */
 static bfd_boolean
@@ -773,8 +795,6 @@
                          || !bfd_set_section_alignment (dynobj, sreloc, 2))
                        return FALSE;
                    }
-                 if (sec->flags & SEC_READONLY)
-                   info->flags |= DF_TEXTREL;
                }
 
              sreloc->_raw_size += sizeof (Elf32_External_Rela);
@@ -875,7 +895,15 @@
        }
     }
   else
-    return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
+    {
+      if (!(elf_bad_symtab (sec->owner)
+           && ELF_ST_BIND (sym->st_info) != STB_LOCAL)
+         && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE)
+               && sym->st_shndx != SHN_COMMON))
+       {
+         return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
+       }



Home | Main Index | Thread Index | Old Index