Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl3/binutils/dist Merge changes to binutils 2.16.1...
details: https://anonhg.NetBSD.org/src/rev/079a968741cc
branches: trunk
changeset: 746744:079a968741cc
user: skrll <skrll%NetBSD.org@localhost>
date: Wed Aug 19 07:19:30 2009 +0000
description:
Merge changes to binutils 2.16.1 in src/gnu/dist/binutils into 2.19.1.
diffstat:
external/gpl3/binutils/dist/bfd/archive.c | 70 ++++-
external/gpl3/binutils/dist/bfd/bfd-in2.h | 5 +
external/gpl3/binutils/dist/bfd/bfd.c | 5 +
external/gpl3/binutils/dist/bfd/coff-alpha.c | 2 +
external/gpl3/binutils/dist/bfd/config.bfd | 34 +-
external/gpl3/binutils/dist/bfd/configure | 3 +-
external/gpl3/binutils/dist/bfd/configure.host | 12 +
external/gpl3/binutils/dist/bfd/configure.in | 3 +-
external/gpl3/binutils/dist/bfd/doc/Makefile.in | 4 +-
external/gpl3/binutils/dist/bfd/doc/bfdt.texi | 5 +
external/gpl3/binutils/dist/bfd/elf32-i386.c | 5 +-
external/gpl3/binutils/dist/bfd/elf32-vax.c | 82 ++++-
external/gpl3/binutils/dist/bfd/elf64-alpha.c | 36 ++
external/gpl3/binutils/dist/bfd/elflink.c | 9 +-
external/gpl3/binutils/dist/bfd/libbfd.h | 4 +
external/gpl3/binutils/dist/bfd/reloc.c | 11 +
external/gpl3/binutils/dist/binutils/ar.c | 15 +
external/gpl3/binutils/dist/binutils/bucomm.c | 9 +-
external/gpl3/binutils/dist/binutils/doc/Makefile.am | 30 ++
external/gpl3/binutils/dist/binutils/doc/Makefile.in | 30 ++
external/gpl3/binutils/dist/binutils/doc/ar.1 | 8 +
external/gpl3/binutils/dist/binutils/doc/binutils.texi | 9 +
external/gpl3/binutils/dist/binutils/objcopy.c | 1 +
external/gpl3/binutils/dist/binutils/strings.c | 2 +-
external/gpl3/binutils/dist/config.sub | 6 +-
external/gpl3/binutils/dist/gas/config/tc-vax.c | 151 ++++++++++-
external/gpl3/binutils/dist/gas/config/tc-vax.h | 8 +
external/gpl3/binutils/dist/gas/config/vax-inst.h | 2 +
external/gpl3/binutils/dist/gas/doc/Makefile.am | 4 +
external/gpl3/binutils/dist/gas/doc/Makefile.in | 4 +
external/gpl3/binutils/dist/gprof/corefile.c | 2 +
external/gpl3/binutils/dist/gprof/gprof.c | 2 +
external/gpl3/binutils/dist/include/bfdlink.h | 4 +
external/gpl3/binutils/dist/ld/Makefile.am | 10 +-
external/gpl3/binutils/dist/ld/Makefile.in | 10 +-
external/gpl3/binutils/dist/ld/configure.host | 16 +
external/gpl3/binutils/dist/ld/configure.tgt | 22 +-
external/gpl3/binutils/dist/ld/emulparams/armelf_nbsd.sh | 1 +
external/gpl3/binutils/dist/ld/emulparams/elf32_sparc.sh | 1 +
external/gpl3/binutils/dist/ld/emulparams/elf64alpha_nbsd.sh | 6 +
external/gpl3/binutils/dist/ld/emulparams/elf_i386.sh | 1 +
external/gpl3/binutils/dist/ld/emulparams/hppalinux.sh | 2 +-
external/gpl3/binutils/dist/ld/emulparams/hppaobsd.sh | 2 +-
external/gpl3/binutils/dist/ld/emulparams/m68kelf.sh | 3 +-
external/gpl3/binutils/dist/ld/emulparams/m68kelfnbsd.sh | 2 +-
external/gpl3/binutils/dist/ld/emulparams/sh.sh | 4 +-
external/gpl3/binutils/dist/ld/emulparams/shelf_nbsd.sh | 6 +-
external/gpl3/binutils/dist/ld/emultempl/elf32.em | 3 +-
external/gpl3/binutils/dist/ld/ld.texinfo | 2 +-
external/gpl3/binutils/dist/ld/ldmain.c | 35 +-
external/gpl3/binutils/dist/ld/ldmain.h | 1 +
external/gpl3/binutils/dist/ld/lexsup.c | 14 +-
external/gpl3/binutils/dist/ld/scripttempl/sh.sc | 23 +-
external/gpl3/binutils/dist/libiberty/strerror.c | 2 +-
external/gpl3/binutils/dist/opcodes/Makefile.am | 6 +-
external/gpl3/binutils/dist/opcodes/Makefile.in | 6 +-
external/gpl3/binutils/dist/opcodes/cgen.sh | 17 +-
external/gpl3/binutils/dist/opcodes/configure | 8 +
external/gpl3/binutils/dist/opcodes/configure.in | 8 +
external/gpl3/binutils/dist/opcodes/sparc-dis.c | 2 +-
60 files changed, 678 insertions(+), 112 deletions(-)
diffs (truncated from 2074 to 300 lines):
diff -r ac203aa895c8 -r 079a968741cc external/gpl3/binutils/dist/bfd/archive.c
--- a/external/gpl3/binutils/dist/bfd/archive.c Wed Aug 19 06:57:24 2009 +0000
+++ b/external/gpl3/binutils/dist/bfd/archive.c Wed Aug 19 07:19:30 2009 +0000
@@ -158,6 +158,9 @@
#define ar_maxnamelen(abfd) ((abfd)->xvec->ar_max_namelen)
#define arch_eltdata(bfd) ((struct areltdata *) ((bfd)->arelt_data))
+
+static const char * normalize (bfd *, const char *);
+
#define arch_hdr(bfd) ((struct ar_hdr *) arch_eltdata (bfd)->arch_header)
void
@@ -715,7 +718,9 @@
/* Pad to an even boundary...
Note that last_file->origin can be odd in the case of
BSD-4.4-style element with a long odd 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);
@@ -1652,6 +1657,16 @@
return NULL;
}
+ /* If the caller requested that the BFD generate deterministic output,
+ fake values for modification time, UID, GID, and file mode. */
+ if ((abfd->flags & BFD_DETERMINISTIC_OUTPUT) != 0)
+ {
+ status.st_mtime = 0;
+ status.st_uid = 0;
+ status.st_gid = 0;
+ status.st_mode = 0644;
+ }
+
amt = sizeof (struct ar_hdr) + sizeof (struct areltdata);
ared = bfd_zalloc (abfd, amt);
if (ared == NULL)
@@ -1992,13 +2007,23 @@
current = current->archive_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 (hdr, 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_is_thin_archive (arch))
continue;
if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0)
@@ -2220,20 +2245,39 @@
unsigned int count;
struct ar_hdr hdr;
struct stat statbuf;
+ long uid, gid;
firstreal = mapsize + elength + sizeof (struct ar_hdr) + SARMAG;
stat (arch->filename, &statbuf);
+ if ((arch->flags & BFD_DETERMINISTIC_OUTPUT) == 0)
+ {
+ /* Remember the timestamp, to keep it holy. But fudge it a little. */
+ bfd_ardata (arch)->armap_timestamp = (statbuf.st_mtime
+ + ARMAP_TIME_OFFSET);
+ uid = getuid();
+ gid = getgid();
+ }
+ else
+ {
+ /* If deterministic, we use 0 as the timestamp in the map.
+ Some linkers may require that the archive filesystem modification
+ time is less than (or near to) the archive map timestamp. Those
+ linkers should not be used with deterministic mode. (GNU ld and
+ Gold do not have this restriction.) */
+ bfd_ardata (arch)->armap_timestamp = 0;
+ uid = 0;
+ gid = 0;
+ }
+
memset (&hdr, ' ', sizeof (struct ar_hdr));
memcpy (hdr.ar_name, RANLIBMAG, strlen (RANLIBMAG));
- /* Remember the timestamp, to keep it holy. But fudge it a little. */
- bfd_ardata (arch)->armap_timestamp = statbuf.st_mtime + ARMAP_TIME_OFFSET;
bfd_ardata (arch)->armap_datepos = (SARMAG
+ offsetof (struct ar_hdr, ar_date[0]));
_bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld",
bfd_ardata (arch)->armap_timestamp);
- _bfd_ar_spacepad (hdr.ar_uid, sizeof (hdr.ar_uid), "%ld", getuid ());
- _bfd_ar_spacepad (hdr.ar_gid, sizeof (hdr.ar_gid), "%ld", getgid ());
+ _bfd_ar_spacepad (hdr.ar_uid, sizeof (hdr.ar_uid), "%ld", uid);
+ _bfd_ar_spacepad (hdr.ar_gid, sizeof (hdr.ar_gid), "%ld", gid);
_bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10ld", mapsize);
memcpy (hdr.ar_fmag, ARFMAG, 2);
if (bfd_bwrite (&hdr, sizeof (struct ar_hdr), arch)
@@ -2251,8 +2295,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->archive_next;
}
while (current != map[count].u.abfd);
@@ -2301,6 +2348,10 @@
struct stat archstat;
struct ar_hdr hdr;
+ /* If creating deterministic archives, just leave the timestamp as-is. */
+ if ((arch->flags & BFD_DETERMINISTIC_OUTPUT) != 0)
+ return TRUE;
+
/* Flush writes, get last-write timestamp from file, and compare it
to the timestamp IN the file. */
bfd_flush (arch);
@@ -2385,7 +2436,8 @@
_bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10ld",
mapsize);
_bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld",
- time (NULL));
+ ((arch->flags & BFD_DETERMINISTIC_OUTPUT) == 0
+ ? time (NULL) : 0));
/* This, at least, is what Intel coff sets the values to. */
_bfd_ar_spacepad (hdr.ar_uid, sizeof (hdr.ar_uid), "%ld", 0);
_bfd_ar_spacepad (hdr.ar_gid, sizeof (hdr.ar_gid), "%ld", 0);
diff -r ac203aa895c8 -r 079a968741cc external/gpl3/binutils/dist/bfd/bfd-in2.h
--- a/external/gpl3/binutils/dist/bfd/bfd-in2.h Wed Aug 19 06:57:24 2009 +0000
+++ b/external/gpl3/binutils/dist/bfd/bfd-in2.h Wed Aug 19 07:19:30 2009 +0000
@@ -4689,6 +4689,11 @@
/* This BFD has been created by the linker and doesn't correspond
to any input file. */
#define BFD_LINKER_CREATED 0x2000
+ /* This may be set before writing out a BFD to request that it
+ be written using values for UIDs, GIDs, timestamps, etc. that
+ will be consistent from run to run. */
+#define BFD_DETERMINISTIC_OUTPUT 0x4000
+
/* Currently my_archive is tested before adding origin to
anything. I believe that this can become always an add of
diff -r ac203aa895c8 -r 079a968741cc external/gpl3/binutils/dist/bfd/bfd.c
--- a/external/gpl3/binutils/dist/bfd/bfd.c Wed Aug 19 06:57:24 2009 +0000
+++ b/external/gpl3/binutils/dist/bfd/bfd.c Wed Aug 19 07:19:30 2009 +0000
@@ -145,6 +145,11 @@
. to any input file. *}
.#define BFD_LINKER_CREATED 0x2000
.
+. {* This may be set before writing out a BFD to request that it
+. be written using values for UIDs, GIDs, timestamps, etc. that
+. will be consistent from run to run. *}
+.#define BFD_DETERMINISTIC_OUTPUT 0x4000
+.
. {* Currently my_archive is tested before adding origin to
. anything. I believe that this can become always an add of
. origin, with origin set to 0 for non archive files. *}
diff -r ac203aa895c8 -r 079a968741cc external/gpl3/binutils/dist/bfd/coff-alpha.c
--- a/external/gpl3/binutils/dist/bfd/coff-alpha.c Wed Aug 19 06:57:24 2009 +0000
+++ b/external/gpl3/binutils/dist/bfd/coff-alpha.c Wed Aug 19 07:19:30 2009 +0000
@@ -686,7 +686,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);
+#endif
rptr->addend = (intern->r_offset << 8) + intern->r_size;
break;
diff -r ac203aa895c8 -r 079a968741cc external/gpl3/binutils/dist/bfd/config.bfd
--- a/external/gpl3/binutils/dist/bfd/config.bfd Wed Aug 19 06:57:24 2009 +0000
+++ b/external/gpl3/binutils/dist/bfd/config.bfd Wed Aug 19 07:19:30 2009 +0000
@@ -208,15 +208,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
targ_cflags=-D__QNXTARGET__
;;
@@ -795,9 +795,9 @@
# targ_selvecs=m68kmach3_vec
# targ_cflags=-DSTAT_FOR_EXEC
;;
- 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*)
@@ -873,6 +873,16 @@
targ_defvec=ecoff_big_vec
targ_selvecs=ecoff_little_vec
;;
+#ifdef BFD64
+ mips64*el-*-netbsd*)
+ targ_defvec=bfd_elf64_tradlittlemips_vec
+ targ_selvecs="bfd_elf64_tradbigmips_vec bfd_elf32_nbigmips_vec bfd_elf32_nlittlemips_vec bfd_elf32_ntradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec
bfd_elf32_tradbigmips_vec ecoff_little_vec ecoff_big_vec"
+ ;;
+ mips64*-*-netbsd*)
+ targ_defvec=bfd_elf64_tradbigmips_vec
+ targ_selvecs="bfd_elf64_tradlittlemips_vec bfd_elf32_nbigmips_vec bfd_elf32_nlittlemips_vec bfd_elf32_ntradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec
bfd_elf32_tradbigmips_vec ecoff_little_vec ecoff_big_vec"
+ ;;
+#endif
mips*el-*-netbsd*)
targ_defvec=bfd_elf32_tradlittlemips_vec
targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_little_vec ecoff_big_vec"
@@ -1248,6 +1258,8 @@
want64=true
;;
+#endif
+
sh*l*-*-netbsdelf*)
targ_defvec=bfd_elf32_shlnbsd_vec
targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
@@ -1258,8 +1270,6 @@
targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec"
want64=true
;;
-#endif
-
sh*-*-netbsdelf*)
targ_defvec=bfd_elf32_shnbsd_vec
targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec"
@@ -1349,11 +1359,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[0-2].* | sparc-*-openbsd3.[0-1])
@@ -1397,6 +1407,10 @@
targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
want64=true
;;
+ 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 ac203aa895c8 -r 079a968741cc external/gpl3/binutils/dist/bfd/configure
--- a/external/gpl3/binutils/dist/bfd/configure Wed Aug 19 06:57:24 2009 +0000
+++ b/external/gpl3/binutils/dist/bfd/configure Wed Aug 19 07:19:30 2009 +0000
@@ -18035,6 +18035,7 @@
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 ;;
@@ -18097,7 +18098,7 @@
COREFILE=trad-core.lo
TRAD_HEADER='"hosts/i860mach3.h"'
;;
- mips-*-netbsd* | mips*-*-openbsd*)
+ mips*-*-netbsd* | mips*-*-openbsd*)
Home |
Main Index |
Thread Index |
Old Index