diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2011-04-24 20:19:26 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2011-04-24 20:19:26 +0000 |
commit | 5a1b2a93cd7448f144e221fa585f2d35f3be3fe6 (patch) | |
tree | b0b7eb717a326fb0d797e2e3b6b7b450cdae863e /gnu/usr.bin/binutils-2.17/gas | |
parent | 917667791cb7410d22e23fdfd33147d2774974e1 (diff) |
A first attempt at merging our local changes and fixes into the 2.17 codebase.
ld(1) needs a lot more work, as the upstream code evolved significantly since
2.15, mostly due to changes in PIE binaries layout, and we had already
diverged significantly to implement W^X.
Diffstat (limited to 'gnu/usr.bin/binutils-2.17/gas')
19 files changed, 170 insertions, 81 deletions
diff --git a/gnu/usr.bin/binutils-2.17/gas/Makefile.am b/gnu/usr.bin/binutils-2.17/gas/Makefile.am index 08b9842fc6b..a43e0268fc5 100644 --- a/gnu/usr.bin/binutils-2.17/gas/Makefile.am +++ b/gnu/usr.bin/binutils-2.17/gas/Makefile.am @@ -373,6 +373,7 @@ TARG_ENV_HFILES = \ config/te-nbsd.h \ config/te-nbsd532.h \ config/te-netware.h \ + config/te-obsd.h \ config/te-pc532mach.h \ config/te-pe.h \ config/te-psos.h \ @@ -478,7 +479,8 @@ DEP_FLAGS = -DOBJ_MAYBE_ELF \ # How to link with both our special library facilities # and the system's installed libraries. -GASLIBS = @OPCODES_LIB@ @BFDLIB@ ../libiberty/libiberty.a +GASLIBS = @OPCODES_LIB@ @BFDLIB@ -liberty +GASLIBSDEP = @OPCODES_LIB@ @BFDLIB@ # Files to be copied away after each stage in building. STAGESTUFF = *.o $(noinst_PROGRAMS) @@ -491,7 +493,7 @@ as_new_SOURCES = $(GAS_CFILES) as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ $(extra_objects) $(GASLIBS) $(INTLLIBS) $(LIBM) as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ - $(extra_objects) $(GASLIBS) $(INTLDEPS) + $(extra_objects) $(GASLIBSDEP) $(INTLDEPS) # Stuff that every object file depends upon. If anything is removed # from this list, remove it from dep-in.sed as well. @@ -710,7 +712,7 @@ install-exec-bindir: $(noinst_PROGRAMS) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(noinst_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ - echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done diff --git a/gnu/usr.bin/binutils-2.17/gas/Makefile.in b/gnu/usr.bin/binutils-2.17/gas/Makefile.in index 4cc485f9683..9e41c01b668 100644 --- a/gnu/usr.bin/binutils-2.17/gas/Makefile.in +++ b/gnu/usr.bin/binutils-2.17/gas/Makefile.in @@ -602,6 +602,7 @@ TARG_ENV_HFILES = \ config/te-nbsd.h \ config/te-nbsd532.h \ config/te-netware.h \ + config/te-obsd.h \ config/te-pc532mach.h \ config/te-pe.h \ config/te-psos.h \ @@ -694,7 +695,8 @@ DEP_FLAGS = -DOBJ_MAYBE_ELF \ # How to link with both our special library facilities # and the system's installed libraries. -GASLIBS = @OPCODES_LIB@ @BFDLIB@ ../libiberty/libiberty.a +GASLIBS = @OPCODES_LIB@ @BFDLIB@ -liberty +GASLIBSDEP = @OPCODES_LIB@ @BFDLIB@ # Files to be copied away after each stage in building. STAGESTUFF = *.o $(noinst_PROGRAMS) @@ -703,7 +705,7 @@ as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ $(extra_objects) $(GASLIBS) $(INTLLIBS) $(LIBM) as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ - $(extra_objects) $(GASLIBS) $(INTLDEPS) + $(extra_objects) $(GASLIBSDEP) $(INTLDEPS) EXPECT = expect RUNTEST = runtest @@ -2805,6 +2807,8 @@ install-data-am: install-exec-am: install-exec-local +install-info-am: + install-info: install-info-recursive install-man: @@ -3049,7 +3053,7 @@ install-exec-bindir: $(noinst_PROGRAMS) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(noinst_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ - echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done diff --git a/gnu/usr.bin/binutils-2.17/gas/as.h b/gnu/usr.bin/binutils-2.17/gas/as.h index 2f92c2ed774..1c19e0df082 100644 --- a/gnu/usr.bin/binutils-2.17/gas/as.h +++ b/gnu/usr.bin/binutils-2.17/gas/as.h @@ -567,7 +567,6 @@ segT subseg_get (const char *, int); struct expressionS; struct fix; typedef struct symbol symbolS; -struct relax_type; typedef struct frag fragS; /* literal.c */ diff --git a/gnu/usr.bin/binutils-2.17/gas/config/tc-alpha.c b/gnu/usr.bin/binutils-2.17/gas/config/tc-alpha.c index 3765b08c73a..9873c900ad5 100644 --- a/gnu/usr.bin/binutils-2.17/gas/config/tc-alpha.c +++ b/gnu/usr.bin/binutils-2.17/gas/config/tc-alpha.c @@ -1829,7 +1829,7 @@ insert_operand (unsigned insn, insn = (*operand->insert) (insn, val, &errmsg); if (errmsg) - as_warn (errmsg); + as_warn ("%s", errmsg); } else insn |= ((val & ((1 << operand->bits) - 1)) << operand->shift); diff --git a/gnu/usr.bin/binutils-2.17/gas/config/tc-arm.c b/gnu/usr.bin/binutils-2.17/gas/config/tc-arm.c index ae420b35347..485fad2e53c 100644 --- a/gnu/usr.bin/binutils-2.17/gas/config/tc-arm.c +++ b/gnu/usr.bin/binutils-2.17/gas/config/tc-arm.c @@ -111,7 +111,7 @@ enum arm_float_abi #ifndef FPU_DEFAULT # ifdef TE_LINUX # define FPU_DEFAULT FPU_ARCH_FPA -# elif defined (TE_NetBSD) +# elif defined (TE_NetBSD) || defined (TE_OpenBSD) # ifdef OBJ_ELF # define FPU_DEFAULT FPU_ARCH_VFP /* Soft-float, but VFP order. */ # else @@ -12880,7 +12880,7 @@ md_begin (void) } else if (!mfpu_opt) { -#if !(defined (TE_LINUX) || defined (TE_NetBSD) || defined (TE_VXWORKS)) +#if !(defined (TE_LINUX) || defined (TE_NetBSD) || defined (TE_OpenBSD) || defined (TE_VXWORKS)) /* Some environments specify a default FPU. If they don't, infer it from the processor. */ if (mcpu_fpu_opt) diff --git a/gnu/usr.bin/binutils-2.17/gas/config/tc-hppa.h b/gnu/usr.bin/binutils-2.17/gas/config/tc-hppa.h index 9b3edc1878f..6c30372d45a 100644 --- a/gnu/usr.bin/binutils-2.17/gas/config/tc-hppa.h +++ b/gnu/usr.bin/binutils-2.17/gas/config/tc-hppa.h @@ -72,7 +72,7 @@ #define TARGET_FORMAT "som" #endif -#if defined(TE_LINUX) || defined(TE_NetBSD) +#if defined(TE_LINUX) || defined(TE_NetBSD) || defined(TE_OpenBSD) /* Define to compile in an extra assembler option, -c, which enables a warning (once per file) when a comment is encountered. The hppa comment char is a `;' which tends to occur in random C asm diff --git a/gnu/usr.bin/binutils-2.17/gas/config/tc-i386.c b/gnu/usr.bin/binutils-2.17/gas/config/tc-i386.c index be384bc99a7..3c5551e038c 100644 --- a/gnu/usr.bin/binutils-2.17/gas/config/tc-i386.c +++ b/gnu/usr.bin/binutils-2.17/gas/config/tc-i386.c @@ -202,7 +202,8 @@ const char extra_symbol_chars[] = "*%-([" && !defined (TE_LINUX) \ && !defined (TE_NETWARE) \ && !defined (TE_FreeBSD) \ - && !defined (TE_NetBSD))) + && !defined (TE_NetBSD) \ + && !defined (TE_OpenBSD))) /* This array holds the chars that always start a comment. If the pre-processor is disabled, these aren't very useful. The option --divide will remove '/' from this list. */ @@ -3491,7 +3492,7 @@ output_insn () /* All opcodes on i386 have either 1 or 2 bytes. Merom New Instructions have 3 bytes. We may use one more higher byte to specify a prefix the instruction requires. */ - if ((i.tm.cpu_flags & CpuMNI) != 0) + if ((i.tm.cpu_flags & (CpuMNI|CpuAES|CpuPCLMUL)) != 0) { if (i.tm.base_opcode & 0xff000000) { @@ -3532,7 +3533,7 @@ check_prefix: } else { - if ((i.tm.cpu_flags & CpuMNI) != 0) + if ((i.tm.cpu_flags & (CpuMNI|CpuAES|CpuPCLMUL)) != 0) { p = frag_more (3); *p++ = (i.tm.base_opcode >> 16) & 0xff; diff --git a/gnu/usr.bin/binutils-2.17/gas/config/tc-i386.h b/gnu/usr.bin/binutils-2.17/gas/config/tc-i386.h index 98517041dad..a54724e7ba5 100644 --- a/gnu/usr.bin/binutils-2.17/gas/config/tc-i386.h +++ b/gnu/usr.bin/binutils-2.17/gas/config/tc-i386.h @@ -34,7 +34,7 @@ extern unsigned long i386_mach (void); #ifdef TE_FreeBSD #define AOUT_TARGET_FORMAT "a.out-i386-freebsd" #endif -#ifdef TE_NetBSD +#if defined(TE_NetBSD) || defined(TE_OpenBSD) #define AOUT_TARGET_FORMAT "a.out-i386-netbsd" #endif #ifdef TE_386BSD @@ -185,6 +185,8 @@ typedef struct #define CpuSVME 0x80000 /* AMD Secure Virtual Machine Ext-s required */ #define CpuVMX 0x100000 /* VMX Instructions required */ #define CpuMNI 0x200000 /* Merom New Instructions required */ +#define CpuAES 0x400000 /* Intel AES extensions required */ +#define CpuPCLMUL 0x800000 /* Intel Carry-less Multiplication extensions */ /* These flags are set by gas depending on the flag_code. */ #define Cpu64 0x4000000 /* 64bit support required */ @@ -193,7 +195,8 @@ typedef struct /* The default value for unknown CPUs - enable all features to avoid problems. */ #define CpuUnknownFlags (Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 \ |CpuP4|CpuSledgehammer|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuPNI|CpuVMX \ - |Cpu3dnow|Cpu3dnowA|CpuK6|CpuAthlon|CpuPadLock|CpuSVME|CpuMNI) + |Cpu3dnow|Cpu3dnowA|CpuK6|CpuAthlon|CpuPadLock|CpuSVME|CpuMNI|CpuAES \ + |CpuPCLMUL) /* the bits in opcode_modifier are used to generate the final opcode from the base_opcode. These bits also are used to detect alternate forms of @@ -388,7 +391,11 @@ arch_entry; /* The name of the global offset table generated by the compiler. Allow this to be overridden if need be. */ #ifndef GLOBAL_OFFSET_TABLE_NAME +#ifdef OBJ_ELF #define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_" +#else +#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_" +#endif #endif #if (defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) && !defined (LEX_AT) diff --git a/gnu/usr.bin/binutils-2.17/gas/config/tc-i960.c b/gnu/usr.bin/binutils-2.17/gas/config/tc-i960.c index a3206bbf2d0..5c7cc4a1327 100644 --- a/gnu/usr.bin/binutils-2.17/gas/config/tc-i960.c +++ b/gnu/usr.bin/binutils-2.17/gas/config/tc-i960.c @@ -1669,14 +1669,14 @@ md_assemble (char *textP) break; case REG: if (branch_predict) - as_warn (bp_error_msg); + as_warn ("%s", bp_error_msg); reg_fmt (args, oP); break; case MEM1: if (args[0][0] == 'c' && args[0][1] == 'a') { if (branch_predict) - as_warn (bp_error_msg); + as_warn ("%s", bp_error_msg); mem_fmt (args, oP, 1); break; } @@ -1686,12 +1686,12 @@ md_assemble (char *textP) case MEM12: case MEM16: if (branch_predict) - as_warn (bp_error_msg); + as_warn ("%s", bp_error_msg); mem_fmt (args, oP, 0); break; case CALLJ: if (branch_predict) - as_warn (bp_error_msg); + as_warn ("%s", bp_error_msg); /* Output opcode & set up "fixup" (relocation); flag relocation as 'callj' type. */ know (oP->num_ops == 1); diff --git a/gnu/usr.bin/binutils-2.17/gas/config/tc-m68k.h b/gnu/usr.bin/binutils-2.17/gas/config/tc-m68k.h index fc05a9264e6..1942de0000a 100644 --- a/gnu/usr.bin/binutils-2.17/gas/config/tc-m68k.h +++ b/gnu/usr.bin/binutils-2.17/gas/config/tc-m68k.h @@ -30,7 +30,7 @@ struct fix; #ifdef TE_SUN3 #define TARGET_FORMAT "a.out-sunos-big" #endif -#ifdef TE_NetBSD +#if defined(TE_NetBSD) || defined(TE_OpenBSD) #define TARGET_FORMAT "a.out-m68k-netbsd" #endif #ifdef TE_LINUX diff --git a/gnu/usr.bin/binutils-2.17/gas/config/tc-mips.c b/gnu/usr.bin/binutils-2.17/gas/config/tc-mips.c index c885205dad4..df153aef884 100644 --- a/gnu/usr.bin/binutils-2.17/gas/config/tc-mips.c +++ b/gnu/usr.bin/binutils-2.17/gas/config/tc-mips.c @@ -692,6 +692,8 @@ static int mips_fix_vr4130; 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, @@ -964,6 +966,7 @@ static void mips_no_prev_insn (void); 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); @@ -2971,6 +2974,41 @@ macro_read_relocs (va_list *args, bfd_reloc_code_real_type *r) 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.noat) + { + 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; + if (mips_relax.sequence != 1) + mips_macro_warning.sizes[1] -= 2 * 4; +} + /* 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 @@ -3361,6 +3399,7 @@ macro_build_jalr (expressionS *ep) frag_grow (8); f = frag_more (0); } + macro_build_jrpatch (ep, PIC_CALL_REG); macro_build (NULL, "jalr", "d,s", RA, PIC_CALL_REG); if (HAVE_NEWABI) fix_new_exp (frag_now, f - frag_now->fr_literal, @@ -5490,6 +5529,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_J_A: /* The j instruction may not be used in PIC code, since it requires an absolute address. We convert it to a b @@ -5508,12 +5567,16 @@ macro (struct mips_cl_insn *ip) /* Fall through. */ case M_JAL_2: if (mips_pic == NO_PIC) - macro_build (NULL, "jalr", "d,s", dreg, sreg); + { + macro_build_jrpatch (&expr1, sreg); + macro_build (NULL, "jalr", "d,s", dreg, sreg); + } else { if (sreg != PIC_CALL_REG) as_warn (_("MIPS PIC call to register other than $25")); + macro_build_jrpatch (&expr1, sreg); macro_build (NULL, "jalr", "d,s", dreg, sreg); if (mips_pic == SVR4_PIC && !HAVE_NEWABI) { @@ -10592,9 +10655,13 @@ struct option md_longopts[] = #define OPTION_NO_FIX_VR4130 (OPTION_FIX_BASE + 5) {"mfix-vr4130", no_argument, NULL, OPTION_FIX_VR4130}, {"mno-fix-vr4130", no_argument, NULL, OPTION_NO_FIX_VR4130}, +#define OPTION_FIX_LOONGSON2F_BTB (OPTION_FIX_BASE + 6) +#define OPTION_NO_FIX_LOONGSON2F_BTB (OPTION_FIX_BASE + 7) + {"mfix-loongson2f-btb", no_argument, NULL, OPTION_FIX_LOONGSON2F_BTB}, + {"mno-fix-loongson2f-btb", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_BTB}, /* Miscellaneous options. */ -#define OPTION_MISC_BASE (OPTION_FIX_BASE + 6) +#define OPTION_MISC_BASE (OPTION_FIX_BASE + 8) #define OPTION_TRAP (OPTION_MISC_BASE + 0) {"trap", no_argument, NULL, OPTION_TRAP}, {"no-break", no_argument, NULL, OPTION_TRAP}, @@ -10863,6 +10930,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_RELAX_BRANCH: mips_relax_branch = 1; break; @@ -14515,6 +14590,7 @@ MIPS options:\n\ fprintf (stream, _("\ -mfix-vr4120 work around certain VR4120 errata\n\ -mfix-vr4130 work around VR4130 mflo/mfhi errata\n\ +-mfix-loongson2f-btb work around Loongson2F BTB errata\n\ -mgp32 use 32-bit GPRs, regardless of the chosen ISA\n\ -mfp32 use 32-bit FPRs, regardless of the chosen ISA\n\ -mno-shared optimize output for executables\n\ diff --git a/gnu/usr.bin/binutils-2.17/gas/config/tc-sh.h b/gnu/usr.bin/binutils-2.17/gas/config/tc-sh.h index a812036fcd5..a83b8be7bf2 100644 --- a/gnu/usr.bin/binutils-2.17/gas/config/tc-sh.h +++ b/gnu/usr.bin/binutils-2.17/gas/config/tc-sh.h @@ -147,6 +147,8 @@ extern int target_big_endian; #define TARGET_FORMAT (!target_big_endian ? "elf32-sh-linux" : "elf32-shbig-linux") #elif defined(TE_NetBSD) #define TARGET_FORMAT (!target_big_endian ? "elf32-shl-nbsd" : "elf32-sh-nbsd") +#elif defined(TE_OpenBSD) +#define TARGET_FORMAT (!target_big_endian ? "elf32-shl-obsd" : "elf32-sh-obsd") #elif defined TARGET_SYMBIAN #define TARGET_FORMAT (!target_big_endian ? "elf32-shl-symbian" : "elf32-sh-symbian") #else diff --git a/gnu/usr.bin/binutils-2.17/gas/config/tc-sparc.c b/gnu/usr.bin/binutils-2.17/gas/config/tc-sparc.c index 10a1411b526..98381de3e31 100644 --- a/gnu/usr.bin/binutils-2.17/gas/config/tc-sparc.c +++ b/gnu/usr.bin/binutils-2.17/gas/config/tc-sparc.c @@ -306,7 +306,7 @@ sparc_target_format () init_default_arch (); #ifdef OBJ_AOUT -#ifdef TE_NetBSD +#if defined(TE_NetBSD) || defined(TE_OpenBSD) return "a.out-sparc-netbsd"; #else #ifdef TE_SPARCAOUT @@ -2197,12 +2197,14 @@ sparc_ip (str, pinsn) { if (SPARC_OPCODE_ARCH_V9_P (max_architecture)) { +#if !defined(TE_OpenBSD) if (*args == 'e' || *args == 'f' || *args == 'g') { error_message = _(": There are only 32 single precision f registers; [0-31]"); goto error; } +#endif v9_arg_p = 1; mask -= 31; /* wrap high bit */ } diff --git a/gnu/usr.bin/binutils-2.17/gas/config/tc-vax.h b/gnu/usr.bin/binutils-2.17/gas/config/tc-vax.h index 715d54a812f..1c46114fe28 100644 --- a/gnu/usr.bin/binutils-2.17/gas/config/tc-vax.h +++ b/gnu/usr.bin/binutils-2.17/gas/config/tc-vax.h @@ -24,7 +24,7 @@ #define TARGET_BYTES_BIG_ENDIAN 0 #ifdef OBJ_AOUT -#ifdef TE_NetBSD +#if defined(TE_NetBSD) || defined(TE_OpenBSD) #define TARGET_FORMAT "a.out-vax-netbsd" #endif #ifndef TARGET_FORMAT diff --git a/gnu/usr.bin/binutils-2.17/gas/config/te-obsd.h b/gnu/usr.bin/binutils-2.17/gas/config/te-obsd.h new file mode 100644 index 00000000000..1f3770e3120 --- /dev/null +++ b/gnu/usr.bin/binutils-2.17/gas/config/te-obsd.h @@ -0,0 +1,24 @@ +/* te-obsd.h -- OpenBSD target environment declarations. + Copyright 2003 + 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 2, 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, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#define TE_OpenBSD 1 +#define LOCAL_LABELS_FB 1 +#include "obj-format.h" diff --git a/gnu/usr.bin/binutils-2.17/gas/configure.tgt b/gnu/usr.bin/binutils-2.17/gas/configure.tgt index 696daaa128f..5b0aa4c541d 100644 --- a/gnu/usr.bin/binutils-2.17/gas/configure.tgt +++ b/gnu/usr.bin/binutils-2.17/gas/configure.tgt @@ -111,7 +111,8 @@ case ${generic_target} in arm-*-linux-*) fmt=elf em=linux ;; arm-*-uclinux*) fmt=elf em=linux ;; arm-*-netbsdelf*) fmt=elf em=nbsd ;; - arm-*-*n*bsd*) fmt=aout em=nbsd ;; + arm-*-netbsd*) fmt=aout em=nbsd ;; + arm-*-openbsd*) fmt=elf em=obsd ;; arm-*-nto*) fmt=elf ;; arm-epoc-pe | thumb-epoc-pe) fmt=coff em=epoc-pe ;; arm-wince-pe | arm-*-wince) fmt=coff em=wince-pe ;; @@ -144,7 +145,11 @@ case ${generic_target} in hppa-*-*elf*) fmt=elf em=hppa ;; hppa-*-lites*) fmt=elf em=hppa ;; hppa-*-netbsd*) fmt=elf em=nbsd ;; - hppa-*-openbsd*) fmt=elf em=hppa ;; + hppa-*-openbsd*) + case ${cpu} in + hppa*64*) fmt=elf em=obsdhppa64 ;; + hppa*) fmt=elf em=obsd ;; + esac ;; hppa-*-osf*) fmt=som em=hppa ;; hppa-*-hpux11*) case ${cpu} in @@ -179,8 +184,8 @@ case ${generic_target} in *) fmt=aout em=nbsd ;; esac ;; i386-*-openbsd[0-2].* | \ - i386-*-openbsd3.[0-2]) fmt=aout em=nbsd ;; - i386-*-openbsd*) fmt=elf em=nbsd ;; + i386-*-openbsd3.[0-2]) fmt=aout em=obsd ;; + i386-*-openbsd*) fmt=elf em=obsd ;; i386-*-linux*aout*) fmt=aout em=linux ;; i386-*-linux*oldld) fmt=aout em=linux ;; i386-*-linux*coff*) fmt=coff em=linux ;; @@ -245,7 +250,7 @@ case ${generic_target} in m68k-*-gnu*) fmt=elf ;; m68k-*-netbsdelf*) fmt=elf em=nbsd ;; m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;; - m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;; + m68k-*-openbsd*) fmt=aout em=obsd bfd_gas=yes ;; m68k-*-psos*) fmt=elf em=psos;; maxq-*-coff) fmt=coff bfd_gas=yes ;; @@ -301,7 +306,8 @@ case ${generic_target} in ppc-*-aix5.*) fmt=coff em=aix5 ;; ppc-*-aix*) fmt=coff ;; ppc-*-beos*) fmt=coff ;; - ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;; + ppc-*-netbsd* | ppc-*-elf*) fmt=elf ;; + ppc-*-openbsd*) fmt=elf em=obsd ;; ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;; ppc-*-linux-*) fmt=elf em=linux ;; ppc-*-solaris*) fmt=elf ;; @@ -322,6 +328,7 @@ case ${generic_target} in sh5*-*-netbsd*) fmt=elf em=nbsd ;; sh64*-*-netbsd*) fmt=elf em=nbsd ;; sh*-*-netbsdelf*) fmt=elf em=nbsd ;; + sh*-*-openbsd*) fmt=elf em=obsd endian=little ;; sh*-*-symbianelf*) fmt=elf endian=little ;; sh-*-elf*) fmt=elf ;; sh-*-coff*) fmt=coff ;; @@ -352,10 +359,10 @@ case ${generic_target} in sparc-*-openbsd[0-2].* | \ sparc-*-openbsd3.[0-1]) case ${cpu} in - sparc64) fmt=elf em=nbsd ;; - *) fmt=aout em=nbsd ;; + sparc64) fmt=elf em=obsd ;; + *) fmt=aout em=obsd ;; esac ;; - sparc-*-openbsd*) fmt=elf em=nbsd ;; + sparc-*-openbsd*) fmt=elf em=obsd ;; tic30-*-*aout*) fmt=aout bfd_gas=yes ;; tic30-*-*coff*) fmt=coff bfd_gas=yes ;; diff --git a/gnu/usr.bin/binutils-2.17/gas/doc/Makefile.in b/gnu/usr.bin/binutils-2.17/gas/doc/Makefile.in index cd9dad2baaf..2e01cc5fcd2 100644 --- a/gnu/usr.bin/binutils-2.17/gas/doc/Makefile.in +++ b/gnu/usr.bin/binutils-2.17/gas/doc/Makefile.in @@ -50,7 +50,7 @@ CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = SOURCES = -INFO_DEPS = $(srcdir)/as.info +INFO_DEPS = as.info TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo DVIS = as.dvi @@ -303,7 +303,7 @@ distclean-libtool: .texinfo.info: restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - am__cwd=`pwd` && cd $(srcdir) && \ + am__cwd=`pwd` && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ @@ -315,10 +315,8 @@ distclean-libtool: -o $@ $<; \ then \ rc=0; \ - cd $(srcdir); \ else \ rc=$$?; \ - cd $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc @@ -346,7 +344,7 @@ distclean-libtool: rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ exit 1; \ fi -$(srcdir)/as.info: as.texinfo +as.info: as.texinfo as.dvi: as.texinfo as.pdf: as.texinfo as.html: as.texinfo @@ -405,49 +403,8 @@ maintainer-clean-aminfo: clean-info: mostlyclean-aminfo install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ - done uninstall-man1: @$(NORMAL_UNINSTALL) - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ - done tags: TAGS TAGS: diff --git a/gnu/usr.bin/binutils-2.17/gas/doc/c-mips.texi b/gnu/usr.bin/binutils-2.17/gas/doc/c-mips.texi index 3c70ff29bc0..b3665634460 100644 --- a/gnu/usr.bin/binutils-2.17/gas/doc/c-mips.texi +++ b/gnu/usr.bin/binutils-2.17/gas/doc/c-mips.texi @@ -145,6 +145,14 @@ all problems in hand-written assembler code. @itemx -no-mfix-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 2E and 2F +will yield unpredictable results. + @item -m4010 @itemx -no-m4010 Generate code for the LSI @sc{r4010} chip. This tells the assembler to diff --git a/gnu/usr.bin/binutils-2.17/gas/read.c b/gnu/usr.bin/binutils-2.17/gas/read.c index 0485d72dec6..6972f79add2 100644 --- a/gnu/usr.bin/binutils-2.17/gas/read.c +++ b/gnu/usr.bin/binutils-2.17/gas/read.c @@ -4823,7 +4823,7 @@ next_char_of_string (void) int i; for (i = 0, number = 0; - ISDIGIT (c) && i < 3; + i < 3 && ISDIGIT (c); c = *input_line_pointer++, i++) { number = number * 8 + c - '0'; |