Step 2: base tools: devel/binutils

This commit is contained in:
2016-12-04 09:09:11 +01:00
committed by sambuc
parent 634d7550c3
commit c847a2cd2d
127 changed files with 3578 additions and 351 deletions
-15
View File
@@ -1,15 +0,0 @@
$NetBSD: patch-aa,v 1.6 2016/01/30 22:15:11 ryoon Exp $
Remove etc
--- configure.orig 2015-11-13 08:27:41.000000000 +0000
+++ configure
@@ -2733,7 +2733,7 @@ host_libs="intl libiberty opcodes bfd re
# binutils, gas and ld appear in that order because it makes sense to run
# "make check" in that particular order.
# If --enable-gold is used, "gold" may replace "ld".
-host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools"
+host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools"
# libgcj represents the runtime libraries only used by gcj.
libgcj="target-libffi \
@@ -0,0 +1,13 @@
$NetBSD$
--- bfd/Makefile.am.orig Mon Mar 25 09:08:05 2013
+++ bfd/Makefile.am
@@ -35,7 +35,7 @@ AM_CFLAGS = $(WARN_CFLAGS)
AM_CPPFLAGS = -DBINDIR='"$(bindir)"'
if PLUGINS
bfdinclude_HEADERS += $(INCDIR)/plugin-api.h
-LIBDL = -ldl
+LIBDL = @lt_cv_dlopen_libs@
endif
# bfd.h goes here, for now
@@ -0,0 +1,21 @@
$NetBSD$
--- bfd/Makefile.in.orig Mon Mar 25 09:08:08 2013
+++ bfd/Makefile.in
@@ -293,6 +293,7 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
+lt_cv_dlopen_libs = @lt_cv_dlopen_libs@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -336,7 +337,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -release `cat libt
@INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la
AM_CFLAGS = $(WARN_CFLAGS)
AM_CPPFLAGS = -DBINDIR='"$(bindir)"'
-@PLUGINS_TRUE@LIBDL = -ldl
+@PLUGINS_TRUE@LIBDL = @lt_cv_dlopen_libs@
# bfd.h goes here, for now
BFD_H = bfd.h
+13
View File
@@ -0,0 +1,13 @@
$NetBSD$
--- bfd/aoutx.h.orig Tue May 1 16:07:33 2012
+++ bfd/aoutx.h
@@ -762,7 +762,7 @@ NAME (aout, machine_type) (enum bfd_architecture arch,
break;
case bfd_arch_arm:
- if (machine == 0)
+ if (machine == 0 || machine == 5)
arch_flags = M_ARM;
break;
@@ -0,0 +1,70 @@
$NetBSD$
--- bfd/archive.c.orig Mon Mar 25 08:06:19 2013
+++ bfd/archive.c
@@ -157,6 +157,9 @@ struct ar_cache
#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)
/* True iff NAME designated a BSD 4.4 extended name. */
@@ -760,7 +763,9 @@ bfd_generic_openr_next_archived_file (bfd *archive, bf
/* 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);
@@ -2180,11 +2185,22 @@ _bfd_write_archive_contents (bfd *arch)
current = current->archive_next)
{
char buffer[DEFAULT_BUFFERSIZE];
- bfd_size_type remaining = arelt_size (current);
+ bfd_size_type saved_size = arelt_size (current);
+ bfd_size_type remaining = saved_size;
+ struct ar_hdr *hdr = arch_hdr (current);
/* Write ar header. */
if (!_bfd_write_ar_hdr (arch, current))
- return FALSE;
+ 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)
@@ -2457,11 +2473,19 @@ bsd_write_armap (bfd *arch,
{
do
{
+#if 1
+ bfd_size_type 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;
+#else
struct areltdata *ared = arch_eltdata (current);
firstreal += (ared->parsed_size + ared->extra_size
+ sizeof (struct ar_hdr));
firstreal += firstreal % 2;
+#endif
current = current->archive_next;
}
while (current != map[count].u.abfd);
@@ -0,0 +1,16 @@
$NetBSD$
--- bfd/bfd-in2.h.orig Tue Sep 4 12:53:41 2012
+++ bfd/bfd-in2.h
@@ -5788,6 +5788,11 @@ struct bfd
/* 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
+
/* This may be set before writing out a BFD to request that it
be written using values for UIDs, GIDs, timestamps, etc. that
-18
View File
@@ -1,18 +0,0 @@
$NetBSD: patch-bfd_cache.c,v 1.4 2016/01/30 22:15:11 ryoon Exp $
Fix sign-compare on SunOS.
Handle 256 file descriptor limit in 32-bit SunOS environment.
--- bfd/cache.c.orig 2016-01-25 08:51:06.000000000 +0000
+++ bfd/cache.c
@@ -50,6 +50,10 @@ SUBSECTION
#include <sys/mman.h>
#endif
+#if defined(__sun) && !defined(_LP64)
+#include <limits.h>
+#endif
+
/* In some cases we can optimize cache operation when reopening files.
For instance, a flush is entirely unnecessary if the file is already
closed, so a flush would use CACHE_NO_OPEN. Similarly, a seek using
@@ -0,0 +1,14 @@
$NetBSD$
--- bfd/coff-alpha.c.orig Fri Jul 13 14:22:42 2012
+++ bfd/coff-alpha.c
@@ -642,7 +642,9 @@ alpha_adjust_reloc_in (bfd *abfd,
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;
+18 -20
View File
@@ -1,25 +1,23 @@
$NetBSD: patch-bfd_config.bfd,v 1.2 2016/01/30 22:15:11 ryoon Exp $
$NetBSD$
Add Bitrig/amd64 support
https://sourceware.org/bugzilla/show_bug.cgi?id=18920
--- bfd/config.bfd.orig 2015-11-13 08:27:40.000000000 +0000
--- bfd/config.bfd.orig Tue Sep 4 14:14:59 2012
+++ bfd/config.bfd
@@ -635,7 +635,7 @@ case "${targ}" in
targ_selvecs="i386_elf32_vec iamcu_elf32_vec i386_aout_bsd_vec"
targ_underscore=yes
@@ -315,7 +315,7 @@ case "${targ}" in
;;
- i[3-7]86-*-openbsd*)
+ i[3-7]86-*-openbsd* | i[3-7]86-*-bitrig*)
targ_defvec=i386_elf32_vec
targ_selvecs="iamcu_elf32_vec i386_aout_nbsd_vec"
arm-*-elf | arm-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \
arm*-*-uclinux* | arm-*-kfreebsd*-gnu | \
- arm*-*-eabi* )
+ arm*-*-eabi* | arm*-*-minix*)
targ_defvec=bfd_elf32_littlearm_vec
targ_selvecs=bfd_elf32_bigarm_vec
;;
@@ -690,7 +690,7 @@ case "${targ}" in
targ_selvecs="i386_elf32_fbsd_vec iamcu_elf32_vec i386_coff_vec i386_pei_vec x86_64_pei_vec i386_elf32_vec x86_64_elf64_vec l1om_elf64_vec l1om_elf64_fbsd_vec k1om_elf64_vec k1om_elf64_fbsd_vec"
want64=true
@@ -709,6 +709,9 @@ case "${targ}" in
;;
- x86_64-*-netbsd* | x86_64-*-openbsd*)
+ x86_64-*-netbsd* | x86_64-*-openbsd* | x86_64-*-bitrig*)
targ_defvec=x86_64_elf64_vec
targ_selvecs="i386_elf32_vec iamcu_elf32_vec i386_aout_nbsd_vec i386_coff_vec i386_pei_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec"
want64=true
i[3-7]86-none-*)
targ_defvec=i386coff_vec
+ ;;
+ i[3-7]86-*-minix)
+ targ_defvec=bfd_elf32_i386_minix_vec
;;
i[3-7]86-*-aout* | i[3-7]86*-*-vsta*)
targ_defvec=i386aout_vec
+10 -14
View File
@@ -1,16 +1,12 @@
$NetBSD: patch-bfd_configure,v 1.2 2016/02/03 19:56:34 jperkin Exp $
$NetBSD$
Add Bitrig/amd64 support
https://sourceware.org/bugzilla/show_bug.cgi?id=18920
--- bfd/configure.orig 2016-01-25 08:54:07.000000000 +0000
--- bfd/configure.orig Mon Mar 25 09:08:07 2013
+++ bfd/configure
@@ -14133,7 +14133,7 @@ rm -f core conftest.err conftest.$ac_obj
x86_64-*-linux*)
CORE_HEADER='"hosts/x86-64linux.h"'
;;
- x86_64-*-netbsd* | x86_64-*-openbsd*)
+ x86_64-*-netbsd* | x86_64-*-openbsd* | x86_64-*-bitrig*)
COREFILE=netbsd-core.lo
;;
esac
@@ -15231,6 +15231,7 @@ do
bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
bfd_elf32_i386_sol2_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
+ bfd_elf32_i386_minix_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_nacl_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_vxworks_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
@@ -1,25 +0,0 @@
$NetBSD: patch-bfd_configure.ac,v 1.2 2016/02/03 19:56:34 jperkin Exp $
Add Bitrig/amd64 support
https://sourceware.org/bugzilla/show_bug.cgi?id=18920
--- bfd/configure.ac.orig 2015-11-13 08:27:40.000000000 +0000
+++ bfd/configure.ac
@@ -313,7 +313,7 @@ changequote([,])dnl
TRAD_HEADER='"hosts/i386bsd.h"'
;;
changequote(,)dnl
- i[3-7]86-*-netbsd* | i[3-7]86-*-knetbsd*-gnu | i[3-7]86-*-openbsd*)
+ i[3-7]86-*-netbsd* | i[3-7]86-*-knetbsd*-gnu | i[3-7]86-*-openbsd* | i[3-7]86-*-bitrig*)
changequote([,])dnl
COREFILE=netbsd-core.lo
;;
@@ -488,7 +488,7 @@ changequote([,])dnl
x86_64-*-linux*)
CORE_HEADER='"hosts/x86-64linux.h"'
;;
- x86_64-*-netbsd* | x86_64-*-openbsd*)
+ x86_64-*-netbsd* | x86_64-*-openbsd* | x86_64-*-bitrig*)
COREFILE=netbsd-core.lo
;;
esac
@@ -0,0 +1,23 @@
$NetBSD$
--- bfd/configure.host.orig Fri Dec 31 11:00:52 2010
+++ bfd/configure.host
@@ -57,6 +57,18 @@ mips*-*-riscos*) HDEFINES="-G 4" ;;
m68*-hp-hpux*) HDEFINES=-DHOST_HP300HPUX ;;
+sparc64*-*-netbsd*) host64=true; HOST_64BIT_TYPE=long ;;
+
+x86_64*-*-netbsd*) host64=true; HOST_64BIT_TYPE=long ;;
+
+*-*-aix*) HOST_64BIT_TYPE="long long"
+ HOST_U_64BIT_TYPE="unsigned long long"
+ ;;
+
+*-*-solaris*) HOST_64BIT_TYPE="long long"
+ HOST_U_64BIT_TYPE="unsigned long long"
+ ;;
+
# Some Solaris systems (osol0906 at least) have a libc that doesn't recognise
# the "MS-ANSI" code page name, so we define an override for CP_ACP (sets the
# default code page used by windres/windmc when not specified by a commandline
@@ -0,0 +1,12 @@
$NetBSD$
--- bfd/configure.in.orig Mon Mar 25 09:08:05 2013
+++ bfd/configure.in
@@ -723,6 +723,7 @@ do
bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
bfd_elf32_i386_sol2_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
+ bfd_elf32_i386_minix_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_nacl_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_vxworks_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;;
@@ -0,0 +1,15 @@
$NetBSD$
--- bfd/doc/Makefile.in.orig Mon Mar 25 09:08:08 2013
+++ bfd/doc/Makefile.in
@@ -417,7 +417,9 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
-bfd.info: bfd.texinfo $(bfd_TEXINFOS)
+bfd.info:
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_bfd.info: bfd.texinfo $(bfd_TEXINFOS)
restore=: && backupdir="$(am__leading_dot)am$$$$" && \
rm -rf $$backupdir && mkdir $$backupdir && \
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
@@ -0,0 +1,17 @@
$NetBSD$
--- bfd/doc/reloc.texi.orig Tue Nov 13 14:19:29 2012
+++ bfd/doc/reloc.texi
@@ -570,6 +570,12 @@ For ELF.
@deffnx {} BFD_RELOC_68K_TLS_LE8
Relocations used by 68K ELF.
@end deffn
+@deffn {} BFD_RELOC_VAX_GLOB_DAT
+@deffnx {} BFD_RELOC_VAX_GLOB_REF
+@deffnx {} BFD_RELOC_VAX_JMP_SLOT
+@deffnx {} BFD_RELOC_VAX_RELATIVE
+Relocations used by VAX ELF.
+@end deffn
@deffn {} BFD_RELOC_32_BASEREL
@deffnx {} BFD_RELOC_16_BASEREL
@deffnx {} BFD_RELOC_LO16_BASEREL
+28
View File
@@ -0,0 +1,28 @@
$NetBSD$
--- bfd/elf.c.orig Mon Mar 25 08:06:19 2013
+++ bfd/elf.c
@@ -8756,6 +8756,23 @@ elfcore_grok_netbsd_note (bfd *abfd, Elf_Internal_Note
return TRUE;
}
+ /* On SuperH, PT_GETREGS == mach+3 and PT_GETFPREGS == mach+5.
+ There's also old PT___GETREGS40 == mach + 1 for old reg
+ structure which lacks GBR. */
+
+ case bfd_arch_sh:
+ switch (note->type)
+ {
+ case NT_NETBSDCORE_FIRSTMACH+3:
+ return elfcore_make_note_pseudosection (abfd, ".reg", note);
+
+ case NT_NETBSDCORE_FIRSTMACH+5:
+ return elfcore_make_note_pseudosection (abfd, ".reg2", note);
+
+ default:
+ return TRUE;
+ }
+
/* On all other arch's, PT_GETREGS == mach+1 and
PT_GETFPREGS == mach+3. */
+11 -18
View File
@@ -1,22 +1,15 @@
$NetBSD: patch-bfd_elf32-arm.c,v 1.1 2016/01/30 22:15:11 ryoon Exp $
$NetBSD$
Resolve popcount(3) conflict on NetBSD
--- bfd/elf32-arm.c.orig 2016-01-25 08:51:06.000000000 +0000
--- bfd/elf32-arm.c.orig Mon Mar 25 08:06:19 2013
+++ bfd/elf32-arm.c
@@ -3133,6 +3133,7 @@ ctz (unsigned int mask)
#endif
}
@@ -13475,6 +13475,10 @@ elf32_arm_readonly_dynrelocs (struct elf_link_hash_ent
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
+#if !defined(__NetBSD__)
static inline int
popcount (unsigned int mask)
{
@@ -3150,6 +3151,7 @@ popcount (unsigned int mask)
return sum;
#endif
}
+#endif
/* Create an entry in an ARM ELF linker hash table. */
+ if (info->warn_shared_textrel)
+ (*_bfd_error_handler)
+ (_("warning: dynamic relocation in readonly section `%s'"),
+ h->root.root.string);
info->flags |= DF_TEXTREL;
/* Not an error, just cut short the traversal. */
@@ -0,0 +1,15 @@
$NetBSD$
--- bfd/elf32-hppa.c.orig Fri Jun 29 14:45:58 2012
+++ bfd/elf32-hppa.c
@@ -2191,6 +2191,10 @@ readonly_dynrelocs (struct elf_link_hash_entry *eh, vo
{
struct bfd_link_info *info = inf;
+ if (info->warn_shared_textrel)
+ (*_bfd_error_handler)
+ (_("warning: dynamic relocation in readonly section `%s'"),
+ eh->root.root.string);
info->flags |= DF_TEXTREL;
/* Not an error, just cut short the traversal. */
@@ -0,0 +1,23 @@
$NetBSD$
--- bfd/elf32-i386.c.orig Mon Mar 25 08:06:19 2013
+++ bfd/elf32-i386.c
@@ -4976,6 +4976,18 @@ elf_i386_add_symbol_hook (bfd * abfd,
#include "elf32-target.h"
+/* MINIX3 support. */
+
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM bfd_elf32_i386_minix_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf32-i386-minix"
+
+#undef elf32_bed
+#define elf32_bed elf32_i386_minix_bed
+
+#include "elf32-target.h"
+
/* FreeBSD support. */
#undef TARGET_LITTLE_SYM
@@ -0,0 +1,13 @@
$NetBSD$
--- bfd/elf32-m68k.c.orig Fri Jul 13 14:22:47 2012
+++ bfd/elf32-m68k.c
@@ -2532,7 +2532,7 @@ elf_m68k_copy_indirect_symbol (struct bfd_link_info *i
if (ind->got_entry_key != 0)
{
BFD_ASSERT (dir->got_entry_key == 0);
- /* Assert that GOTs aren't partioned yet. */
+ /* Assert that GOTs aren't partitioned yet. */
BFD_ASSERT (ind->glist == NULL);
dir->got_entry_key = ind->got_entry_key;
@@ -0,0 +1,22 @@
$NetBSD$
--- bfd/elf32-ppc.c.orig Mon Mar 25 08:06:19 2013
+++ bfd/elf32-ppc.c
@@ -3898,7 +3898,7 @@ ppc_elf_check_relocs (bfd *abfd,
sec->has_tls_get_addr_call = 1;
}
- switch (r_type)
+ switch ((int)r_type)
{
case R_PPC_TLSGD:
case R_PPC_TLSLD:
@@ -7766,7 +7766,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
howto = NULL;
if (r_type < R_PPC_max)
howto = ppc_elf_howto_table[r_type];
- switch (r_type)
+ switch ((int)r_type)
{
default:
info->callbacks->einfo
@@ -0,0 +1,15 @@
$NetBSD$
--- bfd/elf32-sh.c.orig Mon Mar 25 08:06:20 2013
+++ bfd/elf32-sh.c
@@ -3285,6 +3285,10 @@ readonly_dynrelocs (struct elf_link_hash_entry *h, voi
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
+ if (info->warn_shared_textrel)
+ (*_bfd_error_handler)
+ (_("warning: dynamic relocation in readonly section `%s'"),
+ h->root.root.string);
info->flags |= DF_TEXTREL;
/* Not an error, just cut short the traversal. */
@@ -0,0 +1,117 @@
$NetBSD$
--- bfd/elf32-vax.c.orig Tue Sep 4 13:32:53 2012
+++ bfd/elf32-vax.c
@@ -490,6 +490,24 @@ elf32_vax_set_private_flags (bfd *abfd, flagword flags
return TRUE;
}
+/* Copy vax-specific data from one module to another */
+static bfd_boolean
+elf32_vax_copy_private_bfd_data (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
@@ -752,7 +770,13 @@ elf_vax_check_relocs (bfd *abfd, struct bfd_link_info
return FALSE;
if (sec->flags & SEC_READONLY)
- info->flags |= DF_TEXTREL;
+ {
+ if (info->warn_shared_textrel)
+ (*_bfd_error_handler)
+ (_("warning: dynamic relocation in readonly section `%s'"),
+ sec->name);
+ info->flags |= DF_TEXTREL;
+ }
}
sreloc->size += sizeof (Elf32_External_Rela);
@@ -1186,7 +1210,12 @@ elf_vax_size_dynamic_sections (bfd *output_bfd, struct
continue;
/* Allocate memory for the section contents. */
- s->contents = (bfd_byte *) bfd_alloc (dynobj, s->size);
+ /* FIXME: This should be a call to bfd_alloc not bfd_zalloc.
+ Unused entries should be reclaimed before the section's contents
+ are written out, but at the moment this does not happen. Thus in
+ order to prevent writing out garbage, we initialise the section's
+ contents to zero. */
+ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
if (s->contents == NULL)
return FALSE;
}
@@ -1285,6 +1314,7 @@ elf_vax_instantiate_got_entries (struct elf_link_hash_
if (!elf_hash_table (info)->dynamic_sections_created
|| (info->shared && info->symbolic)
+ || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|| h->forced_local)
{
h->got.refcount = 0;
@@ -1305,9 +1335,7 @@ elf_vax_instantiate_got_entries (struct elf_link_hash_
dyn = elf_hash_table (info)->dynamic_sections_created;
/* Allocate space in the .got and .rela.got sections. */
- if (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- && (info->shared
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
+ if (info->shared || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
{
sgot->size += 4;
srelgot->size += sizeof (Elf32_External_Rela);
@@ -1631,9 +1659,9 @@ elf_vax_relocate_section (bfd *output_bfd,
{
relocate = TRUE;
outrel.r_info = ELF32_R_INFO (0, R_VAX_RELATIVE);
- BFD_ASSERT (bfd_get_signed_32 (input_bfd,
- &contents[rel->r_offset]) == 0);
- outrel.r_addend = relocation + rel->r_addend;
+ outrel.r_addend = bfd_get_signed_32(input_bfd,
+ &contents[rel->r_offset])
+ + relocation + rel->r_addend;
}
else
{
@@ -1672,6 +1700,9 @@ elf_vax_relocate_section (bfd *output_bfd,
}
}
+ if (input_section->flags & SEC_CODE)
+ info->flags |= DF_TEXTREL;
+
if ((input_section->flags & SEC_CODE) != 0
|| (ELF32_R_TYPE (outrel.r_info) != R_VAX_32
&& ELF32_R_TYPE (outrel.r_info) != R_VAX_RELATIVE
@@ -2051,12 +2082,15 @@ elf_vax_plt_sym_val (bfd_vma i, const asection *plt,
#define TARGET_LITTLE_SYM bfd_elf32_vax_vec
#define TARGET_LITTLE_NAME "elf32-vax"
#define ELF_MACHINE_CODE EM_VAX
-#define ELF_MAXPAGESIZE 0x1000
+#define ELF_MAXPAGESIZE 0x10000
#define elf_backend_create_dynamic_sections \
_bfd_elf_create_dynamic_sections
#define bfd_elf32_bfd_link_hash_table_create \
elf_vax_link_hash_table_create
+#define bfd_elf32_bfd_copy_private_bfd_data \
+ elf32_vax_copy_private_bfd_data
+
#define bfd_elf32_bfd_final_link bfd_elf_gc_common_final_link
#define elf_backend_check_relocs elf_vax_check_relocs
@@ -0,0 +1,49 @@
$NetBSD$
--- bfd/elf64-alpha.c.orig Tue Jul 24 21:06:58 2012
+++ bfd/elf64-alpha.c
@@ -100,6 +100,11 @@ bfd_boolean elf64_alpha_use_secureplt = FALSE;
#define PLT_ENTRY_SIZE \
(elf64_alpha_use_secureplt ? NEW_PLT_ENTRY_SIZE : OLD_PLT_ENTRY_SIZE)
+/* ld --traditional-format uses this older format instead. */
+#define OLD_PLT_ENTRY_WORD1 0x279f0000 /* ldah $28, 0($31) */
+#define OLD_PLT_ENTRY_WORD2 0x239c0000 /* lda $28, 0($28) */
+#define OLD_PLT_ENTRY_WORD3 0xc3e00000 /* br $31, plt0 */
+
#define MAX_GOT_SIZE (64*1024)
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so"
@@ -4820,6 +4825,32 @@ elf64_alpha_finish_dynamic_symbol (bfd *output_bfd, st
plt_index = ((gotent->plt_offset - NEW_PLT_HEADER_SIZE)
/ NEW_PLT_ENTRY_SIZE);
+ }
+ else if ((output_bfd->flags & BFD_TRADITIONAL_FORMAT) != 0)
+ {
+ long hi, lo;
+
+ /* decompose the reloc offset for the plt for ldah+lda */
+ hi = plt_index * sizeof(Elf64_External_Rela);
+ lo = ((hi & 0xffff) ^ 0x8000) - 0x8000;
+ hi = (hi - lo) >> 16;
+
+ insn = INSN_ABO (INSN_LDAH, 28, 31, hi);
+ bfd_put_32 (output_bfd, insn,
+ splt->contents + gotent->plt_offset);
+
+ insn = INSN_ABO (INSN_LDA, 28, 28, lo);
+ bfd_put_32 (output_bfd, insn,
+ splt->contents + gotent->plt_offset + 4);
+
+ disp = -(gotent->plt_offset + 12);
+ insn = INSN_AD (INSN_BR, 31, disp);
+
+ bfd_put_32 (output_bfd, insn,
+ splt->contents + gotent->plt_offset + 8);
+
+ plt_index = ((gotent->plt_offset - OLD_PLT_HEADER_SIZE)
+ / OLD_PLT_ENTRY_SIZE);
}
else
{
@@ -0,0 +1,32 @@
$NetBSD$
--- bfd/elf64-mips.c.orig Tue Sep 4 14:13:07 2012
+++ bfd/elf64-mips.c
@@ -123,6 +123,8 @@ static bfd_reloc_status_type mips_elf64_final_gp
(bfd *, asymbol *, bfd_boolean, char **, bfd_vma *);
static bfd_boolean mips_elf64_object_p
(bfd *);
+static bfd_boolean mips_elf64_is_local_label_name
+ (bfd *, const char *);
static irix_compat_t elf64_mips_irix_compat
(bfd *);
static bfd_boolean elf64_mips_grok_prstatus
@@ -3917,7 +3919,18 @@ mips_elf64_object_p (bfd *abfd)
bfd_default_set_arch_mach (abfd, bfd_arch_mips, mach);
return TRUE;
}
+
+/* MIPS ELF local labels start with "$L". */
+static bfd_boolean
+mips_elf64_is_local_label_name (bfd *abfd, const char *name)
+{
+ if (name[0] == '$' && name[1] == 'L')
+ return TRUE;
+ /* We accept the generic ELF local label syntax as well. */
+ return _bfd_elf_is_local_label_name (abfd, name);
+}
+
/* Depending on the target vector we generate some version of Irix
executables or "normal" MIPS ELF ABI executables. */
static irix_compat_t
@@ -0,0 +1,15 @@
$NetBSD$
--- bfd/elf64-ppc.c.orig Mon Mar 25 08:06:20 2013
+++ bfd/elf64-ppc.c
@@ -9112,6 +9112,10 @@ readonly_dynrelocs (struct elf_link_hash_entry *h, voi
{
struct bfd_link_info *info = inf;
+ if (info->warn_shared_textrel)
+ (*_bfd_error_handler)
+ (_("warning: dynamic relocation in readonly section `%s'"),
+ h->root.root.string);
info->flags |= DF_TEXTREL;
/* Not an error, just cut short the traversal. */
@@ -0,0 +1,15 @@
$NetBSD$
--- bfd/elf64-x86-64.c.orig Mon Mar 25 08:06:20 2013
+++ bfd/elf64-x86-64.c
@@ -2589,6 +2589,10 @@ elf_x86_64_readonly_dynrelocs (struct elf_link_hash_en
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
+ if (info->warn_shared_textrel)
+ (*_bfd_error_handler)
+ (_("warning: dynamic relocation in readonly section `%s'"),
+ h->root.root.string);
info->flags |= DF_TEXTREL;
if (info->warn_shared_textrel && info->shared)
@@ -0,0 +1,20 @@
$NetBSD$
--- bfd/elflink.c.orig Mon Mar 25 08:06:20 2013
+++ bfd/elflink.c
@@ -10183,7 +10183,14 @@ elf_reloc_link_order (bfd *output_bfd,
if (bed->s->arch_size == 32)
irel[0].r_info = ELF32_R_INFO (indx, howto->type);
else
- irel[0].r_info = ELF64_R_INFO (indx, howto->type);
+#ifdef BFD64
+ {
+ bfd_uint64_t indx64 = indx;
+ irel[0].r_info = ELF64_R_INFO (indx64, howto->type);
+ }
+#else
+ BFD_FAIL();
+#endif
rel_hdr = reldata->hdr;
erel = rel_hdr->contents;
@@ -0,0 +1,31 @@
$NetBSD$
--- bfd/elfn32-mips.c.orig Tue Sep 4 14:13:08 2012
+++ bfd/elfn32-mips.c
@@ -81,6 +81,8 @@ static bfd_boolean elf32_mips_grok_prstatus
(bfd *, Elf_Internal_Note *);
static bfd_boolean elf32_mips_grok_psinfo
(bfd *, Elf_Internal_Note *);
+static bfd_boolean mips_elf_n32_is_local_label_name
+ (bfd *, const char *);
static irix_compat_t elf_n32_mips_irix_compat
(bfd *);
@@ -3239,6 +3241,17 @@ elf32_mips_grok_psinfo (bfd *abfd, Elf_Internal_Note *
}
return TRUE;
+}
+
+/* MIPS ELF local labels start with "$L". */
+static bfd_boolean
+mips_elf_n32_is_local_label_name (bfd *abfd, const char *name)
+{
+ if (name[0] == '$' && name[1] == 'L')
+ return TRUE;
+
+ /* We accept the generic ELF local label syntax as well. */
+ return _bfd_elf_is_local_label_name (abfd, name);
}
/* Depending on the target vector we generate some version of Irix
@@ -0,0 +1,33 @@
$NetBSD$
--- bfd/elfxx-mips.c.orig Mon Mar 25 08:06:20 2013
+++ bfd/elfxx-mips.c
@@ -8191,10 +8191,24 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link
reloc types into the output file as R_MIPS_REL32
relocs. Make room for this reloc in .rel(a).dyn. */
mips_elf_allocate_dynamic_relocations (dynobj, info, 1);
- if (MIPS_ELF_READONLY_SECTION (sec))
- /* We tell the dynamic linker that there are
- relocations against the text segment. */
- info->flags |= DF_TEXTREL;
+ /* In the N32 and 64-bit ABIs there may be multiple
+ consecutive relocations for the same offset. If we have
+ a R_MIPS_GPREL32 followed by a R_MIPS_64 then that
+ relocation is complete and needs no futher adjustment. */
+ if ((rel == relocs
+ || rel[-1].r_offset != rel->r_offset
+ || r_type != R_MIPS_64
+ || ELF_R_TYPE(abfd, rel[-1].r_info) != R_MIPS_GPREL32)
+ && MIPS_ELF_READONLY_SECTION (sec))
+ {
+ /* We tell the dynamic linker that there are
+ relocations against the text segment. */
+ info->flags |= DF_TEXTREL;
+ info->callbacks->warning
+ (info,
+ _("relocation emitted against readonly section"),
+ NULL, abfd, sec, rel->r_offset);
+ }
}
else
{
@@ -0,0 +1,28 @@
$NetBSD$
--- bfd/elfxx-sparc.c.orig Mon Mar 25 08:06:20 2013
+++ bfd/elfxx-sparc.c
@@ -2508,6 +2508,10 @@ readonly_dynrelocs (struct elf_link_hash_entry *h, voi
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
+ if (info->warn_shared_textrel)
+ (*_bfd_error_handler)
+ (_("warning: dynamic relocation in readonly section `%s'"),
+ h->root.root.string);
info->flags |= DF_TEXTREL;
/* Not an error, just cut short the traversal. */
@@ -3460,10 +3464,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
memset (&outrel, 0, sizeof outrel);
/* h->dynindx may be -1 if the symbol was marked to
become local. */
- else if (h != NULL &&
- h->dynindx != -1
- && (! is_plt
- || !info->shared
+ else if (h != NULL && h->dynindx != -1 && ! is_plt
+ && (!info->shared
|| !SYMBOLIC_BIND (info, h)
|| !h->def_regular))
{
+12
View File
@@ -0,0 +1,12 @@
$NetBSD$
--- bfd/libbfd.h.orig Tue Sep 4 12:53:42 2012
+++ bfd/libbfd.h
@@ -2313,6 +2313,7 @@ static const char *const bfd_reloc_code_real_names[] =
"BFD_RELOC_XC16X_SEG",
"BFD_RELOC_XC16X_SOF",
"BFD_RELOC_VAX_GLOB_DAT",
+ "BFD_RELOC_VAX_GLOB_REF",
"BFD_RELOC_VAX_JMP_SLOT",
"BFD_RELOC_VAX_RELATIVE",
"BFD_RELOC_MT_PC16",
+22
View File
@@ -0,0 +1,22 @@
$NetBSD$
--- bfd/reloc.c.orig Tue Sep 4 12:53:42 2012
+++ bfd/reloc.c
@@ -1776,6 +1776,17 @@ ENUMDOC
Relocations used by 68K ELF.
ENUM
+ BFD_RELOC_VAX_GLOB_DAT
+ENUMX
+ BFD_RELOC_VAX_GLOB_REF
+ENUMX
+ BFD_RELOC_VAX_JMP_SLOT
+ENUMX
+ BFD_RELOC_VAX_RELATIVE
+ENUMDOC
+ Relocations used by VAX ELF.
+
+ENUM
BFD_RELOC_32_BASEREL
ENUMX
BFD_RELOC_16_BASEREL
@@ -0,0 +1,12 @@
$NetBSD$
--- bfd/targets.c.orig Tue Sep 4 12:53:42 2012
+++ bfd/targets.c
@@ -624,6 +624,7 @@ extern const bfd_target bfd_elf32_hppa_nbsd_vec;
extern const bfd_target bfd_elf32_hppa_vec;
extern const bfd_target bfd_elf32_i370_vec;
extern const bfd_target bfd_elf32_i386_freebsd_vec;
+extern const bfd_target bfd_elf32_i386_minix_vec;
extern const bfd_target bfd_elf32_i386_nacl_vec;
extern const bfd_target bfd_elf32_i386_sol2_vec;
extern const bfd_target bfd_elf32_i386_vxworks_vec;
@@ -0,0 +1,53 @@
$NetBSD$
--- binutils/Makefile.in.orig Thu May 17 22:23:39 2012
+++ binutils/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -49,10 +49,12 @@ subdir = .
DIST_COMMON = NEWS README ChangeLog $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(srcdir)/config.in \
- $(srcdir)/../mkinstalldirs $(top_srcdir)/po/Make-in arparse.h \
- arparse.c arlex.c defparse.h defparse.c deflex.c nlmheader.h \
- nlmheader.c arparse.h arparse.c arlex.c mcparse.h mcparse.c \
- rcparse.h rcparse.c $(srcdir)/../depcomp $(srcdir)/../ylwrap
+ $(srcdir)/../mkinstalldirs $(srcdir)/../mkinstalldirs \
+ $(top_srcdir)/po/Make-in arparse.h arparse.c arlex.c \
+ defparse.h defparse.c deflex.c nlmheader.h nlmheader.c \
+ arparse.h arparse.c arlex.c mcparse.h mcparse.c rcparse.h \
+ rcparse.c $(srcdir)/../depcomp $(srcdir)/../depcomp \
+ $(srcdir)/../ylwrap $(srcdir)/../ylwrap
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \
$(top_srcdir)/../config/zlib.m4 \
@@ -385,6 +387,7 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -931,7 +934,7 @@ distclean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @fail= failcom='exit 1'; \
+ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -956,7 +959,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
+ @failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -0,0 +1,60 @@
$NetBSD$
--- binutils/aclocal.m4.orig Thu May 17 22:23:39 2012
+++ binutils/aclocal.m4
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.11 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
@@ -19,6 +19,31 @@ You have another version of autoconf. It may work, bu
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
+# isc-posix.m4 serial 2 (gettext-0.11.2)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
+
+# This test replaces the one in autoconf.
+# Currently this macro should have the same name as the autoconf macro
+# because gettext's gettext.m4 (distributed in the automake package)
+# still uses it. Otherwise, the use in gettext.m4 makes autoheader
+# give these diagnostics:
+# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
+# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
+
+undefine([AC_ISC_POSIX])
+
+AC_DEFUN([AC_ISC_POSIX],
+ [
+ dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
+ AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
+ ]
+)
+
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
@@ -34,7 +59,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.1], [],
+m4_if([$1], [1.11], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -50,7 +75,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.1])dnl
+[AM_AUTOMAKE_VERSION([1.11])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -0,0 +1,20 @@
$NetBSD$
--- binutils/bucomm.c.orig Fri Jun 29 12:59:49 2012
+++ binutils/bucomm.c
@@ -580,7 +580,14 @@ get_file_size (const char * file_name)
file_name, strerror (errno));
}
else if (! S_ISREG (statbuf.st_mode))
- non_fatal (_("Warning: '%s' is not an ordinary file"), file_name);
+ {
+ if (!S_ISCHR(statbuf.st_mode))
+ {
+ non_fatal (_("Warning: '%s' is not an ordinary file"), file_name);
+ return 0;
+ }
+ return statbuf.st_size ? statbuf.st_size : 1;
+ }
else if (statbuf.st_size < 0)
non_fatal (_("Warning: '%s' has negative size, probably it is too large"),
file_name);
@@ -0,0 +1,139 @@
$NetBSD$
--- binutils/doc/Makefile.am.orig Wed Jan 6 16:52:14 2010
+++ binutils/doc/Makefile.am
@@ -42,6 +42,8 @@ TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/.
# Man page generation from texinfo
addr2line.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_addr2line.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Daddr2line < $(binutils_TEXI) > addr2line.pod
-($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -49,6 +51,8 @@ addr2line.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f addr2line.pod
ar.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_ar.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dar < $(binutils_TEXI) > ar.pod
-($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -56,6 +60,8 @@ ar.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f ar.pod
dlltool.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_dlltool.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Ddlltool < $(binutils_TEXI) > dlltool.pod
-($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -63,6 +69,8 @@ dlltool.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f dlltool.pod
nlmconv.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_nlmconv.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dnlmconv < $(binutils_TEXI) > nlmconv.pod
-($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -70,6 +78,8 @@ nlmconv.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f nlmconv.pod
nm.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_nm.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod
-($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -77,6 +87,8 @@ nm.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f nm.pod
objcopy.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_objcopy.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dobjcopy < $(binutils_TEXI) > objcopy.pod
-($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -84,6 +96,8 @@ objcopy.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f objcopy.pod
objdump.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_objdump.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dobjdump < $(binutils_TEXI) > objdump.pod
-($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -91,6 +105,8 @@ objdump.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f objdump.pod
ranlib.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_ranlib.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dranlib < $(binutils_TEXI) > ranlib.pod
-($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -98,6 +114,8 @@ ranlib.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f ranlib.pod
readelf.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_readelf.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dreadelf < $(binutils_TEXI) > readelf.pod
-($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -105,6 +123,8 @@ readelf.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f readelf.pod
size.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_size.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dsize < $(binutils_TEXI) > size.pod
-($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -112,6 +132,8 @@ size.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f size.pod
strings.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_strings.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dstrings < $(binutils_TEXI) > strings.pod
-($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -119,6 +141,8 @@ strings.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f strings.pod
strip.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_strip.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dstrip < $(binutils_TEXI) > strip.pod
-($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -133,6 +157,8 @@ elfedit.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f elfedit.pod
windres.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_windres.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dwindres < $(binutils_TEXI) > windres.pod
-($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -140,6 +166,8 @@ windres.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f windres.pod
windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_windmc.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod
-($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -147,6 +175,8 @@ windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f windmc.pod
cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_cxxfilt.man:
touch $@
-$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod
-($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -0,0 +1,171 @@
$NetBSD$
--- binutils/doc/Makefile.in.orig Tue Sep 4 12:53:44 2012
+++ binutils/doc/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -242,6 +242,7 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -349,6 +350,8 @@ clean-libtool:
-rm -rf .libs _libs
binutils.info: binutils.texi
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_binutils.info: binutils.texi
restore=: && backupdir="$(am__leading_dot)am$$$$" && \
rm -rf $$backupdir && mkdir $$backupdir && \
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
@@ -735,6 +738,8 @@ uninstall-man: uninstall-man1
# Man page generation from texinfo
addr2line.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_addr2line.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Daddr2line < $(binutils_TEXI) > addr2line.pod
-($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -742,6 +747,8 @@ addr2line.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f addr2line.pod
ar.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_ar.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dar < $(binutils_TEXI) > ar.pod
-($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -749,6 +756,8 @@ ar.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f ar.pod
dlltool.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_dlltool.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Ddlltool < $(binutils_TEXI) > dlltool.pod
-($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -756,6 +765,8 @@ dlltool.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f dlltool.pod
nlmconv.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_nlmconv.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dnlmconv < $(binutils_TEXI) > nlmconv.pod
-($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -763,6 +774,8 @@ nlmconv.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f nlmconv.pod
nm.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_nm.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod
-($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -770,6 +783,8 @@ nm.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f nm.pod
objcopy.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_objcopy.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dobjcopy < $(binutils_TEXI) > objcopy.pod
-($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -777,6 +792,8 @@ objcopy.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f objcopy.pod
objdump.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_objdump.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dobjdump < $(binutils_TEXI) > objdump.pod
-($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -784,6 +801,8 @@ objdump.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f objdump.pod
ranlib.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_ranlib.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dranlib < $(binutils_TEXI) > ranlib.pod
-($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -791,6 +810,8 @@ ranlib.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f ranlib.pod
readelf.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_readelf.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dreadelf < $(binutils_TEXI) > readelf.pod
-($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -798,6 +819,8 @@ readelf.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f readelf.pod
size.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_size.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dsize < $(binutils_TEXI) > size.pod
-($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -805,6 +828,8 @@ size.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f size.pod
strings.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_strings.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dstrings < $(binutils_TEXI) > strings.pod
-($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -812,6 +837,8 @@ strings.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f strings.pod
strip.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_strip.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dstrip < $(binutils_TEXI) > strip.pod
-($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -819,6 +846,8 @@ strip.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f strip.pod
elfedit.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_elfedit.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Delfedit < $(binutils_TEXI) > elfedit.pod
-($(POD2MAN) elfedit.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -826,6 +855,8 @@ elfedit.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f elfedit.pod
windres.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_windres.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dwindres < $(binutils_TEXI) > windres.pod
-($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -833,6 +864,8 @@ windres.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f windres.pod
windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_windmc.1:
touch $@
-$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod
-($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -840,6 +873,8 @@ windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS)
rm -f windmc.pod
cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_cxxfilt.man:
touch $@
-$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod
-($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
@@ -0,0 +1,13 @@
$NetBSD$
--- binutils/doc/strings.1.orig Mon Mar 25 09:10:26 2013
+++ binutils/doc/strings.1
@@ -208,7 +208,7 @@ Possible values for \fIencoding\fR are: \fBs\fR = sing
characters (\s-1ASCII\s0, \s-1ISO\s0 8859, etc., default), \fBS\fR =
single\-8\-bit\-byte characters, \fBb\fR = 16\-bit bigendian, \fBl\fR =
16\-bit littleendian, \fBB\fR = 32\-bit bigendian, \fBL\fR = 32\-bit
-littleendian. Useful for finding wide character strings. (\fBl\fR
+littleendian. Useful for finding wide-character strings. (\fBl\fR
and \fBb\fR apply to, for example, Unicode \s-1UTF\-16/UCS\-2\s0 encodings).
.IP "\fB\-T\fR \fIbfdname\fR" 4
.IX Item "-T bfdname"
@@ -0,0 +1,12 @@
$NetBSD$
--- binutils/dwarf.c.orig Mon Jul 2 14:35:33 2012
+++ binutils/dwarf.c
@@ -29,6 +29,7 @@
#include "dwarf2.h"
#include "dwarf.h"
#include "gdb/gdb-index.h"
+#include "getopt.h"
static const char *regname (unsigned int regno, int row);
@@ -0,0 +1,13 @@
$NetBSD$
--- binutils/objcopy.c.orig Mon Mar 25 08:06:21 2013
+++ binutils/objcopy.c
@@ -30,6 +30,8 @@
#include "filenames.h"
#include "fnmatch.h"
#include "elf-bfd.h"
+#include <sys/stat.h>
+#include <ctype.h>
#include "libbfd.h"
#include "coff/internal.h"
#include "libcoff.h"
@@ -0,0 +1,99 @@
$NetBSD$
--- binutils/readelf.c.orig Mon Mar 25 08:06:21 2013
+++ binutils/readelf.c
@@ -3801,7 +3801,7 @@ process_program_headers (FILE * file)
if (elf_header.e_phnum > 1)
printf (_("\nProgram Headers:\n"));
else
- printf (_("\nProgram Headers:\n"));
+ printf (_("\nProgram Header:\n"));
if (is_32bit_elf)
printf
@@ -6974,6 +6974,11 @@ decode_arm_unwind (struct arm_unw_aux_info * aux,
remaining = 4;
}
+ else
+ {
+ addr.section = SHN_UNDEF;
+ addr.offset = 0;
+ }
if ((word & 0x80000000) == 0)
{
@@ -12665,6 +12670,38 @@ get_gnu_elf_note_type (unsigned e_type)
return buff;
}
+static int
+process_netbsd_elf_note (Elf_Internal_Note * pnote)
+{
+ unsigned int version;
+
+ switch (pnote->type)
+ {
+ case NT_NETBSD_IDENT:
+ version = byte_get((unsigned char *)pnote->descdata, sizeof(version));
+ if ((version / 10000) % 100)
+ printf (" NetBSD\t0x%08lx\tIDENT %u (%u.%u%s%c)\n", pnote->descsz,
+ version, version / 100000000, (version / 1000000) % 100,
+ (version / 10000) % 100 > 26 ? "Z" : "",
+ 'A' + (version / 10000) % 26);
+ else
+ printf (" NetBSD\t0x%08lx\tIDENT %u (%u.%u.%u)\n", pnote->descsz,
+ version, version / 100000000, (version / 1000000) % 100,
+ (version / 100) % 100);
+ return 1;
+ case NT_NETBSD_MARCH:
+ printf (" NetBSD\t0x%08lx\tMARCH <%s>\n", pnote->descsz,
+ pnote->descdata);
+ return 1;
+ default:
+ break;
+ }
+
+ printf (" NetBSD\t0x%08lx\tUnknown note type: (0x%08lx)\n", pnote->descsz,
+ pnote->type);
+ return 1;
+}
+
static int
print_gnu_note (Elf_Internal_Note *pnote)
{
@@ -12765,6 +12802,23 @@ get_netbsd_elfcore_note_type (unsigned e_type)
}
break;
+ /* On SuperH, PT_GETREGS == mach+3 and PT_GETFPREGS == mach+5.
+ There's also old PT___GETREGS40 == mach + 1 for old reg
+ structure which lacks GBR. */
+ case EM_SH:
+ switch (e_type)
+ {
+ case NT_NETBSDCORE_FIRSTMACH + 1:
+ return _("PT___GETREGS40 (old reg structure)");
+ case NT_NETBSDCORE_FIRSTMACH + 3:
+ return _("PT_GETREGS (reg structure)");
+ case NT_NETBSDCORE_FIRSTMACH + 5:
+ return _("PT_GETFPREGS (fpreg structure)");
+ default:
+ break;
+ }
+ break;
+
/* On all other arch's, PT_GETREGS == mach+1 and
PT_GETFPREGS == mach+3. */
default:
@@ -12970,6 +13024,10 @@ process_note (Elf_Internal_Note * pnote)
else if (const_strneq (pnote->namedata, "GNU"))
/* GNU-specific object file notes. */
nt = get_gnu_elf_note_type (pnote->type);
+
+ else if (const_strneq (pnote->namedata, "NetBSD"))
+ /* NetBSD-specific core file notes. */
+ return process_netbsd_elf_note (pnote);
else if (const_strneq (pnote->namedata, "NetBSD-CORE"))
/* NetBSD-specific core file notes. */
@@ -0,0 +1,13 @@
$NetBSD$
--- binutils/strings.c.orig Thu Feb 9 04:51:44 2012
+++ binutils/strings.c
@@ -598,7 +598,7 @@ print_strings (const char *filename, FILE *stream, fil
else
#elif !BFD_HOST_64BIT_LONG
if (start != (unsigned long) start)
- printf ("++%7ld ", (unsigned long) start);
+ printf ("++%7llu ", (unsigned long) start);
else
#endif
printf ("%7ld ", (long) start);
+15
View File
@@ -0,0 +1,15 @@
$NetBSD$
--- config.guess.orig Mon Jun 6 10:36:06 2011
+++ config.guess
@@ -858,8 +858,8 @@ EOF
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
+ *:Minix:*:*)
+ echo ${UNAME_MACHINE}-elf32-minix
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+13
View File
@@ -0,0 +1,13 @@
$NetBSD$
--- configure.orig Thu Jun 28 11:50:52 2012
+++ configure
@@ -2869,7 +2869,7 @@ case "${ENABLE_GOLD}" in
*-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
| *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
| *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
- | *-*-solaris2* | *-*-nto* | *-*-nacl*)
+ | *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-minix*)
case "${target}" in
*-*-linux*aout* | *-*-linux*oldld*)
;;
-15
View File
@@ -1,15 +0,0 @@
$NetBSD: patch-configure.ac,v 1.2 2016/01/30 22:15:11 ryoon Exp $
Remove etc
--- configure.ac.orig 2016-01-25 08:57:16.000000000 +0000
+++ configure.ac
@@ -140,7 +140,7 @@ host_libs="intl libiberty opcodes bfd re
# binutils, gas and ld appear in that order because it makes sense to run
# "make check" in that particular order.
# If --enable-gold is used, "gold" may replace "ld".
-host_tools="flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools"
+host_tools="flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools"
# libgcj represents the runtime libraries only used by gcj.
libgcj="target-libffi \
@@ -0,0 +1,37 @@
$NetBSD$
--- gas/atof-generic.c.orig Wed Sep 2 07:24:19 2009
+++ gas/atof-generic.c
@@ -121,6 +121,32 @@ atof_generic (/* return pointer to just AFTER number w
switch (first_digit[0])
{
+ case 's':
+ case 'S':
+ if (!strncasecmp ("snan", first_digit, 4))
+ {
+ address_of_generic_floating_point_number->sign = 0;
+ address_of_generic_floating_point_number->exponent = 0;
+ address_of_generic_floating_point_number->leader =
+ address_of_generic_floating_point_number->low;
+ *address_of_string_pointer = first_digit + 4;
+ return 0;
+ }
+ break;
+
+ case 'q':
+ case 'Q':
+ if (!strncasecmp ("qnan", first_digit, 4))
+ {
+ address_of_generic_floating_point_number->sign = 0;
+ address_of_generic_floating_point_number->exponent = 0;
+ address_of_generic_floating_point_number->leader =
+ address_of_generic_floating_point_number->low;
+ *address_of_string_pointer = first_digit + 4;
+ return 0;
+ }
+ break;
+
case 'n':
case 'N':
if (!strncasecmp ("nan", first_digit, 3))
@@ -0,0 +1,34 @@
$NetBSD$
--- gas/config/atof-vax.c.orig Wed Oct 17 16:45:54 2007
+++ gas/config/atof-vax.c
@@ -268,10 +268,27 @@ flonum_gen2vax (int format_letter, /* One of 'd' 'f' '
int exponent_skippage;
LITTLENUM_TYPE word1;
- /* JF: Deal with new Nan, +Inf and -Inf codes. */
if (f->sign != '-' && f->sign != '+')
{
- make_invalid_floating_point_number (words);
+ if (f->sign == 0)
+ {
+ /* All NaNs are 0. */
+ memset (words, 0x00, sizeof (LITTLENUM_TYPE) * precision);
+ }
+ else if (f->sign == 'P')
+ {
+ /* Positive Infinity. */
+ memset (words, 0xff, sizeof (LITTLENUM_TYPE) * precision);
+ words[0] &= 0x7fff;
+ }
+ else if (f->sign == 'N')
+ {
+ /* Negative Infinity. */
+ memset (words, 0x00, sizeof (LITTLENUM_TYPE) * precision);
+ words[0] = 0x0080;
+ }
+ else
+ make_invalid_floating_point_number (words);
return return_value;
}
@@ -0,0 +1,27 @@
$NetBSD$
--- gas/config/tc-arm.c.orig Mon Mar 25 08:06:21 2013
+++ gas/config/tc-arm.c
@@ -17290,12 +17290,16 @@ check_it_blocks_finished (void)
asection *sect;
for (sect = stdoutput->sections; sect != NULL; sect = sect->next)
- if (seg_info (sect)->tc_segment_info_data.current_it.state
- == MANUAL_IT_BLOCK)
- {
- as_warn (_("section '%s' finished with an open IT block."),
- sect->name);
- }
+ {
+ segment_info_type *seginfo = seg_info (sect);
+
+ if (seginfo && seginfo->tc_segment_info_data.current_it.state
+ == MANUAL_IT_BLOCK)
+ {
+ as_warn (_("section '%s' finished with an open IT block."),
+ sect->name);
+ }
+ }
#else
if (now_it.state == MANUAL_IT_BLOCK)
as_warn (_("file finished with an open IT block."));
@@ -0,0 +1,10 @@
--- gas/config/tc-i386.c.orig Sun Apr 26 20:11:37 2015
+++ gas/config/tc-i386.c Sun Apr 26 20:12:12 2015
@@ -317,6 +317,7 @@
&& !defined (TE_NETWARE) \
&& !defined (TE_FreeBSD) \
&& !defined (TE_DragonFly) \
+ && !defined (TE_MINIX) \
&& !defined (TE_NetBSD)))
/* This array holds the chars that always start a comment. If the
pre-processor is disabled, these aren't very useful. The option
@@ -0,0 +1,15 @@
$NetBSD$
--- gas/config/tc-i386.h.orig Tue Sep 18 12:10:46 2012
+++ gas/config/tc-i386.h
@@ -72,6 +72,10 @@ extern unsigned long i386_mach (void);
#define ELF_TARGET_FORMAT64 "elf64-x86-64-sol2"
#endif
+#ifdef TE_MINIX
+#define ELF_TARGET_FORMAT "elf32-i386-minix"
+#endif
+
#ifndef ELF_TARGET_FORMAT
#define ELF_TARGET_FORMAT "elf32-i386"
#endif
@@ -0,0 +1,19 @@
$NetBSD$
--- gas/config/tc-m68k.c.orig Wed May 16 10:26:47 2012
+++ gas/config/tc-m68k.c
@@ -7426,12 +7426,12 @@ m68k_lookup_cpu (const char *arg, const struct m68k_cp
}
}
- /* Remove 'm' or 'mc' prefix from 68k variants. */
+ /* Remove 'm' or 'mc' prefix from 68k or coldfire variants. */
if (allow_m)
{
if (arg[0] == 'm')
{
- if (arg[1] == '6')
+ if (arg[1] == '6' || arg[1] == '5')
arg += 1;
else if (arg[1] == 'c' && arg[2] == '6')
arg += 2;
@@ -0,0 +1,244 @@
$NetBSD$
--- gas/config/tc-mips.c.orig Tue Sep 4 14:21:03 2012
+++ gas/config/tc-mips.c
@@ -909,6 +909,9 @@ enum fix_vr4120_class
NUM_FIX_VR4120_CLASSES
};
+/* ...likewise -mtrap-zero-jump. */
+static bfd_boolean mips_trap_zero_jump;
+
/* ...likewise -mfix-loongson2f-jump. */
static bfd_boolean mips_fix_loongson2f_jump;
@@ -941,6 +944,8 @@ static bfd_boolean mips_fix_cn63xxp1;
efficient expansion. */
static int mips_relax_branch;
+
+static int mips_fix_loongson2f_btb;
/* The expansion of many macros depends on the type of symbol that
they refer to. For example, when generating position-dependent code,
@@ -1316,6 +1321,7 @@ static void macro_build (expressionS *, const char *,
static void mips16_macro_build
(expressionS *, const char *, const char *, va_list *);
static void load_register (int, expressionS *, int);
+static void macro_build (expressionS *, const char *, const char *, ...);
static void macro_start (void);
static void macro_end (void);
static void macro (struct mips_cl_insn * ip);
@@ -3626,6 +3632,35 @@ nops_for_insn_or_target (int ignore, const struct mips
return nops;
}
+static void
+trap_zero_jump (struct mips_cl_insn * ip)
+{
+ if (strcmp (ip->insn_mo->name, "j") == 0
+ || strcmp (ip->insn_mo->name, "jr") == 0
+ || strcmp (ip->insn_mo->name, "jalr") == 0)
+ {
+ int sreg;
+
+ if (mips_opts.warn_about_macros)
+ return;
+
+ sreg = EXTRACT_OPERAND (0, RS, *ip);
+ if (mips_opts.isa == ISA_MIPS32
+ || mips_opts.isa == ISA_MIPS32R2
+ || mips_opts.isa == ISA_MIPS64
+ || mips_opts.isa == ISA_MIPS64R2)
+ {
+ expressionS ep;
+ ep.X_op = O_constant;
+ ep.X_add_number = 4096;
+ macro_build (&ep, "tltiu", "s,j", sreg, BFD_RELOC_LO16);
+ }
+ else if (mips_opts.isa != ISA_UNKNOWN
+ && mips_opts.isa != ISA_MIPS1)
+ macro_build (NULL, "teq", "s,t", sreg, 0);
+ }
+}
+
/* Fix NOP issue: Replace nops by "or at,at,zero". */
static void
@@ -3663,6 +3698,16 @@ fix_loongson2f_jump (struct mips_cl_insn * ip)
ep.X_add_number = 0xffff;
macro_build (&ep, "ori", "t,r,i", ATREG, ATREG, BFD_RELOC_LO16);
macro_build (NULL, "and", "d,v,t", sreg, sreg, ATREG);
+ /* Hide these three instructions to avoid getting a ``macro expanded into
+ multiple instructions'' warning. */
+ if (mips_relax.sequence != 2) {
+ mips_macro_warning.sizes[0] -= 3 * 4;
+ mips_macro_warning.insns[0] -= 3;
+ }
+ if (mips_relax.sequence != 1) {
+ mips_macro_warning.sizes[1] -= 3 * 4;
+ mips_macro_warning.insns[1] -= 3;
+ }
}
}
@@ -3718,6 +3763,11 @@ can_swap_branch_p (struct mips_cl_insn *ip)
if (mips_opts.mips16 && history[0].fixp[0])
return FALSE;
+ if (mips_fix_loongson2f)
+ fix_loongson2f (ip);
+ if (mips_trap_zero_jump)
+ trap_zero_jump (ip);
+
/* If the branch is itself the target of a branch, we can not swap.
We cheat on this; all we check for is whether there is a label on
this instruction. If there are any branches to anything other than
@@ -4764,6 +4814,45 @@ macro_read_relocs (va_list *args, bfd_reloc_code_real_
r[i] = (bfd_reloc_code_real_type) va_arg (*args, int);
}
+/* Fix jump through register issue on loongson2f processor for kernel code:
+ force a BTB clear before the jump to prevent it from being incorrectly
+ prefetched by the branch prediction engine. */
+
+static void
+macro_build_jrpatch (expressionS *ep, unsigned int sreg)
+{
+ if (!mips_fix_loongson2f_btb)
+ return;
+
+ if (sreg == ZERO || sreg == KT0 || sreg == KT1 || sreg == AT)
+ return;
+
+ if (!mips_opts.at)
+ {
+ as_warn (_("unable to apply loongson2f BTB workaround when .set noat"));
+ return;
+ }
+
+ /* li $at, COP_0_BTB_CLEAR | COP_0_RAS_DISABLE */
+ ep->X_op = O_constant;
+ ep->X_add_number = 3;
+ macro_build (ep, "ori", "t,r,i", AT, ZERO, BFD_RELOC_LO16);
+
+ /* dmtc0 $at, COP_0_DIAG */
+ macro_build (NULL, "dmtc0", "t,G", AT, 22);
+
+ /* Hide these two instructions to avoid getting a ``macro expanded into
+ multiple instructions'' warning. */
+ if (mips_relax.sequence != 2) {
+ mips_macro_warning.sizes[0] -= 2 * 4;
+ mips_macro_warning.insns[0] -= 2;
+ }
+ if (mips_relax.sequence != 1) {
+ mips_macro_warning.sizes[1] -= 2 * 4;
+ mips_macro_warning.insns[0] -= 2;
+ }
+}
+
/* Build an instruction created by a macro expansion. This is passed
a pointer to the count of instructions created so far, an
expression, the name of the instruction to build, an operand format
@@ -7637,6 +7726,26 @@ macro (struct mips_cl_insn *ip)
macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", treg, tempreg, breg);
break;
+ case M_JR_S:
+ macro_build_jrpatch (&expr1, sreg);
+ macro_build (NULL, "jr", "s", sreg);
+ return; /* didn't modify $at */
+
+ case M_J_S:
+ macro_build_jrpatch (&expr1, sreg);
+ macro_build (NULL, "j", "s", sreg);
+ return; /* didn't modify $at */
+
+ case M_JALR_S:
+ macro_build_jrpatch (&expr1, sreg);
+ macro_build (NULL, "jalr", "s", sreg);
+ return; /* didn't modify $at */
+
+ case M_JALR_DS:
+ macro_build_jrpatch (&expr1, sreg);
+ macro_build (NULL, "jalr", "d,s", dreg, sreg);
+ return; /* didn't modify $at */
+
case M_MSGSND:
gas_assert (!mips_opts.micromips);
{
@@ -14350,6 +14459,8 @@ enum options
OPTION_SINGLE_FLOAT,
OPTION_DOUBLE_FLOAT,
OPTION_32,
+ OPTION_TRAP_ZERO_JUMP,
+ OPTION_NO_TRAP_ZERO_JUMP,
#ifdef OBJ_ELF
OPTION_CALL_SHARED,
OPTION_CALL_NONPIC,
@@ -14364,6 +14475,8 @@ enum options
OPTION_NO_PDR,
OPTION_MVXWORKS_PIC,
#endif /* OBJ_ELF */
+ OPTION_FIX_LOONGSON2F_BTB,
+ OPTION_NO_FIX_LOONGSON2F_BTB,
OPTION_END_OF_ENUM
};
@@ -14421,6 +14534,8 @@ struct option md_longopts[] =
{"mno-fix-loongson2f-jump", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_JUMP},
{"mfix-loongson2f-nop", no_argument, NULL, OPTION_FIX_LOONGSON2F_NOP},
{"mno-fix-loongson2f-nop", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_NOP},
+ {"mfix-loongson2f-btb", no_argument, NULL, OPTION_FIX_LOONGSON2F_BTB},
+ {"mno-fix-loongson2f-btb", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_BTB},
{"mfix-vr4120", no_argument, NULL, OPTION_FIX_VR4120},
{"mno-fix-vr4120", no_argument, NULL, OPTION_NO_FIX_VR4120},
{"mfix-vr4130", no_argument, NULL, OPTION_FIX_VR4130},
@@ -14459,6 +14574,9 @@ struct option md_longopts[] =
make testing easier. */
{"32", no_argument, NULL, OPTION_32},
+ {"mtrap-zero-jump", no_argument, NULL, OPTION_TRAP_ZERO_JUMP},
+ {"mno-trap-zero-jump", no_argument, NULL, OPTION_NO_TRAP_ZERO_JUMP},
+
/* ELF-specific options. */
#ifdef OBJ_ELF
{"KPIC", no_argument, NULL, OPTION_CALL_SHARED},
@@ -14750,6 +14868,14 @@ md_parse_option (int c, char *arg)
mips_fix_vr4130 = 0;
break;
+ case OPTION_FIX_LOONGSON2F_BTB:
+ mips_fix_loongson2f_btb = 1;
+ break;
+
+ case OPTION_NO_FIX_LOONGSON2F_BTB:
+ mips_fix_loongson2f_btb = 0;
+ break;
+
case OPTION_FIX_CN63XXP1:
mips_fix_cn63xxp1 = TRUE;
break;
@@ -14782,6 +14908,14 @@ md_parse_option (int c, char *arg)
mips_opts.sym32 = FALSE;
break;
+ case OPTION_TRAP_ZERO_JUMP:
+ mips_trap_zero_jump = TRUE;
+ break;
+
+ case OPTION_NO_TRAP_ZERO_JUMP:
+ mips_trap_zero_jump = FALSE;
+ break;
+
#ifdef OBJ_ELF
/* When generating ELF code, we permit -KPIC and -call_shared to
select SVR4_PIC, and -non_shared to select no PIC. This is
@@ -19411,6 +19545,7 @@ MIPS options:\n\
fprintf (stream, _("\
-mfix-loongson2f-jump work around Loongson2F JUMP instructions\n\
-mfix-loongson2f-nop work around Loongson2F NOP errata\n\
+-mfix-loongson2f-btb work around Loongson2F BTB errata\n\
-mfix-vr4120 work around certain VR4120 errata\n\
-mfix-vr4130 work around VR4130 mflo/mfhi errata\n\
-mfix-24k insert a nop after ERET and DERET instructions\n\
@@ -0,0 +1,194 @@
$NetBSD$
--- gas/config/tc-vax.c.orig Mon Jun 28 14:06:57 2010
+++ gas/config/tc-vax.c
@@ -392,6 +392,9 @@ md_estimate_size_before_relax (fragS *fragP, segT segm
&& (PLT_symbol == NULL || fragP->fr_symbol != PLT_symbol)
&& fragP->fr_symbol != NULL
&& flag_want_pic
+#ifdef OBJ_ELF
+ && ELF_ST_VISIBILITY (S_GET_OTHER (fragP->fr_symbol)) != STV_HIDDEN
+#endif
&& (!S_IS_DEFINED (fragP->fr_symbol)
|| S_IS_WEAK (fragP->fr_symbol)
|| S_IS_EXTERNAL (fragP->fr_symbol)))
@@ -1073,6 +1076,154 @@ vax_reg_parse (char c1, char c2, char c3, char c4)
return retval;
}
+#ifdef OBJ_AOUT
+#ifndef BFD_ASSEMBLER
+void
+tc_aout_fix_to_chars (where, fixP, segment_address_in_file)
+ char *where;
+ fixS *fixP;
+ relax_addressT segment_address_in_file;
+{
+ /*
+ * In: length of relocation (or of address) in chars: 1, 2 or 4.
+ * Out: GNU LD relocation length code: 0, 1, or 2.
+ */
+
+ static const unsigned char nbytes_r_length[] = {42, 0, 1, 42, 2};
+ int r_symbolnum;
+ int r_flags;
+
+ know (fixP->fx_addsy != NULL);
+
+ md_number_to_chars (where,
+ fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file,
+ 4);
+
+ r_symbolnum = (S_IS_DEFINED (fixP->fx_addsy)
+ ? S_GET_TYPE (fixP->fx_addsy)
+ : fixP->fx_addsy->sy_number);
+ r_flags = (fixP->fx_pcrel ? 1 : 0)
+ | (!S_IS_DEFINED (fixP->fx_addsy) ? 8 : 0) /* extern */
+ | ((nbytes_r_length[fixP->fx_size] & 3) << 1);
+
+#if 0
+ r_flags |= ((!S_IS_DEFINED(fixP->fx_addsy)
+ && fixP->fx_pcrel
+ && fixP->fx_addsy != GOT_symbol
+ && fixP->fx_addsy != PLT_symbol
+ && flags_want_pic) ? 0x10 : 0);
+#endif
+
+ switch (fixP->fx_r_type) {
+ case NO_RELOC:
+ break;
+ case NO_RELOC2:
+ if (r_flags & 8)
+ r_flags |= 0x80; /* setting the copy bit */
+ /* says we can convert */
+ /* to gotslot if needed */
+ break;
+ case RELOC_32:
+ if (flag_want_pic && S_IS_EXTERNAL(fixP->fx_addsy)) {
+ r_symbolnum = fixP->fx_addsy->sy_number;
+ r_flags |= 8; /* set extern bit */
+ }
+ break;
+ case RELOC_JMP_SLOT:
+ if (flag_want_pic) {
+ r_flags |= 0x20; /* set jmptable */
+ r_flags &= ~0x08; /* clear extern bit */
+ }
+ break;
+ case RELOC_JMP_TBL:
+ if (flag_want_pic) {
+ r_flags |= 0x20; /* set jmptable */
+ r_flags |= 0x08; /* set extern bit */
+ }
+ break;
+ case RELOC_GLOB_DAT:
+ if (flag_want_pic) {
+ r_flags |= 0x10; /* set baserel bit */
+ r_symbolnum = fixP->fx_addsy->sy_number;
+ if (S_IS_EXTERNAL(fixP->fx_addsy))
+ r_flags |= 8; /* set extern bit */
+ }
+ break;
+ }
+
+ where[4] = (r_symbolnum >> 0) & 0xff;
+ where[5] = (r_symbolnum >> 8) & 0xff;
+ where[6] = (r_symbolnum >> 16) & 0xff;
+ where[7] = r_flags;
+}
+#endif /* !BFD_ASSEMBLER */
+#endif /* OBJ_AOUT */
+
+/*
+ * BUGS, GRIPES, APOLOGIA, etc.
+ *
+ * The opcode table 'votstrs' needs to be sorted on opcode frequency.
+ * That is, AFTER we hash it with hash_...(), we want most-used opcodes
+ * to come out of the hash table faster.
+ *
+ * I am sorry to inflict yet another VAX assembler on the world, but
+ * RMS says we must do everything from scratch, to prevent pin-heads
+ * restricting this software.
+ */
+
+/*
+ * This is a vaguely modular set of routines in C to parse VAX
+ * assembly code using DEC mnemonics. It is NOT un*x specific.
+ *
+ * The idea here is that the assembler has taken care of all:
+ * labels
+ * macros
+ * listing
+ * pseudo-ops
+ * line continuation
+ * comments
+ * condensing any whitespace down to exactly one space
+ * and all we have to do is parse 1 line into a vax instruction
+ * partially formed. We will accept a line, and deliver:
+ * an error message (hopefully empty)
+ * a skeleton VAX instruction (tree structure)
+ * textual pointers to all the operand expressions
+ * a warning message that notes a silly operand (hopefully empty)
+ */
+
+/*
+ * E D I T H I S T O R Y
+ *
+ * 17may86 Dean Elsner. Bug if line ends immediately after opcode.
+ * 30apr86 Dean Elsner. New vip_op() uses arg block so change call.
+ * 6jan86 Dean Elsner. Crock vip_begin() to call vip_op_defaults().
+ * 2jan86 Dean Elsner. Invent synthetic opcodes.
+ * Widen vax_opcodeT to 32 bits. Use a bit for VIT_OPCODE_SYNTHETIC,
+ * which means this is not a real opcode, it is like a macro; it will
+ * be relax()ed into 1 or more instructions.
+ * Use another bit for VIT_OPCODE_SPECIAL if the op-code is not optimised
+ * like a regular branch instruction. Option added to vip_begin():
+ * exclude synthetic opcodes. Invent synthetic_votstrs[].
+ * 31dec85 Dean Elsner. Invent vit_opcode_nbytes.
+ * Also make vit_opcode into a char[]. We now have n-byte vax opcodes,
+ * so caller's don't have to know the difference between a 1-byte & a
+ * 2-byte op-code. Still need vax_opcodeT concept, so we know how
+ * big an object must be to hold an op.code.
+ * 30dec85 Dean Elsner. Widen typedef vax_opcodeT in "vax-inst.h"
+ * because vax opcodes may be 16 bits. Our crufty C compiler was
+ * happily initialising 8-bit vot_codes with 16-bit numbers!
+ * (Wouldn't the 'phone company like to compress data so easily!)
+ * 29dec85 Dean Elsner. New static table vax_operand_width_size[].
+ * Invented so we know hw many bytes a "I^#42" needs in its immediate
+ * operand. Revised struct vop in "vax-inst.h": explicitly include
+ * byte length of each operand, and it's letter-code datum type.
+ * 17nov85 Dean Elsner. Name Change.
+ * Due to ar(1) truncating names, we learned the hard way that
+ * "vax-inst-parse.c" -> "vax-inst-parse." dropping the "o" off
+ * the archived object name. SO... we shortened the name of this
+ * source file, and changed the makefile.
+ */
+
/* Parse a vax operand in DEC assembler notation.
For speed, expect a string of whitespace to be reduced to a single ' '.
This is the case for GNU AS, and is easy for other DEC-compatible
@@ -3150,7 +3301,7 @@ md_assemble (char *instruction_string)
if (flag_want_pic && operandP->vop_mode == 8
&& this_add_symbol != NULL)
{
- as_warn (_("Symbol %s used as immediate operand in PIC mode."),
+ as_warn (_("Symbol '%s' used as immediate operand in PIC mode."),
S_GET_NAME (this_add_symbol));
}
#endif
@@ -3226,7 +3377,15 @@ md_assemble (char *instruction_string)
length = 4;
}
}
+#ifdef OBJ_ELF
+ if (flag_want_pic && this_add_symbol != NULL)
+ {
+ as_warn (_("Symbol '%s' used as displacement in PIC mode."),
+ S_GET_NAME (this_add_symbol));
+ }
+#endif
p = frag_more (1 + length);
+ know (operandP->vop_reg != 0xf);
know (operandP->vop_reg >= 0);
p[0] = operandP->vop_reg
| ((at | "?\12\14?\16"[length]) << 4);
@@ -0,0 +1,27 @@
$NetBSD$
--- gas/config/te-armnbsd.h.orig Mon May 19 14:12:57 2014
+++ gas/config/te-armnbsd.h
@@ -0,0 +1,22 @@
+/* Copyright 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 3,
+ or (at your option) any later version.
+
+ GAS is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+ the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+#include "te-nbsd.h"
+
+#define CPU_DEFAULT ARM_ARCH_V4
@@ -0,0 +1,30 @@
$NetBSD$
--- gas/config/te-armnbsdeabi.h.orig Mon May 19 14:12:57 2014
+++ gas/config/te-armnbsdeabi.h
@@ -0,0 +1,25 @@
+/* Copyright 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 3,
+ or (at your option) any later version.
+
+ GAS is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+ the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+#include "te-nbsd.h"
+
+/* The EABI requires the use of VFP. */
+#define CPU_DEFAULT ARM_ARCH_V5TEJ
+#define FPU_DEFAULT FPU_ARCH_VFP
+#define EABI_DEFAULT EF_ARM_EABI_VER5
@@ -0,0 +1,30 @@
$NetBSD$
--- gas/config/te-armnbsdeabihf.h.orig Mon May 19 14:12:57 2014
+++ gas/config/te-armnbsdeabihf.h
@@ -0,0 +1,25 @@
+/* Copyright 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 3,
+ or (at your option) any later version.
+
+ GAS is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+ the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+#include "te-nbsd.h"
+
+/* The EABI requires the use of VFP. */
+#define CPU_DEFAULT ARM_ARCH_V5TEJ
+#define FPU_DEFAULT FPU_ARCH_VFP_V2
+#define EABI_DEFAULT EF_ARM_EABI_VER5
@@ -0,0 +1,14 @@
$NetBSD$
--- gas/config/te-minix.h.orig Mon May 19 14:12:57 2014
+++ gas/config/te-minix.h
@@ -0,0 +1,9 @@
+#define TE_MINIX 1
+
+/* Added these, because if we don't know what we're targeting we may
+ need an assembler version of libgcc, and that will use local
+ labels. */
+#define LOCAL_LABELS_DOLLAR 1
+#define LOCAL_LABELS_FB 1
+
+#include "obj-format.h"
@@ -0,0 +1,13 @@
$NetBSD$
--- gas/config/vax-inst.h.orig Wed Sep 2 07:24:21 2009
+++ gas/config/vax-inst.h
@@ -66,6 +66,8 @@ typedef long vax_opcodeT; /* For initialising array of
#define VAX_WIDEN_WORD (0x20) /* Add this to byte branch to get word br. */
#define VAX_WIDEN_LONG (0x6) /* Add this to byte branch to get long jmp.*/
/* Needs VAX_PC_RELATIVE_MODE byte after it*/
+#define VAX_CALLS (0xFB) /* Call with arg list on stack */
+#define VAX_CALLG (0xFA) /* Call with arg list in memory */
struct vit /* vax instruction tree */
{
@@ -0,0 +1,15 @@
$NetBSD$
--- gas/configure.orig Mon Jun 18 04:43:06 2012
+++ gas/configure
@@ -6127,6 +6127,10 @@ freebsd* | dragonfly*)
fi
;;
+minix*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
gnu*)
lt_cv_deplibs_check_method=pass_all
;;
+11 -13
View File
@@ -1,15 +1,13 @@
$NetBSD: patch-gas_configure.tgt,v 1.2 2016/02/03 19:56:34 jperkin Exp $
$NetBSD$
Add Bitrig/amd64 support
https://sourceware.org/bugzilla/show_bug.cgi?id=18920
--- gas/configure.tgt.orig 2015-11-13 08:27:41.000000000 +0000
--- gas/configure.tgt.orig Tue Sep 4 12:53:45 2012
+++ gas/configure.tgt
@@ -238,6 +238,7 @@ case ${generic_target} in
i386-*-openbsd[0-2].* | \
i386-*-openbsd3.[0-2]) fmt=aout em=nbsd ;;
i386-*-openbsd*) fmt=elf em=nbsd ;;
+ i386-*-bitrig*) fmt=elf em=nbsd ;;
i386-*-linux*aout*) fmt=aout em=linux ;;
i386-*-linux*oldld) fmt=aout em=linux ;;
i386-*-linux*coff*) fmt=coff em=linux ;;
@@ -446,6 +446,8 @@ case ${generic_target} in
*-*-elf | *-*-sysv4*) fmt=elf ;;
*-*-solaris*) fmt=elf em=solaris ;;
*-*-aros*) fmt=elf em=linux ;;
+ i*-*-minix*) fmt=elf em=minix ;;
+ arm*-*-minix*) fmt=elf em=armeabi ;;
*-*-vxworks* | *-*-windiss) fmt=elf em=vxworks ;;
*-*-netware) fmt=elf em=netware ;;
esac
@@ -0,0 +1,22 @@
$NetBSD$
--- gas/doc/Makefile.am.orig Tue Sep 4 12:53:45 2012
+++ gas/doc/Makefile.am
@@ -24,6 +24,8 @@ TEXI2DVI = texi2dvi -I "$(srcdir)" -I "$(top_srcdir)/.
-I "$(top_srcdir)/../bfd/doc" -I ../../bfd/doc
asconfig.texi: $(CONFIG).texi
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_asconfig.text:
rm -f asconfig.texi
cp $(srcdir)/$(CONFIG).texi ./asconfig.texi
chmod u+w ./asconfig.texi
@@ -103,6 +105,8 @@ info-local: $(MANS)
# The sed command removes the no-adjust Nroff command so that
# the man output looks standard.
as.1: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_as.1:
touch $@
-$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod
-($(POD2MAN) as.pod | \
@@ -0,0 +1,31 @@
$NetBSD$
--- gas/doc/Makefile.in.orig Tue Sep 4 12:53:45 2012
+++ gas/doc/Makefile.in
@@ -374,6 +374,8 @@ clean-libtool:
-rm -rf .libs _libs
as.info: as.texinfo $(as_TEXINFOS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_as.info: as.texinfo $(as_TEXINFOS)
restore=: && backupdir="$(am__leading_dot)am$$$$" && \
rm -rf $$backupdir && mkdir $$backupdir && \
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
@@ -756,6 +758,8 @@ uninstall-man: uninstall-man1
asconfig.texi: $(CONFIG).texi
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_asconfig.texi:
rm -f asconfig.texi
cp $(srcdir)/$(CONFIG).texi ./asconfig.texi
chmod u+w ./asconfig.texi
@@ -773,6 +777,8 @@ info-local: $(MANS)
# The sed command removes the no-adjust Nroff command so that
# the man output looks standard.
as.1: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS)
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_as.1:
touch $@
-$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod
-($(POD2MAN) as.pod | \
@@ -0,0 +1,19 @@
$NetBSD$
--- gas/doc/c-mips.texi.orig Tue Sep 4 14:16:07 2012
+++ gas/doc/c-mips.texi
@@ -210,6 +210,14 @@ all problems in hand-written assembler code.
@itemx -mno-fix-vr4130
Insert nops to work around the VR4130 @samp{mflo}/@samp{mfhi} errata.
+@item -mfix-loongson2f-btb
+@itemx -mno-fix-loongson2f-btb
+Clear the Branch Target Buffer before any jump through a register. This
+option is intended to be used on kernel code for the Loongson 2F processor
+only; userland code compiled with this option will fault, and kernel code
+compiled with this option run on another processor than Loongson 2F will
+yield unpredictable results.
+
@item -mfix-24k
@itemx -mno-fix-24k
Insert nops to work around the 24K @samp{eret}/@samp{deret} errata.
+15
View File
@@ -0,0 +1,15 @@
$NetBSD$
--- gas/remap.c.orig Fri Mar 11 14:18:24 2011
+++ gas/remap.c
@@ -84,8 +84,8 @@ remap_debug_filename (const char *filename)
return xstrdup (filename);
name = filename + map->old_len;
name_len = strlen (name) + 1;
- s = (char *) alloca (name_len + map->new_len);
+ s = (char *) xmalloc (name_len + map->new_len);
memcpy (s, map->new_prefix, map->new_len);
memcpy (s + map->new_len, name, name_len);
- return xstrdup (s);
+ return s;
}
@@ -0,0 +1,13 @@
$NetBSD$
--- gold/Makefile.am.orig Wed May 2 21:37:23 2012
+++ gold/Makefile.am
@@ -20,7 +20,7 @@ AM_CPPFLAGS = \
LIBIBERTY = ../libiberty/libiberty.a
if PLUGINS
-LIBDL = -ldl
+LIBDL = @DLOPEN_LIBS@
endif
if THREADS
+13 -18
View File
@@ -1,26 +1,21 @@
$NetBSD: patch-gold_Makefile.in,v 1.3 2016/02/03 19:56:34 jperkin Exp $
$NetBSD$
Don't bail out on the deprecation warnings for <ext/hash_map>
Don't use hard-coded -ldl.
--- gold/Makefile.in.orig 2015-11-13 08:27:42.000000000 +0000
--- gold/Makefile.in.orig Mon Mar 25 08:06:23 2013
+++ gold/Makefile.in
@@ -345,7 +345,7 @@ TARGETOBJS = @TARGETOBJS@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
-WARN_CXXFLAGS = @WARN_CXXFLAGS@
+WARN_CXXFLAGS = @WARN_CXXFLAGS@ -Wno-deprecated
XGETTEXT = @XGETTEXT@
YACC = @YACC@
YFLAGS = @YFLAGS@
@@ -427,7 +427,7 @@ AM_CPPFLAGS = \
@@ -249,6 +249,7 @@ CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DLOPEN_LIBS =
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -375,7 +376,7 @@ AM_CPPFLAGS = \
-DTOOLLIBDIR="\"$(tooldir)/lib\"" @INCINTL@
LIBIBERTY = ../libiberty/libiberty.a
-@PLUGINS_TRUE@LIBDL = @DLOPEN_LIBS@
+@PLUGINS_TRUE@LIBDL = ${DL_LDFLAGS}
-@PLUGINS_TRUE@LIBDL = -ldl
+@PLUGINS_TRUE@LIBDL =
@THREADS_TRUE@THREADSLIB = -lpthread
AM_YFLAGS = -d
@@ -0,0 +1,15 @@
--- gold/config.in.orig Fri Jul 18 14:44:56 2014
+++ gold/config.in Fri Jul 18 14:57:50 2014
@@ -187,6 +187,12 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the <unordered_map> header file. */
+#undef HAVE_UNORDERED_MAP
+
+/* Define to 1 if you have the <unordered_set> header file. */
+#undef HAVE_UNORDERED_SET
+
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
@@ -0,0 +1,23 @@
--- gold/configure.orig Mon Mar 25 08:06:23 2013
+++ gold/configure Fri Jul 18 14:46:06 2014
@@ -7105,6 +7105,20 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAG
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+for ac_header in unordered_set unordered_map
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
for ac_header in tr1/unordered_set tr1/unordered_map
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -0,0 +1,10 @@
--- gold/configure.ac.orig Mon Mar 25 08:06:23 2013
+++ gold/configure.ac Fri Jul 18 14:46:06 2014
@@ -496,6 +496,7 @@ AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, sn
AC_LANG_PUSH(C++)
+AC_CHECK_HEADERS(unordered_set unordered_map)
AC_CHECK_HEADERS(tr1/unordered_set tr1/unordered_map)
AC_CHECK_HEADERS(ext/hash_map ext/hash_set)
AC_CHECK_HEADERS(byteswap.h)
+24
View File
@@ -0,0 +1,24 @@
--- gold/gold.h.orig Fri Nov 9 08:21:28 2012
+++ gold/gold.h Fri Jul 18 14:46:06 2014
@@ -66,7 +66,20 @@
// Figure out how to get a hash set and a hash map.
-#if defined(HAVE_TR1_UNORDERED_SET) && defined(HAVE_TR1_UNORDERED_MAP) \
+#if defined(HAVE_UNORDERED_SET) && defined(HAVE_UNORDERED_MAP)
+
+#include <unordered_set>
+#include <unordered_map>
+
+// We need a template typedef here.
+
+#define Unordered_set std::unordered_set
+#define Unordered_map std::unordered_map
+#define Unordered_multimap std::unordered_multimap
+
+#define reserve_unordered_map(map, n) ((map)->rehash(n))
+
+#elif defined(HAVE_TR1_UNORDERED_SET) && defined(HAVE_TR1_UNORDERED_MAP) \
&& defined(HAVE_TR1_UNORDERED_MAP_REHASH)
#include <tr1/unordered_set>
+15
View File
@@ -0,0 +1,15 @@
$NetBSD$
--- gold/i386.cc.orig Mon May 19 14:30:54 2014
+++ gold/i386.cc
@@ -2538,6 +2538,10 @@ Target_i386::do_finalize_sections(
Symbol* sym = this->global_offset_table_;
if (sym != NULL)
{
+ // create a plt
+ if (this->plt_ == NULL)
+ this->make_plt_section(symtab, layout);
+
uint32_t data_size = this->got_plt_->current_data_size();
symtab->get_sized_symbol<32>(sym)->set_symsize(data_size);
}
@@ -1,36 +0,0 @@
$NetBSD: patch-gold_options.h,v 1.2 2016/02/03 19:56:34 jperkin Exp $
The NetBSD and OpenBSD real-time linkers do not understand DT_RUNPATH
or DT_INIT_ARRAY. The current gold defaults are not suitable for them.
The last couple of DragonFly and FreeBSD releases do support these tags.
--- gold/options.h.orig 2015-11-13 08:27:42.000000000 +0000
+++ gold/options.h
@@ -713,9 +713,15 @@ class General_options
N_("Output cross reference table"),
N_("Do not output cross reference table"));
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+ DEFINE_bool(ctors_in_init_array, options::TWO_DASHES, '\0', false,
+ N_("Use DT_INIT_ARRAY for all constructors"),
+ N_("Handle constructors as directed by compiler (default)"));
+#else
DEFINE_bool(ctors_in_init_array, options::TWO_DASHES, '\0', true,
N_("Use DT_INIT_ARRAY for all constructors (default)"),
N_("Handle constructors as directed by compiler"));
+#endif
DEFINE_bool(define_common, options::TWO_DASHES, 'd', false,
N_("Define common symbols"),
@@ -956,7 +962,11 @@ class General_options
N_("Do not page align data, do not make text readonly"),
N_("Page align data, make text readonly"));
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+ DEFINE_enable(new_dtags, options::EXACTLY_TWO_DASHES, '\0', false,
+#else
DEFINE_enable(new_dtags, options::EXACTLY_TWO_DASHES, '\0', true,
+#endif
N_("Enable use of DT_RUNPATH and DT_FLAGS"),
N_("Disable use of DT_RUNPATH and DT_FLAGS"));
@@ -0,0 +1,43 @@
$NetBSD$
--- gold/plugin.cc.orig Tue Jun 12 22:52:41 2012
+++ gold/plugin.cc
@@ -29,8 +29,38 @@
#include <vector>
#ifdef ENABLE_PLUGINS
+#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
+#elif defined (HAVE_WINDOWS_H)
+#include <windows.h>
+#else
+#error Unknown how to handle dynamic-load-libraries.
#endif
+
+#if !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H)
+
+#define RTLD_NOW 0 /* Dummy value. */
+static void *
+dlopen(const char *file, int mode ATTRIBUTE_UNUSED)
+{
+ return LoadLibrary(file);
+}
+
+static void *
+dlsym(void *handle, const char *name)
+{
+ return reinterpret_cast<void *>(
+ GetProcAddress(static_cast<HMODULE>(handle),name));
+}
+
+static const char *
+dlerror(void)
+{
+ return "unable to load dll";
+}
+
+#endif /* !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) */
+#endif /* ENABLE_PLUGINS */
#include "parameters.h"
#include "errors.h"
@@ -1,22 +0,0 @@
$NetBSD: patch-gold_resolve.cc,v 1.2 2016/01/30 22:15:11 ryoon Exp $
The gold linker is overly pedantic for dynamic references to symbols
with hidden visibility. It will spew error messages about weak symbols
in libc.so that ld.bfd does not complain about. Until the bug is resolved
disable the hidden symbol warnings. These warning also cause > 200
false failures in the gcc gnat.dg testsuite.
https://sourceware.org/bugzilla/show_bug.cgi?id=15574
--- gold/resolve.cc.orig 2015-11-13 08:27:42.000000000 +0000
+++ gold/resolve.cc
@@ -284,8 +284,7 @@ Symbol_table::resolve(Sized_symbol<size>
to->set_in_reg();
}
else if (st_shndx == elfcpp::SHN_UNDEF
- && (to->visibility() == elfcpp::STV_HIDDEN
- || to->visibility() == elfcpp::STV_INTERNAL))
+ && (to->visibility() == elfcpp::STV_INTERNAL))
{
// The symbol is hidden, so a reference from a shared object
// cannot bind to it. We tried issuing a warning in this case,
@@ -0,0 +1,23 @@
--- gold/stringpool.cc.orig Wed Aug 25 08:36:54 2010
+++ gold/stringpool.cc Fri Jul 18 14:46:06 2014
@@ -72,7 +72,10 @@ Stringpool_template<Stringpool_char>::reserve(unsigned
{
this->key_to_offset_.reserve(n);
-#if defined(HAVE_TR1_UNORDERED_MAP)
+#if defined(HAVE_UNORDERED_MAP)
+ this->string_set_.rehash(this->string_set_.size() + n);
+ return;
+#elif defined(HAVE_TR1_UNORDERED_MAP)
// rehash() implementation is broken in gcc 4.0.3's stl
//this->string_set_.rehash(this->string_set_.size() + n);
//return;
@@ -499,7 +502,7 @@ template<typename Stringpool_char>
void
Stringpool_template<Stringpool_char>::print_stats(const char* name) const
{
-#if defined(HAVE_TR1_UNORDERED_MAP) || defined(HAVE_EXT_HASH_MAP)
+#if defined(HAVE_UNORDERED_MAP) || defined(HAVE_TR1_UNORDERED_MAP) || defined(HAVE_EXT_HASH_MAP)
fprintf(stderr, _("%s: %s entries: %zu; buckets: %zu\n"),
program_name, name, this->string_set_.size(),
this->string_set_.bucket_count());
@@ -1,13 +0,0 @@
$NetBSD: patch-gold_system.h,v 1.4 2016/02/03 19:56:34 jperkin Exp $
--- gold/system.h.orig 2015-11-13 08:27:42.000000000 +0000
+++ gold/system.h
@@ -118,7 +118,7 @@ struct hash<std::string>
{
size_t
operator()(std::string s) const
- { return __stl_hash_string(s.c_str()); }
+ { return __gnu_cxx::hash<const char *>()(s.c_str()); }
};
template<typename T>
@@ -0,0 +1,12 @@
$NetBSD$
--- gold/testsuite/Makefile.in.orig Mon Mar 25 08:06:23 2013
+++ gold/testsuite/Makefile.in
@@ -1875,6 +1875,7 @@ CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DLOPEN_LIBS =
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -0,0 +1,13 @@
$NetBSD$
--- gprof/corefile.c.orig Tue Mar 6 13:54:59 2012
+++ gprof/corefile.c
@@ -30,6 +30,8 @@
#include "corefile.h"
#include "safe-ctype.h"
+#include <stdlib.h>
+
bfd *core_bfd;
static int core_num_syms;
static asymbol **core_syms;
@@ -0,0 +1,13 @@
$NetBSD$
--- gprof/gprof.c.orig Fri Jun 12 15:33:30 2009
+++ gprof/gprof.c
@@ -47,6 +47,8 @@
static void usage (FILE *, int) ATTRIBUTE_NORETURN;
+#include <stdlib.h>
+
const char * whoami;
const char * function_mapping_file;
static const char * external_symbol_table;
@@ -0,0 +1,15 @@
$NetBSD$
--- include/bfdlink.h.orig Mon Apr 9 16:27:18 2012
+++ include/bfdlink.h
@@ -435,6 +435,10 @@ struct bfd_link_info
option). If this is NULL, no symbols are being wrapped. */
struct bfd_hash_table *wrap_hash;
+ /* Hash table of symbols which may be left unresolved during
+ a link. If this is NULL, no symbols can be left unresolved. */
+ struct bfd_hash_table *ignore_hash;
+
/* The output BFD. */
bfd *output_bfd;
@@ -0,0 +1,12 @@
$NetBSD$
--- include/elf/common.h.orig Tue Sep 4 12:53:47 2012
+++ include/elf/common.h
@@ -607,6 +607,7 @@
/* Values for NetBSD .note.netbsd.ident notes. Note name is "NetBSD". */
#define NT_NETBSD_IDENT 1
+#define NT_NETBSD_MARCH 5
/* Values for OpenBSD .note.openbsd.ident notes. Note name is "OpenBSD". */
@@ -0,0 +1,20 @@
$NetBSD$
--- include/objalloc.h.orig Tue May 10 10:21:08 2005
+++ include/objalloc.h
@@ -1,5 +1,5 @@
/* objalloc.h -- routines to allocate memory for objects
- Copyright 1997, 2001 Free Software Foundation, Inc.
+ Copyright 1997-2012 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Solutions.
This program is free software; you can redistribute it and/or modify it
@@ -91,7 +91,7 @@ extern void *_objalloc_alloc (struct objalloc *, unsig
if (__len == 0) \
__len = 1; \
__len = (__len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); \
- (__len <= __o->current_space \
+ (__len != 0 && __len <= __o->current_space \
? (__o->current_ptr += __len, \
__o->current_space -= __len, \
(void *) (__o->current_ptr - __len)) \
@@ -0,0 +1,16 @@
$NetBSD$
--- include/opcode/mips.h.orig Tue Sep 4 14:21:05 2012
+++ include/opcode/mips.h
@@ -1035,7 +1035,11 @@ enum
M_DSUB_I,
M_DSUBU_I,
M_DSUBU_I_2,
+ M_JR_S,
+ M_J_S,
M_J_A,
+ M_JALR_S,
+ M_JALR_DS,
M_JAL_1,
M_JAL_2,
M_JAL_A,
@@ -1,20 +1,46 @@
$NetBSD: patch-include_safe-ctype.h,v 1.2 2016/02/03 19:56:34 jperkin Exp $
--- include/safe-ctype.h.orig 2015-11-13 08:27:42.000000000 +0000
+++ include/safe-ctype.h
@@ -120,6 +120,8 @@ extern const unsigned char _sch_tolower
--- include/safe-ctype.h.orig Mon Jul 7 17:09:31 2008
+++ include/safe-ctype.h Fri Jul 18 14:46:06 2014
@@ -119,6 +119,7 @@ extern const unsigned char _sch_tolower[256];
including another system header (for instance gnulib's stdint.h).
So we include ctype.h here and then immediately redefine its macros. */
+#if !defined(__minix) || !defined(__clang__)
#include <ctype.h>
+
+#ifndef __cplusplus
#undef isalpha
#define isalpha(c) do_not_use_isalpha_with_safe_ctype
#undef isalnum
@@ -146,5 +148,6 @@ extern const unsigned char _sch_tolower
@@ -145,6 +146,34 @@ extern const unsigned char _sch_tolower[256];
#undef toupper
#define toupper(c) do_not_use_toupper_with_safe_ctype
#undef tolower
#define tolower(c) do_not_use_tolower_with_safe_ctype
+#endif
-#define tolower(c) do_not_use_tolower_with_safe_ctype
+#else
+#include <ctype.h>
+#undef isalpha
+#define isalpha(c) ISALPHA(c)
+#undef isalnum
+#define isalnum(c) ISALNUM(c)
+#undef iscntrl
+#define iscntrl(c) ISCNTRL(c)
+#undef isdigit
+#define isdigit(c) ISDIGIT(c)
+#undef isgraph
+#define isgraph(c) ISGRAPH(c)
+#undef islower
+#define islower(c) ISLOWER(c)
+#undef isprint
+#define isprint(c) ISPRINT(c)
+#undef ispunct
+#define ispunct(c) ISPUNCT(c)
+#undef isspace
+#define isspace(c) ISSPACE(c)
+#undef isupper
+#define isupper(c) ISUPPER(c)
+#undef isxdigit
+#define isxdigit(c) ISXDIGIT(c)
+#undef toupper
+#define toupper(c) TOUPPER(c)
+#undef tolower
+#define tolower(c) TOLOWER(c)
+#endif /* !defined(__minix) || !defined(__clang__) */
#endif /* SAFE_CTYPE_H */
@@ -0,0 +1,62 @@
$NetBSD$
--- ld/Makefile.am.orig Mon Mar 25 08:06:23 2013
+++ ld/Makefile.am
@@ -145,12 +145,14 @@ ALL_EMULATION_SOURCES = \
earmelf_linux_eabi.c \
earmelf_nacl.c \
earmelf_nbsd.c \
+ earmelf_nbsd_eabi.c \
earmelf_vxworks.c \
earmelfb.c \
earmelfb_linux.c \
earmelfb_linux_eabi.c \
earmelfb_nacl.c \
earmelfb_nbsd.c \
+ earmelfb_nbsd_eabi.c \
earmnbsd.c \
earmnto.c \
earmpe.c \
@@ -731,6 +733,11 @@ earmelf_nbsd.c: $(srcdir)/emulparams/armelf_nbsd.sh \
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf_nbsd "$(tdir_armelf_nbsd)"
+earmelf_nbsd_abi.c: $(srcdir)/emulparams/armelf_nbsd_abi.sh \
+ $(srcdir)/emulparams/armelf.sh \
+ $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelf_nbsd_abi "$(tdir_armelf_nbsd_abi)"
earmelf_vxworks.c: $(srcdir)/emulparams/armelf_vxworks.sh \
$(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/armelf.sh \
$(ELF_DEPS) $(srcdir)/emultempl/vxworks.em \
@@ -766,6 +773,12 @@ earmelfb_nbsd.c: $(srcdir)/emulparams/armelfb_nbsd.sh
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelfb_nbsd "$(tdir_armelfb_nbsd)"
+earmelfb_nbsd_abi.c: $(srcdir)/emulparams/armelfb_nbsd_abi.sh \
+ $(srcdir)/emulparams/armelf_nbsd_abi.sh \
+ $(srcdir)/emulparams/armelf.sh \
+ $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelfb_nbsd_abi "$(tdir_armelfb_nbsd_abi)"
earmnbsd.c: $(srcdir)/emulparams/armnbsd.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
${GENSCRIPTS} armnbsd "$(tdir_armnbsd)"
@@ -2219,6 +2232,8 @@ endif
# because almost all configs use "gen" version of manual.
# Set DOCVER above to change.
configdoc.texi: ${DOCVER}-doc.texi
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_configdoc.texi:
cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
chmod u+w ./configdoc.texi
@@ -2226,6 +2241,8 @@ configdoc.texi: ${DOCVER}-doc.texi
# The sed command removes the no-adjust Nroff command so that
# the man output looks standard.
ld.1: $(srcdir)/ld.texinfo configdoc.texi
+ @echo "NOT REBUILDING $@"
+NetBSD_DISABLED_ld.1:
touch $@
-$(TEXI2POD) $(MANCONF) < $(srcdir)/ld.texinfo > ld.pod
-($(POD2MAN) ld.pod | \
@@ -0,0 +1,42 @@
$NetBSD$
--- ld/Makefile.in.orig Mon Mar 25 08:06:23 2013
+++ ld/Makefile.in
@@ -450,6 +450,7 @@ ALL_EMULATION_SOURCES = \
earmelf_fbsd.c \
earmelf_linux.c \
earmelf_linux_eabi.c \
+ earmelf_minix.c \
earmelf_nacl.c \
earmelf_nbsd.c \
earmelf_vxworks.c \
@@ -572,6 +573,7 @@ ALL_EMULATION_SOURCES = \
eelf_i386_chaos.c \
eelf_i386_fbsd.c \
eelf_i386_ldso.c \
+ eelf_i386_minix.c \
eelf_i386_nacl.c \
eelf_i386_sol2.c \
eelf_i386_vxworks.c \
@@ -2189,6 +2191,10 @@ earmelf_linux_eabi.c: $(srcdir)/emulparams/armelf_linu
$(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
$(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} armelf_linux_eabi "$(tdir_armelf_linux_abi)"
+earmelf_minix.c: $(srcdir)/emulparams/armelf_minix.sh \
+ $(srcdir)/emulparams/armelf.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} armelf_minix "$(tdir_armelf_minix)"
earmelf_nacl.c: $(srcdir)/emulparams/armelf_nacl.sh \
$(srcdir)/emulparams/armelf_linux_eabi.sh \
$(srcdir)/emulparams/armelf_linux.sh \
@@ -2698,6 +2704,10 @@ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.s
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
+eelf_i386_minix.c: $(srcdir)/emulparams/elf_i386_minix.sh \
+ $(srcdir)/emulparams/elf_i386.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386_minix "$(tdir_elf_i386_minix)"
eelf_i386_nacl.c: $(srcdir)/emulparams/elf_i386_nacl.sh \
$(srcdir)/emulparams/elf_i386.sh \
$(srcdir)/emulparams/elf_nacl.sh \
@@ -0,0 +1,32 @@
$NetBSD$
--- ld/configdoc.texi.orig Tue Nov 13 14:19:33 2012
+++ ld/configdoc.texi
@@ -1,27 +0,0 @@
-@c ------------------------------ CONFIGURATION VARS:
-@c 1. Inclusiveness of this manual
-@set GENERIC
-
-@c 2. Specific target machines
-@set ARM
-@set C6X
-@set H8300
-@set HPPA
-@set I960
-@set M68HC11
-@set M68K
-@set MMIX
-@set MSP430
-@set POWERPC
-@set POWERPC64
-@set Renesas
-@set SPU
-@set TICOFF
-@set WIN32
-@set XTENSA
-
-@c 3. Properties of this configuration
-@clear SingleFormat
-@set UsesEnvVars
-@c ------------------------------ end CONFIGURATION VARS
-
+20 -17
View File
@@ -1,19 +1,22 @@
$NetBSD: patch-ld_configure.tgt,v 1.4 2016/01/30 22:15:11 ryoon Exp $
$NetBSD$
Add Bitrig/amd64 support
https://sourceware.org/bugzilla/show_bug.cgi?id=18920
--- ld/configure.tgt.orig 2015-11-13 08:27:42.000000000 +0000
--- ld/configure.tgt.orig Tue Sep 4 12:53:47 2012
+++ ld/configure.tgt
@@ -309,6 +309,11 @@ x86_64-*-netbsd*) targ_emul=elf_x86_64
*) tdir_elf_i386=`echo ${tdir_elf_i386} | \
sed -e 's/netbsd/netbsdelf/'`;;
esac ;;
+i[3-7]86-*-bitrig*) targ_emul=i386nbsd
+ targ_extra_emuls=elf_i386 ;;
+x86_64-*-bitrig*) targ_emul=elf_x86_64
+ targ_extra_emuls="elf_i386 i386nbsd elf_l1om elf_k1om"
+ ;;
i[3-7]86-*-netware) targ_emul=i386nw ;;
i[3-7]86-*-elfiamcu) targ_emul=elf_iamcu
targ_extra_emuls=elf_i386 ;;
@@ -76,6 +76,8 @@ arm-*-rtems*) targ_emul=armelf ;;
armeb-*-elf) targ_emul=armelfb ;;
arm-*-elf | arm*-*-eabi*)
targ_emul=armelf ;;
+arm*-*-minix*) targ_emul=armelf_minix
+ targ_extra_emuls="armelf" ;;
arm*-*-symbianelf*) targ_emul=armsymbian;;
arm-*-kaos*) targ_emul=armelf ;;
arm9e-*-elf) targ_emul=armelf ;;
@@ -202,6 +204,8 @@ i[3-7]86-*-bsd) targ_emul=i386bsd ;;
i[3-7]86-*-bsd386) targ_emul=i386bsd ;;
i[3-7]86-*-bsdi*) targ_emul=i386bsd ;;
i[3-7]86-*-aout) targ_emul=i386aout ;;
+i[3-7]86-*-minix) targ_emul=elf_i386_minix
+ targ_extra_emuls="elf_i386" ;;
i[3-7]86-*-linux*aout*) targ_emul=i386linux
targ_extra_emuls=elf_i386
tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` ;;
@@ -0,0 +1,20 @@
$NetBSD$
--- ld/emulparams/armelf_minix.sh.orig Mon May 19 14:12:58 2014
+++ ld/emulparams/armelf_minix.sh
@@ -0,0 +1,15 @@
+. ${srcdir}/emulparams/armelf.sh
+. ${srcdir}/emulparams/elf_minix.sh
+OUTPUT_FORMAT="elf32-littlearm"
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
+
+DATA_START_SYMBOLS='PROVIDE (__data_start = .);';
+
+# Dynamic libraries support
+GENERATE_SHLIB_SCRIPT=yes
+TARGET2_TYPE=got-rel
+
+GENERATE_PIE_SCRIPT=yes
+
+unset EMBEDDED
@@ -0,0 +1,17 @@
$NetBSD$
--- ld/emulparams/armelf_nbsd.sh.orig Tue May 30 16:45:32 2006
+++ ld/emulparams/armelf_nbsd.sh
@@ -3,5 +3,12 @@ MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
TEXT_START_ADDR=0x00008000
TARGET2_TYPE=got-rel
+unset DATA_START_SYMBOLS
unset STACK_ADDR
unset EMBEDDED
+
+case "$target" in
+ arm*-*-netbsdelf*-*eabi*)
+ LIB_PATH='=/usr/lib/oabi'
+ ;;
+esac
@@ -0,0 +1,23 @@
$NetBSD$
--- ld/emulparams/armelf_nbsd_eabi.sh.orig Mon May 19 14:12:58 2014
+++ ld/emulparams/armelf_nbsd_eabi.sh
@@ -0,0 +1,18 @@
+. ${srcdir}/emulparams/armelf_nbsd.sh
+
+# Use the ARM ABI-compliant exception-handling sections.
+OTHER_READONLY_SECTIONS="
+ .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) }
+ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); }
+ .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) }
+ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }"
+
+unset LIB_PATH
+
+case "$target" in
+ arm*-*-netbsdelf*-*eabi*)
+ ;;
+ arm*-*-netbsdelf*)
+ LIB_PATH='=/usr/lib/eabi'
+ ;;
+esac
@@ -0,0 +1,7 @@
$NetBSD$
--- ld/emulparams/armelfb_nbsd_eabi.sh.orig Mon May 19 14:12:58 2014
+++ ld/emulparams/armelfb_nbsd_eabi.sh
@@ -0,0 +1,2 @@
+. ${srcdir}/emulparams/armelf_nbsd_eabi.sh
+OUTPUT_FORMAT="elf32-bigarm"
@@ -0,0 +1,12 @@
$NetBSD$
--- ld/emulparams/elf32_sparc.sh.orig Mon Sep 20 18:41:15 2010
+++ ld/emulparams/elf32_sparc.sh
@@ -13,6 +13,7 @@ MACHINE=
TEMPLATE_NAME=elf32
DATA_PLT=
GENERATE_SHLIB_SCRIPT=yes
+#ELFSIZE=32
GENERATE_PIE_SCRIPT=yes
NOP=0x01000000
NO_SMALL_DATA=yes
@@ -0,0 +1,12 @@
$NetBSD$
--- ld/emulparams/elf32bmipn32-defs.sh.orig Tue Sep 4 14:14:28 2012
+++ ld/emulparams/elf32bmipn32-defs.sh
@@ -6,6 +6,7 @@ SCRIPT_NAME=elf
# Handle both big- and little-ended 32-bit MIPS objects.
ARCH=mips
+MACHINE=
OUTPUT_FORMAT="elf32-bigmips"
BIG_OUTPUT_FORMAT="elf32-bigmips"
LITTLE_OUTPUT_FORMAT="elf32-littlemips"
@@ -0,0 +1,13 @@
$NetBSD$
--- ld/emulparams/elf64alpha_nbsd.sh.orig Mon Dec 17 23:54:58 2001
+++ ld/emulparams/elf64alpha_nbsd.sh
@@ -1,2 +1,8 @@
. ${srcdir}/emulparams/elf64alpha.sh
ENTRY=__start
+
+NOP=0x47ff041f
+# XXX binutils 2.13
+# Note that the number is always big-endian, thus we have to
+# reverse the digit string.
+#NOP=0x0000fe2f1f04ff47 # unop; nop
@@ -0,0 +1,19 @@
$NetBSD$
--- ld/emulparams/elf_i386.sh.orig Mon Jun 11 13:23:50 2012
+++ ld/emulparams/elf_i386.sh
@@ -9,7 +9,14 @@ ARCH=i386
MACHINE=
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
+#ELFSIZE=32
GENERATE_PIE_SCRIPT=yes
NO_SMALL_DATA=yes
SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 12 ? 12 : 0"
IREL_IN_PLT=
+
+case "$target" in
+ x86_64-*-netbsd*)
+ LIB_PATH='=/usr/lib/i386'
+ ;;
+esac
@@ -0,0 +1,8 @@
$NetBSD$
--- ld/emulparams/elf_i386_minix.sh.orig Mon May 19 14:12:58 2014
+++ ld/emulparams/elf_i386_minix.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/elf_i386.sh
+. ${srcdir}/emulparams/elf_minix.sh
+OUTPUT_FORMAT="elf32-i386-minix"
@@ -0,0 +1,6 @@
$NetBSD$
--- ld/emulparams/elf_minix.sh.orig Mon May 19 14:12:58 2014
+++ ld/emulparams/elf_minix.sh
@@ -0,0 +1 @@
+ELF_INTERPRETER_NAME=\"/libexec/ld-elf.so.1\"

Some files were not shown because too many files have changed in this diff Show More