Commit Graph

5578 Commits

Author SHA1 Message Date
Renlin Li bb383c6cf1 [AARCH64]Fix "align directive causes MAP_DATA symbol to be lost"
gas/ChangeLog:

2015-03-25  Renlin Li  <renlin.li@arm.com>

  * config/tc-aarch64.c (mapping_state): Remove first MAP_DATA emitting code.
  (mapping_state_2): Emit first MAP_DATA symbol here.
2015-03-25 12:33:07 +00:00
H.J. Lu b422eb499b Don't write the zlib header if not used
No need to write the zlib header if compression didn't make the section
smaller.

	PR gas/18087
	* write.c (compress_debug): Don't write the zlib header if
	compression didn't make the section smaller.
2015-03-24 19:06:22 -07:00
Terry Guo 823d25713d Extend arm_feature_set struct to provide more bits
gas/ChangeLog:
2015-03-24  Terry Guo  <terry.guo@arm.com>

	* config/tc-arm.c (no_cpu_selected): Use new macro to compare
	features.
	(parse_psr): Likewise.
	(do_t_mrs): Likewise.
	(do_t_msr): Likewise.
	(static const arm_feature_set arm_ext_*): Defined with new
	macros.
	(static const arm_feature_set arm_cext_*): Likewise.
	(static const arm_feature_set fpu_fpa_ext_*): Likewise.
	(static const arm_feature_set fpu_vfp_ext_*): Likewise.
	(deprecated_coproc_regs): Likewise.
	(UL_BARRIER): Likewise.
	(barrier_opt_names): Likewise.
	(arm_cpus): Likewise.
	(arm_extensions): Likewise.

include/opcode/ChangeLog:
2015-03-24  Terry Guo  <terry.guo@arm.com>

	* arm.h (arm_feature_set): Extended to provide more available
	* bits.
	(ARM_ANY): Updated to follow above new definition.
	(ARM_CPU_HAS_FEATURE): Likewise.
	(ARM_CPU_IS_ANY): Likewise.
	(ARM_MERGE_FEATURE_SETS): Likewise.
	(ARM_CLEAR_FEATURE): Likewise.
	(ARM_FEATURE): Likewise.
	(ARM_FEATURE_COPY): New macro.
	(ARM_FEATURE_EQUAL): Likewise.
	(ARM_FEATURE_ZERO): Likewise.
	(ARM_FEATURE_CORE_EQUAL): Likewise.
	(ARM_FEATURE_LOW): Likewise.
	(ARM_FEATURE_CORE_LOW): Likewise.
	(ARM_FEATURE_CORE_COPROC): Likewise.

opcodes/ChangeLog:
2015-03-24  Terry Guo  <terry.guo@arm.com>

	* arm-dis.c (opcode32): Updated to use new arm feature struct.
	(opcode16): Likewise.
	(coprocessor_opcodes): Replace bit with feature struct.
	(neon_opcodes): Likewise.
	(arm_opcodes): Likewise.
	(thumb_opcodes): Likewise.
	(thumb32_opcodes): Likewise.
	(print_insn_coprocessor): Likewise.
	(print_insn_arm): Likewise.
	(select_arm_features): Follow new feature struct.
2015-03-24 14:08:08 +08:00
H.J. Lu 80b8656cba Limit multi-byte nop instructions to 10 bytes
There is no performance advantage to use multi-byte nop instructions
greater than 10 bytes.  This patch limits multi-byte nop instructions
to 10 bytes.  Since there is only one way to encode multi-byte nop
instructions now, it also removed redundant nop tests.

gas/

	* config/tc-i386.c (i386_align_code): Limit multi-byte nop
	instructions to 10 bytes.

gas/testsuite/

	* gas/i386/i386.exp: Don't run nops-1-bdver1, nops-1-bdver2,
	nops-1-bdver3, nops-1-bdver4, nops-1-znver1, nops-1-btver1
	nops-1-btver2, x86-64-nops-1-nocona, x86-64-nops-1-bdver1,
	x86-64-nops-1-bdver2, x86-64-nops-1-bdver3, x86-64-nops-1-bdver4,
	x86-64-nops-1-znver1, x86-64-nops-1-btver1 nor
	x86-64-nops-1-btver2.
	* gas/i386/nops-1-core2.d: Updated.
	* gas/i386/nops-1-k8.d: Likewise.
	* gas/i386/nops-4a-i686.d: Likewise.
	* gas/i386/nops-5-i686.d: Likewise.
	* gas/i386/nops-5.d: Likewise.
	* gas/i386/nops-6.d: Likewise.
	* gas/i386/x86-64-nops-1-core2.d: Likewise.
	* gas/i386/x86-64-nops-1-g64.d: Likewise.
	* gas/i386/x86-64-nops-1-k8.d: Likewise.
	* gas/i386/x86-64-nops-1.d: Likewise.
	* gas/i386/x86-64-nops-2.d: Likewise.
	* gas/i386/x86-64-nops-3.d: Likewise.
	* gas/i386/x86-64-nops-4-core2.d: Likewise.
	* gas/i386/x86-64-nops-4-k8.d: Likewise.
	* gas/i386/x86-64-nops-4.d: Likewise.
	* gas/i386/x86-64-nops-5-k8.d: Likewise.
	* gas/i386/x86-64-nops-5.d: Likewise.
	* gas/i386/ilp32/x86-64-nops-1-core2.d: Likewise.
	* gas/i386/ilp32/x86-64-nops-1-k8.d: Likewise.
	* gas/i386/ilp32/x86-64-nops-1.d: Likewise.
	* gas/i386/ilp32/x86-64-nops-2.d: Likewise.
	* gas/i386/ilp32/x86-64-nops-3.d: Likewise.
	* gas/i386/ilp32/x86-64-nops-4-core2.d: Likewise.
	* gas/i386/ilp32/x86-64-nops-4-k8.d: Likewise.
	* gas/i386/ilp32/x86-64-nops-4.d: Likewise.
	* gas/i386/ilp32/x86-64-nops-5-k8.d: Likewise.
	* gas/i386/ilp32/x86-64-nops-5.d: Likewise.
	* gas/i386/nops-1-bdver1.d: Removed.
	* gas/i386/nops-1-bdver2.d: Likewise.
	* gas/i386/nops-1-bdver3.d: Likewise.
	* gas/i386/nops-1-bdver4.d: Likewise.
	* gas/i386/nops-1-btver1.d: Likewise.
	* gas/i386/nops-1-btver2.d: Likewise.
	* gas/i386/nops-1-znver1.d: Likewise.
	* gas/i386/x86-64-nops-1-bdver1.d: Likewise.
	* gas/i386/x86-64-nops-1-bdver2.d: Likewise.
	* gas/i386/x86-64-nops-1-bdver3.d: Likewise.
	* gas/i386/x86-64-nops-1-bdver4.d: Likewise.
	* gas/i386/x86-64-nops-1-btver1.d: Likewise.
	* gas/i386/x86-64-nops-1-btver2.d: Likewise.
	* gas/i386/x86-64-nops-1-nocona.d: Likewise.
	* gas/i386/x86-64-nops-1-znver1.d: Likewise.
	* gas/i386/ilp32/x86-64-nops-1-nocona.d: Likewise.
2015-03-20 04:49:39 -07:00
Nick Clifton 1740ba0cec Add support for G13 and G14 flag bits in RL78 ELF binaries.
inc	* rl78.h (E_FLAG_RL78_G10): Redefine.
	(E_FLAG_RL78_CPU_MASK, E_FLAG_RL78_ANY_CPU, E_FLAG_RL78_G13
	E_FLAG_RL78_G14): New flags.

bin	* readelf.c (get_machine_flags): Decode RL78's G13 and G14 flags.

gas	* config/tc-rl78.c (enum options): Add G13 and G14.
	(md_longopts): Add -mg13 and -mg14.
	(md_parse_option): Handle -mg13 and -mg14.
	(md_show_usage): List -mg13 and -mg14.
	* doc/c-rl78.texi: Add description of -mg13 and -mg14 options.

bfd	* elf32-rl78.c (rl78_cpu_name): New function.  Prints the name of
	the RL78 core based upon the flags.
	(rl78_elf_merge_private_bfd_data): Handle merging of G13 and G14
	flags.
	(rl78_elf_print_private_bfd_data): Use rl78_cpu_name.
	(elf32_rl78_machine): Always return bfd_mach_rl78.
2015-03-19 15:37:43 +00:00
Jon Turney 273a49858f Fix debug section compression so that it is only performed if it would make the section smaller.
PR binutils/18087
gas	* doc/as.texinfo: Note that when gas compresses debug sections the
	compression is only performed if it makes the section smaller.
	* write.c (compress_debug): Do not compress a debug section if
	doing so would make it larger.

tests	* gas/i386/dw2-compress-1.d: Do not expect the .debug_abbrev or
	.debug_info sections to be compressed.

binu	* doc/binutils.texi: Note that when objcopy compresses debug
	sections the compression is only performed if it makes the section
	smaller.

bfd	* coffgen.c (make_a_section_from_file): Only prepend a z to a
	debug section's name if the section was actually compressed.
	* elf.c (_bfd_elf_make_section_from_shdr): Likewise.
	* compress.c (bfd_init_section_compress_status): Do not compress
	the section if doing so would make it bigger.  In such cases leave
	the section alone and return COMPRESS_SECTION_NONE.
2015-03-18 15:47:13 +00:00
Ganesh Gopalasubramanian 029f352261 Add znver1 processor 2015-03-17 21:49:15 +05:30
Nick Clifton b57dc16f06 Removes a #if 1 ... #endif accidentally left in the source code.
* dwarf2dbg.c (out_header): Remove spurious #if 1.
2015-03-16 11:17:52 +00:00
Jiong Wang 4bf8c6e898 [AArch64] Don't warn on XZR/SP overlapping when it's in load/store
2015-03-13  Jiong Wang  <jiong.wang@arm.com>

gas/
   * config/tc-aarch64.c (warn_unpredictable_ldst): Don't warn on reg number 31.

gas/testsuite/
  * gas/aarch64/diagnostic.s: New testcases.
  * gas/aarch64/diagnostic.l: New error match.
2015-03-13 12:02:23 +00:00
Jiong Wang bc9706f823 [AArch64] Don't tail-pads sections to the alignment
2015-03-13  Jiong Wang  <jiong.wang@arm.com>

gas/
  * config/tc-aarch64.h (SUB_SEGMENT_ALIGN): Define to be zero.

gas/testsuite/
  * gas/aarch64/tail_padding.s: New testcase.
  * gas/aarch64/tail_padding.d: New expectation file.
2015-03-13 12:00:37 +00:00
Andrew Bennett 7ef0d2976a Add i6400 entry to the MIPS CPU table.
gas/

	* config/tc-mips.c (mips_cpu_info_table): Add i6400 entry.
	* doc/c-mips.texi: Document i6400 -march option.
2015-03-12 16:37:09 +00:00
Nick Clifton 93ef582deb Fixes a problem generating relocs for thumb function calls to local symbols defined in other sections.
PR gas/17444
	* config/tc-arm.h (MD_APPLY_SYM_VALUE): Pass the current segment
	to arm_apply_sym_value.  Update prototype.
	* config/tc-arm.c (arm_apply_sym_value): Add segment argument.
	Do not apply the value if the symbol is in a different segment to
	the current segment.
2015-03-12 15:58:37 +00:00
Alan Modra f728387b9a Fix powerpc gas abort on invalid instruction fixups
* config/tc-ppc.c (md_assemble): Don't abort on 8 byte insn fixups.
	(md_apply_fix): Report an error on data-only fixups used with insns.
2015-03-11 18:15:31 +10:30
Andreas Krebbel c683726541 S/390: Add check for length field operand
gas/
2015-03-10  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gas/config/tc-s390.c (md_gather_operands): Check for valid
	length field operands.
2015-03-10 12:49:34 +01:00
Michael Perkins 5e0d7f77b2 Fixes a bug in the ARM port of GAS when parsing inverted register lists.
* config/tc-arm.c (parse_operands): Fix bug setting writeback
	values for '^' on OP_REGLSTs.
	(do_push_pop): Add new writeback constraint.
2015-03-10 11:47:46 +00:00
Sterling Augustine 4e9aaefbd0 [ARM]Fix "align directive causes MAP_DATA symbol to be lost"
gas/
2015-03-10  Renlin Li  <renlin.li@arm.com>

	* config/tc-arm.c (mapping_state): Remove first MAP_DATA emitting code.
	(mapping_state_2): Emit first MAP_DATA symbol here.

gas/testsuite/
2015-03-05  Renlin Li  <renlin.li@arm.com>

	* gas/arm/dis-data.d: Adjust the desired output.
	* gas/arm/dis-data2.d: Ditto.
2015-03-10 11:34:50 +00:00
Jiong Wang a578ef7ed4 [AArch64] Set the minimum alignment on code segments
gas/
2015-03-10  Matthew Wahab  <matthew.wahab@arm.com>

	* config/tc-aarch64.c (mapping_state): Set minimum alignment for
	code sections.

gas/testsuite
2015-03-10  Matthew Wahab  <matthew.wahab@arm.com>

	* gas/aarch64/codealign.d: Add test for code section alignment.
	* gas/aarch64/codealign.s: New file.
2015-03-10 11:22:15 +00:00
Nick Clifton 73f43896e3 Fixes a bug building the ARM Linux kernel with a toolchain compiled with CPU_DEFAULT set.
PR gas/17852
	* config/tc-arm.c (md_begin): Ensure that selected_cpu is
	initialised when CPU_DEFAULT is defined.
2015-03-10 10:01:45 +00:00
Nick Clifton a26de52c63 Fixes a thinko in the implementation of the V850 -m8byte-align and -m4byte-align command line options.
* config/tc-v850.c (md_parse_option): Fix code to set or clear
	EF_RH850_DATA_ALIGN8 bit in ELF header, based upon the use of the
	-m8byte-align and -m4byte-align command line options.
2015-03-05 13:04:33 +00:00
Richard Sandiford e09ab7ac78 Allow MOVK for R_AARCH64_TLSLE_MOVW_TPREL_G{0,1}NC
bfd/
	PR gas/17843
	* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Expect
	R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
	to be used with MOVK rather than MOVZ.

gas/
	PR gas/17843
	* config/tc-aarch64.c (process_movw_reloc_info): Allow
	R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
	for MOVK.

gas/testsuite/
	PR gas/17843
	* gas/aarch64/tls.s, gas/aarch64/tls.d: Add test for
	R_AARCH64_TLSLE_MOVW_TPREL_G0/R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
	sequence.

ld/testsuite/
	PR gas/17843
	* ld-aarch64/tlsle.s, ld-aarch64/tlsle.d: New test.
	* ld-aarch64/aarch64-elf.exp: Run it.
2015-03-04 09:09:05 +00:00
Alan Modra 9028d9432c Pad only text sections at end by default
gas/
	* write.c (SUB_SEGMENT_ALIGN): Don't pad non-code sections at
	end to their alignment.
gas/testsuite/
	* gas/sparc/pcrel.d: Update for changed padding in data sections.
	* gas/sparc/pcrel64.d: Likewise.
ld/testsuite/
	* ld-sparc/gotop32.rd: Update for changed padding in data sections.
	* ld-sparc/gotop32.td: Likewise.
	* ld-sparc/gotop64.rd: Likewise.
	* ld-sparc/gotop64.td: Likewise.
	* ld-tilegx/external.s: Align .data.
	* ld-tilepro/external.s: Likewise.
2015-02-28 22:26:56 +10:30
Marcus Shawcroft 389b8029b6 [AArch64] Add support for :tlsdesc: and TLSDESC_ADR_PREL21 2015-02-26 22:59:16 +00:00
Marcus Shawcroft 3c12b05436 Add ADR :tlsgd: directive and TLSGD_ADR_PREL21 support. 2015-02-26 22:23:09 +00:00
Marcus Shawcroft 043bf05a3d Adding support for TLSIE_LD_GOTTREL_PREL19. 2015-02-26 22:23:09 +00:00
Marcus Shawcroft 74ad790c76 Adding ld_literal_type.
Extend the address modifier parsing to distinguish between the
modifers used in LDR literal and LDR register offset address modes.

The current parser incorrectly accepts the :got: modifier on a
register offset instruction resulting in silent corruption of the
output binary.
2015-02-26 22:23:09 +00:00
Marcus Shawcroft 6f4a313ba4 Adding adr_type and prevent adr :got:
The current implementation of the :got: assembler modifier does not
distinguish the ADR and ADRP instruction.  The :got: modifier does not
make sense on and ADR instruction and should be error'd rather than
the current behavior of applying an inappropriate relocation to the
output and scrambling the underlying instruction silently.
2015-02-26 22:23:09 +00:00
Marcus Shawcroft 1db365dcdf Remove dead code. 2015-02-26 22:23:08 +00:00
Andrew Burgess fdd410ac7a avr/gas: Write out data to track .org/.align usage.
Adds support to the assembler to write out data for tracking the use of
.org and .align directives.  This data is collected within the assembler
and written out to a section ".avr.prop" (if there's anything to write
out).

This patch does not add any tests.  The next patch in this series will
add a better mechanism for visualising the contents of .avr.prop which
will make writing tests much easier.

This patch also does not make any use of this collected data, that will
also come along in a later patch; the intended consumer is the linker,
during linker relaxation this information will be used to ensure that
the .org and .align directives are honoured.

bfd/ChangeLog:

	* elf32-avr.h (AVR_PROPERTY_RECORD_SECTION_NAME): Define.
	(AVR_PROPERTY_RECORDS_VERSION): Define.
	(AVR_PROPERTY_SECTION_HEADER_SIZE): Define.
	(struct avr_property_record): New structure.

gas/ChangeLog:

	* config/tc-avr.c: Add elf32-avr.h include.
	(struct avr_property_record_link): New structure.
	(avr_output_property_section_header): New function.
	(avr_record_size): New function.
	(avr_output_property_record): New function.
	(avr_create_property_section): New function.
	(avr_handle_align): New function.
	(exclude_section_from_property_tables): New function.
	(create_record_for_frag): New function.
	(append_records_for_section): New function.
	(avr_create_and_fill_property_section): New function.
	(avr_post_relax_hook): New function.
	* config/tc-avr.h (md_post_relax_hook): Define.
	(avr_post_relax_hook): Declare.
	(HANDLE_ALIGN): Define.
	(avr_handle_align): Declare.
	(strut avr_frag_data): New structure.
	(TC_FRAG_TYPE): Define.
2015-02-25 23:15:02 +00:00
Kyrylo Tkachov 4469186b99 [gas][ARM] Document supported ARMv8 cores.
2015-02-25  Matthew Wahab  <matthew.wahab@arm.com>

	* doc/c-arm.texi (-mcpu=): Add cortex-a53, cortex-a57 and
	cortex-a72.
2015-02-25 13:40:08 +00:00
Nick Clifton 685080f210 Adds support for generating notes in V850 binaries.
bfd	* elf32-v850.c (v850_set_note): New function.  Creates a Renesas
	style note entry.
	(v850_elf_make_note_section): New function.  Creates a note
	section.
	(v850_elf_create_sections): New function.  Create a note section
	if one is not already present.
	(v850_elf_set_note): New function.  Adds a note to a bfd.
	(v850_elf_copy_private_bfd_data): New function.  Copies V850
	notes.
	(v850_elf_merge_notes): New function.  Merges V850 notes.
	(print_v850_note): New function.  Displays a V850 note.
	(v850_elf_print_notes): New function. Displays all notes attached
	to a bfd.
	(v850_elf_merge_private_bfd_data): Call v850_elf_merge_notes.
	(v850_elf_print_private_bfd_data): Call v850_elf_print_notes.
	(v850_elf_fake_sections): Set the type of the V850 note section.
	* bfd-in.h (v850_elf_create_sections): Add prototype.
	(v850_elf_set_note): Add prototype.
	* bfd-in2.h: Regenerate.

binutils* readelf.c (get_machine_flags): Remove deprecated V850 machine
	flags.
	(get_v850_section_type_name): New function.  Handles V850 special
	sections.
	(get_section_type_name): Add support for V850.
	(get_v850_elf_note_type): New function.  Returns the name of a
	V850 note.
	(print_v850_note): New function.  Prints a V850 note.
	(process_v850_notes): New function.  Prints V850 notes.
	(process_note_sections): Add support for V850.

binutils/testsute
	* binutils-all/objcopy.exp: Skip the strip-10 test for the V850.

gas	* config/tc-v850.c (soft_float): New variable.
	(v850_data_8): New variable.
	(md_show_usage): Add -msoft-float/-mhard-float.
	(md_parse_option): Likewise.
	(md_begin): Set the default value of soft_float.
	(v850_md_end): New function.  Creates a note section.
	* config/tc-v850.h (md_end): Define.
	* doc/c-v850.texi: Document -msoft-float/-mhard-float.

gas/testsuite
	* gas/elf/elf.exp: Add special version of the section2 test for
	the V850.
	* gas/elf/section2.e-v850: New file.

include/elf
	* v850.h (EF_RH850_SIMD): Delete deprecated flag.
	(EF_RH850_CACHE): Likewise.
	(EF_RH850_MMU): Likewise.
	(EF_RH850_DATA_ALIGN8): Likewise.
	(SHT_RENESAS_IOP): Fix typo in name.
	(SHT_RENESAS_INFO): Define.
	(V850_NOTE_SECNAME): Define.
	(SIZEOF_V850_NOTE): Define.
	(V850_NOTE_NAME): Define.
	(enum v850_notes): New enum.
	(NUM_V850_NOTES): Define.

ld/ChangeLog
2015-02-24  Nick Clifton  <nickc@redhat.com>

	* Makefile.am (ev850.c): Add dependency upon
	$(srcdir)/emultempl/v850elf.em.
	(ev850_rh850.c): Likewise.
	* Makefile.in: Regenerate.
	* emultempl/v850elf.em: New file.
	* emulparams/v850.sh (EXTRA_EM_FILE): Define.
	* emulparams/v850_rh850.sh (EXTRA_EM_FILE): Define.
	* scripttempl/v850.sc: Add .note.renesas section.
	* scripttempl/v850_rh850.sc: Likewise.

ld/testsuite
	* ld-elf/extract-symbol-1sec.d: Expect to fail on the V850.
2015-02-24 17:54:09 +00:00
Yoshinori Sato 5518c738a4 Add support for the h8300-linux target.
ld	* Makefile.am: (ALL_EMULATION_SOURCES): Add new emulations.
	* Makefile.in: Regenerate.
	* configure.tgt: Add h8300-*-linux
	* emulparams/h8300elf_linux.sh: Add new emulation.
	* emulparams/h8300helf_linux.sh: Likewise.
	* emulparams/h8300self_linux.sh: Likewise.
	* emulparams/h8300sxelf_linux.sh: Likewise.

bfd	* config.bfd: Add h8300-*-linux.
	* configure.ac: Add h8300_elf32_linux_vec.
	* configure: Regenerate.
	* elf32-h8300.c: Likewise.
	* targets.c(_bfd_target_vector): Likewise.

gas	* config/tc-h8300.c (line_separater_chars): Add a version for
	h8300-linux that includes a separator.
	(default_mach): New variable.
	(md_main): Use it.
	(md_longopts): Add '--march' option.
	(md_parse_option): Parse the new option.
	* config/tc-h8300.h (TARGET_FORMAT): Add elf32-h8300-linux.
	* configure.tgt: Add h8300-*-linux
	* doc/c-h8300.texi: Document --march.
2015-02-23 17:04:53 +00:00
Nick Clifton 0f8f0c57ea Fixes the generation of dwarf line debug information for the msp430, even in the presence of function sections and linker garbage collection.
PR 17940
	* dwarf2dbg.c (out_header): When generating dwarf sections use
	real symbols not temps for the start and end symbols.
	* config/tc-msp430.h (TC_FORCE_RELOCATION_SUB_SAME): Also prevent
	adjustments to relocations in debug sections.
	(TC_LINKRELAX_FIXUP): Likewise.

	* elf32-msp430.c (msp430_elf_relax_delete_bytes): Adjust debug
	symbols at end of sections.  Adjust function sizes.
2015-02-23 14:53:02 +00:00
Alan Modra 5c9352f317 gas doc warning fixes
* doc/as.texinfo (Local Symbol Names): Don't use ':' in pxref.
	* doc/c-i386.texi: Reorder i386-Bugs after i386-Arch.
2015-02-19 14:14:51 +10:30
Jiong Wang aa31c464df [AArch64] Fix code formatting in the cpu-table
2015-02-11  Matthew Wahab  <matthew.wahab@arm.com>

	* config/tc-aarch64.c (aarch64_cpus): Fix code formatting.
2015-02-11 14:35:27 +00:00
Jiong Wang b19f47add0 [ARM] Add support for Cortex-A72
2015-02-11  Matthew Wahab  <matthew.wahab@arm.com>

	* config/tc-arm.c: Add support for Cortex-A72.
2015-02-11 10:54:50 +00:00
Kyrylo Tkachov 5c3696f89f [ARM][gas] Use as_tsktsk instead of as_warn for deprecation messages.
* config/tc-arm.c (warn_deprecated_sp): Use as_tsktsk instead
	of as_warn for deprecation messages.
	(encode_arm_addr_mode_2): Likewise.
	(check_obsolete): Likewise.
	(do_rd_rm_rn): Likewise.
	(do_co_reg): Likewise.
	(do_setend): Likewise.
	(do_t_mov_cmp): Likewise.
	(do_neon_ldr_str): Likewise.
	(opcode_lookup): Likewise.
	(if_fsm_post_encode): Likewise.
	(md_assemble): Likewise.

	* gas/arm/armv1.l: Remove 'Warning: ' from expected messages
	for deprecations.
	* gas/arm/armv8-a-bad.l: Likewise.
	* gas/arm/armv8-a-it-bad.l: Likewise.
	* gas/arm/depr-swp.l: Likewise.
	* gas/arm/ldsgeb.l: Likewise.
	* gas/arm/ldsgeh.l: Likewise.
	* gas/arm/thumb2_bad_reg.l: Likewise.
	* gas/arm/thumb32.l: Likewise.
	* gas/arm/udf.l: Likewise.
	* gas/arm/vstr-arm-bad.l: Likewise.
2015-02-09 11:20:30 +00:00
Jan Beulich 73e7610887 gas: fix a few omissions in .cfi_label handling
While actually starting to use that new directive, I noticed a few
oversights of the original commit.

gas/
2015-02-06  Jan Beulich  <jbeulich@suse.com>

	* dw2gencfi.c (select_cie_for_fde): Also bail on CFI_label.
	(cfi_change_reg_numbers): Also do nothing for CFI_label.
	(cfi_pseudo_table): Also handle .cfi_label when not supporting
	CFI directives.
2015-02-06 09:11:09 +01:00
Alan Modra 64a81db054 Fix msp430 build with gcc-5
gcc-5 correctly complains "loop exit may only be reached after
undefined behavior".  I was going to correct this by checking the
index before dereferencing the array rather than the other way around,
but then I noticed it is possible for extract_cmd to write the
terminating zero one past the end of "cmd".  Fixing that means no
index check is needed in md_assemble.

	* config/tc-msp430.c (md_assemble): Correct size passed to
	extract_cmd.  Remove index check.
2015-02-05 09:44:55 +10:30
Jiong Wang 2abdd192f1 [AArch64] Add support for Cortex-A72
2015-02-04  Matthew Wahab  <matthew.wahab@arm.com>

	* config/tc-aarch64.c (aarch64_cpus): Add support for Cortex-A72.
	* doc/c-aarch64.texi (-mcpu=): Add "cortex-a72".
2015-02-04 19:17:12 +00:00
Nick Clifton 3101e6373e Fix encoding of "addw ax, [hl]" and "subw ax, [hl]".
* config/rl78-parse.y (addsubw): Fix encoding of [HL] variant of
	these instructions.
2015-02-04 12:00:58 +00:00
Jiong Wang 8e02d7f520 [AARCH64] Document .arch and .arch_extension directive
2015-02-03  Renlin Li  <renlin.li@arm.com>

  gas/
    * doc/c-aarch64.texi (.arch): Document the directive.
    (.arch_extension): Likewise.
2015-02-03 14:02:24 +00:00
Nick Clifton 6d012254d4 Fix use of uninitialised memory by the RL78 port of GAS.
* config/tc-rl78.h (TC_PARSE_CONS_EXPRESSION): Define.
2015-02-03 10:10:51 +00:00
Alan Modra 3f8107ab38 FT32 initial support
FT32 is a new 32-bit RISC core developed by FTDI for embedded applications.

	* configure.ac: Add FT32 support.
	* configure: Regenerate.
bfd/
	* Makefile.am: Add FT32 files.
	* archures.c (enum bfd_architecture): Add bfd_arch_ft32.
	(bfd_mach_ft32): Define.
	(bfd_ft32_arch): Declare.
	(bfd_archures_list): Add bfd_ft32_arch.
	* config.bfd: Handle FT32.
	* configure.ac: Likewise.
	* cpu-ft32.c: New file.
	* elf32-ft32.c: New file.
	* reloc.c (BFD_RELOC_FT32_10, BFD_RELOC_FT32_20, BFD_RELOC_FT32_17,
	BFD_RELOC_FT32_18): Define.
	* targets.c (_bfd_target_vector): Add ft32_elf32_vec.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* po/SRC-POTFILES.in: Regenerate.
binutils/
	* readelf.c: Add FT32 support.
gas/
	* Makefile.am: Add FT32 files.
	* config/tc-ft32.c: New file.
	* config/tc-ft32.h: New file.
	* configure.tgt: Add FT32 support.
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
gas/testsuite/
	* gas/ft32/ft32.exp: New file.
	* gas/ft32/insn.d: New file.
	* gas/ft32/insn.s: New file.
include/
	* dis-asm.h (print_insn_ft32): Declare.
include/elf/
	* common.h (EM_FT32): Define.
	* ft32.h: New file.
include/opcode/
	* ft32.h: New file.
ld/
	* Makefile.am: Add FT32 files.
	* configure.tgt: Handle FT32 target.
	* emulparams/elf32ft32.sh: New file.
	* scripttempl/ft32.sc: New file.
	* Makefile.in: Regenerate.
opcodes/
	* Makefile.am: Add FT32 files.
	* configure.ac: Handle FT32.
	* disassemble.c (disassembler): Call print_insn_ft32.
	* ft32-dis.c: New file.
	* ft32-opc.c: New file.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* po/POTFILES.in: Regenerate.
2015-01-28 16:25:18 +10:30
Kuan-Lin Chen 20d79870f3 NDS32/gas: Limit the format of pseudo instruction la. 2015-01-27 11:19:13 +08:00
Kuan-Lin Chen 3bd3aeb461 NDS32/gas: Fix md_parse_name hook. 2015-01-27 11:08:07 +08:00
Alan Modra 740bdc67c0 Extend .reloc to accept some BFD_RELOCs
Tests that bfd_perform_reloc doesn't freak over a NONE reloc at end
of section.

gas/
	* read.c (s_reloc): Match BFD_RELOC_NONE, BFD_RELOC{8,16,32,64}.
	* write.c (get_frag_for_reloc): Allow match just past end of frag.
gas/testsuite/
	* gas/all/none.s,
	* gas/all/none.d: New test.
	* gas/all/gas.exp: Run it.
2015-01-19 19:37:46 +10:30
Andreas Krebbel 1e2e8c529c S/390: Add support for IBM z13.
- 32 128 bit vector registers (overlapping with the existing 16 64 bit
  floating point registers)
- vector double instructions
- vector integer instructions
- scalar vector instructions (allowing to have more floating point
  registers for scalar operations)
- vector string instructions

gas/ChangeLog:

	* config/tc-s390.c (struct pd_reg): Remove.
	(pre_defined_registers): Remove.
	(REG_NAME_CNT): Remove.
	(reg_name_search): Calculate the register number instead of doing
	a lookup.
	(register_name, tc_s390_regname_to_dw2regnum): Adopt to the new
	reg_name_search signature.
	(s390_parse_cpu): Support the new arch string z13.
	(s390_insert_operand): Support for vector registers with the extra
	field for the fifth bit of each vector register operand.
	(md_gather_operand): Adjust to the new handling of optional
	parameters.

	* doc/as.texinfo: Document the z13 cpu string.

gas/testsuite/ChangeLog:

	* gas/s390/esa-g5.d: Add a variant without the optional operand.
	* gas/s390/esa-g5.s: Likewise.
	* gas/s390/esa-z9-109.d: Likewise.
	* gas/s390/esa-z9-109.s: Likewise.
	* gas/s390/zarch-z9-109.d: Likewise.
	* gas/s390/zarch-z9-109.s: Likewise.
	* gas/s390/zarch-z10.d: For variants with a zero optional argument
	it is not dumped by objdump anymore.
	* gas/s390/zarch-zEC12.d: Likewise.

	* gas/s390/zarch-z13.d: New file.
	* gas/s390/zarch-z13.s: New file.
	* gas/s390/s390.exp: Run the test for the z13 files.

include/opcode/ChangeLog:

	* s390.h (s390_opcode_cpu_val): Add S390_OPCODE_Z13.

ld/testsuite/ChangeLog:

	* ld-s390/tlsbin.dd: The nopr register operand is optional and not
	printed if 0 anymore.

opcodes/ChangeLog:

	* s390-dis.c (s390_extract_operand): Support vector register
	operands.
	(s390_print_insn_with_opcode): Support new operands types and add
	new handling of optional operands.
	* s390-mkopc.c (s390_opcode_mode_val, s390_opcode_cpu_val): Remove
	and include opcode/s390.h instead.
	(struct op_struct): New field `flags'.
	(insertOpcode, insertExpandedMnemonic): New parameter `flags'.
	(dumpTable): Dump flags.
	(main): Parse flags from the s390-opc.txt file.  Add z13 as cpu
	string.
	* s390-opc.c: Add new operands types, instruction formats, and
	instruction masks.
	(s390_opformats): Add new formats for .insn.
	* s390-opc.txt: Add new instructions.
2015-01-16 12:28:58 +01:00
Jiong Wang 0900a05b4c [ARM] vcmp/vcmpe should accept #0x0 as an operand
gas/
2015-01-13  Matthew Wahab  <matthew.wahab@arm.com>

     * config/tc-arm.c (parse_ifimm_zero): Accept #0x0 as a synonym for
     #0, restoring previous behaviour.

gas/testsuite/
2015-01-13  Matthew Wahab  <matthew.wahab@arm.com>

     * gas/arm/ual-vcmp.s: Add vcmp, vcmpe with #0x0 operand.
     * gas/ual/vcmp.d: Update expected output.
     * gas/ual/vcmp-zero-bad.l: Likewise
2015-01-13 15:44:47 +00:00
Jan Beulich 696025802e gas: allow labeling of CFI instructions
When runtime patching code (like e.g. done by the Linux kernel) there
may be cases where the set of stack frame alterations differs between
unpatched and patched code. Consequently the corresponding unwind data
needs patching too. Locating the right places within an FDE, however,
is rather cumbersome without a way to insert labels in the resulting
section. Hence this patch introduces a new directive, .cfi_label. Note
that with the way CFI data gets emitted currently (at the end of the
assembly process) this can't support local FB- and dollar-labels.

gas/
2015-01-12  Jan Beulich  <jbeulich@suse.com>

	* gas/dw2gencfi.c (cfi_add_label, dot_cfi_label): New.
	(cfi_pseudo_table): Add "cfi_label".
	(output_cfi_insn): Handle CFI_label.
	(select_cie_for_fde): Als terminate CIE when encountering
	CFI_label.
	* dw2gencfi.h (cfi_add_label): Declare.
	(struct cfi_insn_data): New member "sym_name".
	(CFI_label): New.
	* read.c (read_symbol_name): Drop "static".
	* read.h (read_symbol_name): Declare.

gas/testsuite/
2015-01-12  Jan Beulich  <jbeulich@suse.com>

	gas/cfi/cfi-label.d, gas/cfi/cfi-label.s: New.
	gas/cfi/cfi.exp: Run new tests.
2015-01-12 15:24:20 +01:00
Jan Beulich cb3b1e65a9 arm: properly range check immediate operands of VSHL and VQSHL
These two, other than VQSHLU, didn't have their immediates properly range
checked so far.

(Re-sending unchanged from the original v2 due to never having got an
answer to https://sourceware.org/ml/binutils/2013-04/msg00121.html.)

gas/
2015-01-12  Jan Beulich  <jbeulich@suse.com>

	* gas/config/tc-arm.c (do_neon_shl_imm): Check immediate range.
	(do_neon_qshl_imm): Likewise.

gas/testsuite/
2015-01-12  Jan Beulich  <jbeulich@suse.com>

	* gas/arm/neon-addressing-bad.s: Add test for invalid VSHL,
	VQSHL, and VQSHLU immediates.
	* gas/arm/neon-addressing-bad.l: Update accordingly.
2015-01-12 09:05:19 +01:00
Alan Modra b38ead219b Assorted compiler warning fixes
The C standard doesn't guarantee a function pointer can be cast to
void* and vice versa.

binutils/
	* prdbg.c (print_debugging_info): Don't use void* for function
	pointer param.
	* budbg.h (print_debugging_info): Update prototype.
gas/
	* read.c (s_altmacro, s_reloc): Make definition static.
2015-01-12 18:07:52 +10:30
Andrew Burgess 491793b5cb gas/avr: Prevent incorrect overflow errors for diff fixups.
When fixups are converted to a difference type within md_apply_fix, we
previously left the contents of VALP (the value that was initially
computed within write.c:fixup_segment) unchanged.  This is harmless,
except that this value is used within write.c:fixup_segment once we
return from md_apply_fix to perform an overflow check.

In some cases, the value computed in write.c:fixup_segment is so wrong
that an overflow error can be triggered.  These errors are incorrect.

This patch avoids the overflow errors by adjusting the value in
write.c:fixup_segment using the VALP pointer in md_apply_fix.

A test for this issue is included.

gas/ChangeLog:

	* config/tc-avr.c (md_apply_fix): Update the contents of VALP for
	diff fixups.

gas/testsuite/ChangeLog:

	* gas/avr/large-debug-line-table.d: New file.
	* gas/avr/large-debug-line-table.s: New file.
2015-01-10 00:04:35 +00:00
Philipp Tomsich ea0d6bb94c This patch adds the necessary support to the assembler to allow wiring
the X-Gene scheduling description up in the respective GCC backend.

	* config/tc-arm.c (arm_cpus): Add support for APM X-Gene 1 and
	X-Gene 2.
	* doc/c-arm.texi (ARM Options): Mention xgene1 and xgene2.
2015-01-09 20:00:14 +00:00
Jan Beulich 5a70a2235a arm: fix extension feature disabling
Using e.g.

	.arch_extension simd
	.arch_extension nocrypto

so far results in SIMD support getting disabled, which I can't see being
the purpose of the "no"-prefixed variants of architecture extension
specifications.

Of course it is questionable whether the current, counter intuitive
behavior needs to be retained, and the new behavior perhaps be made work
through e.g. a newly recognized "no-" prefix.

gas/
2015-01-07  Jan Beulich <jbeulich@suse.com>

	* gas/config/tc-arm.c (struct arm_option_extension_value_table):
	Split field "value" into fields "merge_value" and "clear_value".
	(arm_extensions): Adjust initializer accordingly.
2015-01-07 09:39:27 +01:00
Alan Modra efd321f91c Correct printed year in copyright notices 2015-01-02 01:08:15 +10:30
Alan Modra b90efa5b79 ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
Anthony Green bffb60047d Limit moxie sto/ldo offsets to 16 bits 2014-12-27 10:57:51 -05:00
Yaakov Selkowitz 6fd9d738c0 Don't pass unadorned zeros to varargs functions
PR gas/17753
	* config/tc-mep.c (md_begin): Specify types of vararg literals.
2014-12-25 21:28:55 +10:30
Andrew Burgess f5be95254d AVR: Document linker relaxation related options.
Adds documentation describing the -mlink-relax and -mno-link-relax
command line options.

gas/ChangeLog:

	* doc/c-avr.texi: Document -mlink-relax and -mno-link-relax.
2014-12-24 21:28:34 +00:00
Andrew Burgess edc9e9a62f AVR: Assembler now prepares for linker relaxation by default.
Have the assembler prepare for linker relaxation by default.  This
means that users will be able to make use of linker relaxation without
having to adjust the assembler flags, this can make life easier when
compiling libraries.

Having this on by default in the assembler should make no difference to
the assembler code produced, however, some of the debug information will
be slightly less compressed.

A few tests needed to be updated as a result of this change as they
relied on linker relaxation support being off by default.

I've tightened up the definition of which sections can be relaxed on AVR
as part of this commit, the assembler used to think that all
non-debugging sections could be relaxed, when in reality only code
sections can be relaxed for AVR.  The previous definition was not
dangerous, just over cautious.  The new tighter definition allows an
extra test (gas/testsuite/gas/all/forward.d) to continue to pass.

gas/ChangeLog:

	* config/tc-avr.c (struct avr_opt_s): Change link_relax to
	no_link_relax, extend comment.
	(enum options): Add new OPTION_NO_LINK_RELAX.
	(md_longopts): Add entry for -mno-link-relax.
	(md_parse_option): Handle OPTION_NO_LINK_RELAX, and update
	OPTION_LINK_RELAX.
	(md_begin): Initialise linkrelax from no_link_relax.
	(md_show_usage): Include -mno-link-relax option.
	(relaxable_section): Only allocatable code sections can be
	relaxed.
	* config/tc-avr.h (TC_LINKRELAX_FIXUP): Define.

gas/testsuite/ChangeLog:

	* gas/all/gas.exp: Test will not pass on AVR due to linker
	relaxation support.
	* gas/avr/noreloc_withoutrelax.d: Add -mno-link-relax option.
	* gas/avr/link-relax-elf-flag-clear.d: Likewise.

ld/testsuite/ChangeLog:

	* ld/testsuite/ld-avr/relax-elf-flags-02.d: Add -mno-link-relax
	option.
	* ld/testsuite/ld-avr/relax-elf-flags-03.d: Likewise.
	* ld/testsuite/ld-avr/relax-elf-flags-04.d: Likewise.
	* ld/testsuite/ld-avr/relax-elf-flags-05.d: Likewise.
	* ld/testsuite/ld-avr/relax-elf-flags-06.d: Likewise.
2014-12-24 21:27:43 +00:00
Andrew Burgess eac7440d80 AVR: Only set link-relax elf flag when appropriate.
The AVR target uses a bit in the elf header flags to indicate if the
object was assembled ready for linker relaxation.  Previously this flag
was always set, even when the object was not assembled ready for linker
relaxation.

This patch moves setting of the flag into the assembler, and sets it
only when the assembler is preparing the file for linker relaxation.

bfd/ChangeLog:

	* elf32-avr.c (bfd_elf_avr_final_write_processing): Don't set
	EF_AVR_LINKRELAX_PREPARED unconditionally.

gas/ChangeLog:

	* config/tc-avr.c: Add include for elf/avr.h.
	(avr_elf_final_processing): New function.
	* config/tc-avr.h (elf_tc_final_processing): Define.
	(avr_elf_final_processing): Declare

gas/testsuite/ChangeLog:

	* gas/avr/link-relax-elf-flag-clear.d: New file.
	* gas/avr/link-relax-elf-flag-set.d: New file.
	* gas/avr/link-relax-elf-flag.s: New file.
2014-12-23 15:45:11 +00:00
Nick Clifton 4347085ad3 This patch add support for cpu marvell-whitney.
* gas/config/tc-arm.c (arm_cpus): Add core marvell-whitney.
2014-12-23 13:41:13 +00:00
Nick Clifton 175a3e5098 Updated translations for the gas and gprof tools.
* po/es.po: Updated Esperanto translation.
	* po/fr.po: Updated French translation.
	* po/uk.po: Updated Ukrainian translation.
2014-12-23 12:39:34 +00:00
Matthew Fortune 0866e94c87 Rework the alignment check for BFD_RELOC_MIPS_18_PCREL_S3.
gas/

	* config/tc-mips.c (md_apply_fix): Apply alignment check
	to the symbol and offset rather than *valP for
	BFD_RELOC_MIPS_18_PCREL_S3.  Also update the error message
	for BFD_RELOC_MIPS_19_PCREL_S2.

gas/testsuite/

	* gas/mips/r6-64.s: Remove .align directives from LDPC
	instructions and add further tests for LDPC.
	* gas/mips/r6-64-n32.d: remove the NOPs from LDPC expected
	output and update for new tests.
	* gas/mips/r6-64-n64.d: Likewise.
	* gas/mips/ldpc-unalign.l: New file.
	* gas/mips/ldpc-unalign.s: Likewise.
	* gas/mips/mips.exp: Run ldpc-unalign test.
2014-12-19 20:24:16 +00:00
H.J. Lu 0d2b51ad6a Mention --compress-debug-sections default in NEWS
* NEWS: Mention --compress-debug-sections is on by default for
	Linux/x86.
2014-12-14 07:23:15 -08:00
H.J. Lu 89e7505fcd Compress debug sections for Linux/x86 by default
* config/tc-i386.c (flag_compress_debug): Default to compress
	debug sections for Linux.
2014-12-14 06:41:03 -08:00
Alan Modra c322dea402 PowerPC register numbers in DWARF
This makes gas .cfi output to .debug_frame match register numbering
emitted by gcc.  md_reg_eh_frame_to_debug_frame follows the ABI,
targets not using it, notably Linux, don't.

	* config/tc-ppc.h (md_reg_eh_frame_to_debug_frame): Match current
	gcc behaviour.
	* config/te-aix.h: New file.
	* configure.tgt: Use em=aix for powerpc-aix.
2014-12-13 00:11:36 +10:30
Chen Gang 77ab336ea1 Ensure zero termination of tic4x insn buffer
* config/tc-tic4x.c (md_assemble): Ensure insn->name is zero
	terminated.  Simplify concatenation of parallel insn.
2014-12-09 17:04:45 +10:30
Eric Botcazou b6605dddac Add Visium support to gas
gas/
	* configure.tgt: Add Visium support.
	* Makefile.am (TARGET_CPU_CFILES): Move config/tc-vax.c around
	and add config/tc-visium.c.
	(TARGET_CPU_HFILES): Move config/tc-vax.h around and add
	config/tc-visium.h.
	* Makefile.in: Regenerate.
	* config/tc-visium.c: New file.
	* config/tc-visium.h: Likewise.
	* po/POTFILES.in: Regenerate.
gas/testsuite/
	* gas/elf/elf.exp: Skip ifunc-1 for Visium.
	* gas/visium/: New directory.
2014-12-06 16:42:26 +01:00
Sandra Loosemore d306ce58b4 Remove broken nios2 assembler dwim support.
2014-11-28  Sandra Loosemore  <sandra@codesourcery.com>

	include/opcode/
	* nios2.h (NIOS2_INSN_ADDI, NIOS2_INSN_ANDI): Delete.
	(NIOS2_INSN_ORI, NIOS2_INSN_XORI): Delete.
	(NIOS2_INSN_OPTARG): Renumber.

	opcodes/
	* nios2-opc.c (nios2_r1_opcodes): Remove deleted attributes
	from descriptors.

	gas/
	* config/tc-nios2.c (can_evaluate_expr, get_expr_value): Delete.
	(output_addi, output_andi, output_ori, output_xori): Delete.
	(md_assemble): Remove calls to deleted functions.

	gas/testsuite/
	* gas/nios2/nios2.exp: Make "movi" a list test.
	* gas/nios2/movi.s: Adjust comments, add another case.
	* gas/nios2/movi.l: New.
	* gas/nios2/movi.d: Delete.
2014-11-28 14:41:32 -08:00
Max Filippov d92b6eece4 Fix trampolines search code for conditional branches
For conditional branches that need more than one trampoline to reach its
target assembler couldn't always find suitable trampoline because
post-loop condition check was placed inside the loop, resulting in
premature loop termination. Move check outside the loop.

This fixes the following build errors seen when assembling huge files
produced by gcc:
    Error: jump target out of range; no usable trampoline found
    Error: operand 1 of 'j' has out of range value '307307'

2014-11-25  Max Filippov  <jcmvbkbc@gmail.com>

gas/
	* config/tc-xtensa.c (search_trampolines): Move post-loop
	condition check outside the search loop.

gas/testsuite/
	* gas/xtensa/trampoline.d: Add expected output for branches.
	* gas/xtensa/trampoline.s: Add test case for branches.
2014-11-26 00:17:36 +03:00
H.J. Lu 6e733ccea9 Update libtool.m4 from GCC trunk
* libtool.m4: Updated from GCC trunk.

bfd/

	* configure: Regenerated.

binutils/

	* configure: Regenerated.

gas/

	* configure: Regenerated.

gprof/

	* configure: Regenerated.

ld/

	* configure: Regenerated.

opcodes/

	* configure: Regenerated.
2014-11-24 09:14:09 -08:00
Terry Guo 3cfdb7812c Calculate ARM arch attribute after relaxation
gas/
2014-11-21  Terry Guo  <terry.guo@arm.com>

	* config/tc-arm.c (md_assemble): Do not consider relaxation.
	(md_convert_frag): Test and set target arch attribute accordingly.
	(aeabi_set_attribute_string): Turn it into a global function.
	* config/tc-arm.h (md_post_relax_hook): Enable it for ARM target.
	(aeabi_set_public_attributes): Declare it.

gas/testsuite/
2014-11-21  Terry Guo  <terry.guo@arm.com>

	* gas/arm/attr-arch-assumption.d: New file.
	* gas/arm/attr-arch-assumption.s: Likewise.

ld/testsuite/
2014-11-21  Terry Guo  <terry.guo@arm.com>

	* ld-arm/tls-longplt-lib.s: Require ARMv6T2.
	* ld-arm/tls-longplt.s: Likewise.
	* ld-arm/tls-longplt-lib.d: Updated.
	* ld-arm/tls-longplt.d: Likewise.
2014-11-21 11:54:39 +08:00
Terry Guo a715796ba1 Support ARM Cortex-M7
include/ChangeLog:
2014-11-21  Terry Guo  <terry.guo@arm.com>

	* opcode/arm.h (FPU_VFP_EXT_ARMV8xD): New macro.
	(FPU_VFP_V5D16): Likewise.
	(FPU_VFP_V5_SP_D16): Likewise.
	(FPU_ARCH_VFP_V5D16): Likewise.
	(FPU_ARCH_VFP_V5_SP_D16): Likewise.

bfd/ChangeLog:
2014-11-21  Terry Guo  <terry.guo@arm.com>

	* elf32-arm.c (elf32_arm_merge_eabi_attributes): Support FPv5.

binutils/ChangeLog:
2014-11-21  Terry Guo  <terry.guo@arm.com>

	* readelf.c (arm_attr_tag_FP_arch): Extended to support FPv5.

gas/ChangeLog:
2014-11-21  Terry Guo  <terry.guo@arm.com>

	* config/tc-arm.c (fpu_vfp_ext_armv8xd): New.
	(arm_cpus): Support cortex-m7.
	(arm_fpus): Support fpv5-sp-d16 and fpv5-d16.
	(do_vfp_nsyn_cvt_fpv8): Generate error when use D register for S
	register only target like FPv5-SP-D16.
	(do_neon_cvttb_1): Likewise.
	(do_vfp_nsyn_fpv8): Likewise.
	(do_vrint_1): Likewise.
	(aeabi_set_public_attributes): Set proper FP arch for FPv5.
	* doc/c-arm.texi: Document new cpu and fpu names for cortex-m7.

gas/testsuite/ChangeLog:
2014-11-21  Terry Guo  <terry.guo@arm.com>

	* gas/arm/armv7e-m+fpv5-d16.s: New.
	* gas/arm/armv7e-m+fpv5-d16.d: Likewise.
	* gas/arm/armv7e-m+fpv5-sp-d16.s: Likewise.
	* gas/arm/armv7e-m+fpv5-sp-d16.d: Likewise.

ld/testsuite/ChangeLog:
2014-11-21  Terry Guo  <terry.guo@arm.com>

	* ld-arm/attr-merge-vfp-4-sp.s: New test source file.
	* ld-arm/attr-merge-vfp-5-sp.s: Likewise.
	* ld-arm/attr-merge-vfp-5.s: Likewise.
	* ld-arm/attr-merge-vfp-8.d: New test.
	* ld-arm/attr-merge-vfp-8r.d: Likewise.
	* ld-arm/attr-merge-vfp-9.d: Likewise.
	* ld-arm/attr-merge-vfp-9r.d: Likewise.
	* ld-arm/attr-merge-vfp-10.d: Likewise.
	* ld-arm/attr-merge-vfp-10r.d: Likewise.
	* ld-arm/attr-merge-vfp-11.d: Likewise.
	* ld-arm/attr-merge-vfp-11r.d: Likewise.
	* ld-arm/attr-merge-vfp-12.d: Likewise.
	* ld-arm/attr-merge-vfp-12r.d: Likewise.
	* ld-arm/attr-merge-vfp-13.d: Likewise.
	* ld-arm/attr-merge-vfp-13r.d: Likewise.
	* ld-arm/attr-merge-vfp-14.d: Likewise.
	* ld-arm/attr-merge-vfp-14r.d: Likewise.
	* ld-arm/arm-elf.exp: Run the new tests.
2014-11-21 11:36:06 +08:00
Richard Earnshaw d840c081f8 * config/tc-arm.c (rotate_left): Avoid undefined behaviour when N = 0. 2014-11-20 17:02:47 +00:00
Richard Earnshaw 5c47e52589 [AArch64] Fix mis-detection of unpredictable load/store operations with FP regs.
* config/tc-aarch64.c (warn_unpredictable_ldst): Check that transfer
	registers are in the GP register set.  Adjust warnings.  Use correct
	field member for address register.
	* testsuite/gas/aarch64/diagnostic.l: Update.
2014-11-20 15:28:52 +00:00
Jiong Wang 54a28c4ce5 [AArch64] Warn on load pair to same register
2014-11-19  Ryan Mansfield  <rmansfield@qnx.com>

    * config/tc-aarch64.c (md_assemble): Call warn_unpredictable_ldst.
    (warn_unpredictable_ldst): New.

  2014-11-19  Ryan Mansfield <rmansfield@qnx.com>

    * gas/aarch64/diagnostic.s: Add new warnings test patterns.
    * gas/aarch64/diagnostic.l: Update expected diagnostic output.
2014-11-19 09:35:23 +00:00
Igor Zamyatin d258b82828 Add -z bndplt to generate BND prefix in PLT entries
This patch adds "-z bndplt" option Linux/x86-64 linker to generate BND
prefix in PLT entries.  It also updated Linux/x86-64 assembler not to
generate R_X86_64_PLT32_BND nor R_X86_64_PC32_BND relocations.

bfd/

2014-11-18  Igor Zamyatin  <igor.zamyatin@intel.com>

	* elf64-x86-64.c (elf_x86_64_check_relocs): Enable MPX PLT only
	for -z bndplt.

gas/

2014-11-18  Igor Zamyatin  <igor.zamyatin@intel.com>

	* config/tc-i386-intel.c (i386_operator): Remove last argument
	from lex_got call.
	* config/tc-i386.c (reloc): Remove bnd_prefix from parameters'
	list.  Return always BFD_RELOC_32_PCREL.
	* (output_branch): Remove condition for BFD_RELOC_X86_64_PC32_BND.
	* (output_jump): Update call to reloc accordingly.
	* (output_interseg_jump): Likewise.
	* (output_disp): Likewise.
	* (output_imm): Likewise.
	* (x86_cons_fix_new): Likewise.
	* (lex_got): Remove bnd_prefix from parameters' list in macro and
	declarations. Don't use BFD_RELOC_X86_64_PLT32_BND.
	* (x86_cons): Update call to lex_got accordingly.
	* (i386_immediate): Likewise.
	* (i386_displacement): Likewise.
	* (md_apply_fix): Don't use BFD_RELOC_X86_64_PLT32_BND nor
	BFD_RELOC_X86_64_PC32_BND.
	* (tc_gen_reloc): Likewise.

include/

2014-11-18  Igor Zamyatin  <igor.zamyatin@intel.com>

	* bfdlink.h (struct bfd_link_info): Add bndplt.

ld/

2014-11-18  Igor Zamyatin  <igor.zamyatin@intel.com>

	* emulparams/elf_x86_64.sh (BNDPLT): Set to yes for x86_64.
	* emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle
	"-z bndplt" if BNDPLT is yes.
	(gld${EMULATION_NAME}_list_options): Add "-z bndplt" entry.
	* ld.texinfo: Add description for bndplt.

ld/testsuite/

2014-11-18  Igor Zamyatin  <igor.zamyatin@intel.com>

	* testsuite/ld-x86-64/bnd-ifunc-1.d: Add bndplt option.
	* testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise.
	* testsuite/ld-x86-64/bnd-plt-1.d: Likewise.  Update dissassembly
	sections.
	* testsuite/ld-x86-64/mpx.exp: Handle mpx3 and mpx4 tests.
	* testsuite/ld-x86-64/mpx1a.rd: Remove _BND from relocation name.
	* testsuite/ld-x86-64/mpx1c.rd: Likewise.
	* testsuite/ld-x86-64/mpx2a.rd: Likewise.
	* testsuite/ld-x86-64/mpx2c.rd: Likewise.
	* testsuite/ld-x86-64/mpx3.dd: New file.
	* testsuite/ld-x86-64/mpx3a.s: Likewise.
	* testsuite/ld-x86-64/mpx3b.s: Likewise.
	* testsuite/ld-x86-64/mpx4.dd: Likewise.
	* testsuite/ld-x86-64/mpx4a.s: Likewise.
	* testsuite/ld-x86-64/mpx4b.s: Likewise.
2014-11-18 05:40:17 -08:00
Jan Beulich ae527cd876 aarch64: allow adding/removing just feature flags via .arch_extension
Rather than requiring to always also set/change the base architecture,
allow just en-/disabling of architecture extensions, matching what ARM
has.
2014-11-18 14:08:28 +01:00
Philipp Tomsich 0a9ce86daf [AArch64] Add xgene2. 2014-11-18 11:24:14 +00:00
Philipp Tomsich 070cb95614 [AArch64] Add xgene1.
The name xgene1 superceeds xgene-1.  We retain support for the
original xgene-1 for compatibility but drop it from documentation.
2014-11-18 11:19:05 +00:00
Ilya Tocar 14f195c9a0 Add AVX512VBMI instructions
gas/

	* config/tc-i386.c (cpu_arch): Add .avx512vbmi.
	* doc/c-i386.texi: Document it.

opcodes/

	* i386-dis-evex.c (evex_table): Add vpermi2b, vpermt2b, vpermb,
	vpmultishiftqb.
	* i386-dis.c (PREFIX enum): Add PREFIX_EVEX_0F3883, EVEX_W_0F3883_P_2.
	* i386-gen.c (cpu_flag_init): Add CPU_AVX512VBMI_FLAGS.
	(cpu_flags): Add CpuAVX512VBMI.
	* i386-opc.h (enum): Add CpuAVX512VBMI.
	(i386_cpu_flags): Add cpuavx512vbmi.
	* i386-opc.tbl: Add vpmadd52luq, vpmultishiftqb, vpermb, vpermi2b,
	vpermt2b.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.

/gas/testsuite/

	* gas/i386/i386.exp: Run new tests.
	* gas/i386/avx512vbmi-intel.d: New file.
	* gas/i386/avx512vbmi.d: Likewise.
	* gas/i386/avx512vbmi.s: Likewise.
	* gas/i386/avx512vbmi_vl-intel.d: Likewise.
	* gas/i386/avx512vbmi_vl.d: Likewise.
	* gas/i386/avx512vbmi_vl.s: Likewise.
	* gas/i386/x86-64-avx512vbmi-intel.d: Likewise.
	* gas/i386/x86-64-avx512vbmi.d: Likewise.
	* gas/i386/x86-64-avx512vbmi.s: Likewise.
	* gas/i386/x86-64-avx512vbmi_vl-intel.d: Likewise.
	* gas/i386/x86-64-avx512vbmi_vl.d: Likewise.
	* gas/i386/x86-64-avx512vbmi_vl.s: Likewise.
2014-11-17 06:03:41 -08:00
Ilya Tocar 2cc1b5aad8 Add AVX512IFMA instructions
gas/

	* config/tc-i386.c (cpu_arch): Add .avx512ifma.
	* doc/c-i386.texi: Document it.

opcodes/

	* i386-dis-evex.c (evex_table): Add vpmadd52luq, vpmadd52huq.
	* i386-dis.c (PREFIX enum): Add PREFIX_EVEX_0F38B4,
	PREFIX_EVEX_0F38B5.
	* i386-gen.c (cpu_flag_init): Add CPU_AVX512IFMA_FLAGS.
	(cpu_flags): Add CpuAVX512IFMA.
	* i386-opc.h (enum): Add CpuAVX512IFMA.
	(i386_cpu_flags): Add cpuavx512ifma.
	* i386-opc.tbl: Add vpmadd52huq, vpmadd52luq.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.

/gas/testsuite/

	* gas/i386/i386.exp: Run new tests.
	* gas/i386/avx512ifma-intel.d: New file.
	* gas/i386/avx512ifma.d: Likewise.
	* gas/i386/avx512ifma.s: Likewise.
	* gas/i386/avx512ifma_vl-intel.d: Likewise.
	* gas/i386/avx512ifma_vl.d: Likewise.
	* gas/i386/avx512ifma_vl.s: Likewise.
	* gas/i386/x86-64-avx512ifma-intel.d: Likewise.
	* gas/i386/x86-64-avx512ifma.d: Likewise.
	* gas/i386/x86-64-avx512ifma.s: Likewise.
	* gas/i386/x86-64-avx512ifma_vl-intel.d: Likewise.
	* gas/i386/x86-64-avx512ifma_vl.d: Likewise.
	* gas/i386/x86-64-avx512ifma_vl.s: Likewise.
2014-11-17 06:03:24 -08:00
Ilya Tocar 9d8596f079 Add pcommit instruction
gas/

	* config/tc-i386.c (cpu_arch): Add .pcommit.
	* doc/c-i386.texi: Document it.

/opcodes

	* i386-dis.c (PREFIX enum): Add PREFIX_RM_0_0FAE_REG_7.
	(prefix_table): Add pcommit.
	* i386-gen.c (cpu_flag_init): Add CPU_PCOMMIT_FLAGS.
	(cpu_flags): Add CpuPCOMMIT.
	* i386-opc.h (enum): Add CpuPCOMMIT.
	(i386_cpu_flags): Add cpupcommit.
	* i386-opc.tbl: Add pcommit.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.

/gas/testsuite/

	* gas/i386/i386.exp: Run new tests.
	* gas/i386/pcommit-intel.d: New file.
	* gas/i386/pcommit.d: Likewise.
	* gas/i386/pcommit.s: Likewise.
	* gas/i386/x86-64-pcommit-intel.d: Likewise.
	* gas/i386/x86-64-pcommit.d: Likewise.
	* gas/i386/x86-64-pcommit.s: Likewise.
2014-11-17 05:56:47 -08:00
Ilya Tocar c5e7287a1a Add clwb instruction
gas/

	* config/tc-i386.c (cpu_arch): Add .clwb.
	* doc/c-i386.texi: Document it.

opcodes/
	* i386-dis.c (PREFIX enum): Add PREFIX_0FAE_REG_6.
	(prefix_table): Add clwb.
	* i386-gen.c (cpu_flag_init): Add CPU_CLWB_FLAGS.
	(cpu_flags): Add CpuCLWB.
	* i386-opc.h (enum): Add CpuCLWB.
	(i386_cpu_flags): Add cpuclwb.
	* i386-opc.tbl: Add clwb.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.

gas/testsuite/

	* gas/i386/i386.exp: Run new tests.
	* gas/i386/clwb-intel.d: New file.
	* gas/i386/clwb.d: Likewise.
	* gas/i386/clwb.s: Likewise.
	* gas/i386/x86-64-clwb-intel.d: Likewise.
	* gas/i386/x86-64-clwb.d: Likewise.
	* gas/i386/x86-64-clwb.s: Likewise.
2014-11-17 05:56:37 -08:00
H.J. Lu 1dfc6506b7 Correct x86 assembler manual
* config/tc-i386.c (cpu_arch): Re-arrange avx512* and xsave*
	items.

	* doc/c-i386.texi: Re-arrange avx512* and xsave*.  Add
	clflushopt and se1.  Remove duplicated entries.
2014-11-14 08:36:04 -08:00
Marcus Shawcroft 02c1355124 [AArch64] Enable CRC feature in GAS for cortex-a53 and cortex-a57. 2014-11-14 12:52:17 +00:00
H.J. Lu 553d1284b7 Add assembler support for @gotplt
Obsolete R_X86_64_GOTPLT64 and treat it the same as R_X86_64_GOT64.

bfd/

	PR gas/17598
	* elf64-x86-64.c (elf_x86_64_check_relocs): Treat
	R_X86_64_GOTPLT64 the same as R_X86_64_GOT64.
	(elf_x86_64_relocate_section): Likewise.

gas/

	PR gas/17598
	* config/tc-i386.c (reloc): Support BFD_RELOC_X86_64_GOTPLT64.

gas/testsuite/

	PR gas/17598
	* gas/i386/reloc64.s: Add @gotplt check.

	* gas/i386/reloc64.d: Updated.
	* gas/i386/reloc64.l: Likewise.

ld/testsuite/

	PR gas/17598
	* ld-x86-64/x86-64.exp: Run gotplt1.

	* ld-x86-64/gotplt1.d: New file.
	* ld-x86-64/gotplt1.s: Likewise.
2014-11-13 11:09:40 -08:00
Nick Clifton a5c71af8d3 More fixes for memory access violations whilst scanning corrupt binaries.
PR binutils/17512
	* config/obj-coff.c (coff_obj_symbol_new_hook): Set the is_sym
	field.

	* coffcode.h (coff_ptr_struct): Add is_sym field.
	(coff_new_section_hook): Set the is_sym field.
	(coff_pointerize_aux_hook): Check the is_sym field.
	(coff_print_aux): Likewise.
	(coff_compute_section_file_positions): Likewise.
	(coff_write_object_contents): Likewise.
	(coff_slurp_line_table): Likewise.
	(coff_slurp_symbol_table): Likewise.
	(CALC_ADDEND): Likewise.
	* coffgen.c (coff_renumber_symbols): Likewise.
	(coff_mangle_symbols): Likewise.
	(coff_fix_symbol_name): Likewise.
	(coff_write_symbol): Likewise.
	(coff_write_alien_symbol): Likewise.
	(coff_write_native_symbol): Likewise.
	(coff_write_symbols): Likewise.
	(coff_write_linenumbers): Likewise.
	(coff_pointerize_aux): Likewise.
	(coff_get_normalized_symtab): Likewise.
	(coff_get_symbol_info): Likewise.
	(bfd_coff_get_syment): Likewise.
	(bfd_coff_get_auxent): Likewise.
	(coff_print_symbol): Likewise.
	(coff_find_nearest_line_with_names): Likewise.
	(bfd_coff_set_symbol_class): Likewise.
	(coff_make_empty_symbol): Set the is_sym field.
	(coff_bfd_make_debug_symbol): Likewise.
	* peicode.h (pe_ILF_make_a_symbol): Likewise.
	* libcoff.h: Regenerate.
	* libcoff-in.h: Regenerate.
2014-11-13 17:46:11 +00:00
Marcus Shawcroft 09bc6c7224 [AArch64] Remove example processors from GAS. 2014-11-13 16:42:23 +00:00
Alan Modra abd58633c1 Fix z80-coff build breakage
* config/tc-z80.c (parse_exp_not_indexed, parse_exp): Warning fixes.
2014-11-12 15:05:30 +10:30
Alan Modra 6d19a37a8f Fix x86 non-ELF build breakage
PR ld/17482
	* config/tc-i386.c (output_insn): Don't test x86_elf_abi when
	not ELF.
2014-11-12 15:04:25 +10:30
Nick Clifton 60984d5291 Updated French and Ukranian translations supplied by the Translation Project.
* po/uk.po: Updated Ukranian translation.

	* po/fr.po: Updated French translation.
2014-11-11 16:56:58 +00:00
H.J. Lu bda7491873 Fix a typo in gas/ChangeLog 2014-11-07 17:47:54 -08:00
H.J. Lu cf61b7473a X32: Add REX prefix to encode R_X86_64_GOTTPOFF
Structions with R_X86_64_GOTTPOFF relocation must be encoded with REX
prefix even if it isn't required by destination register.  Otherwise
linker can't safely perform IE -> LE optimization.

bfd/

	PR ld/17482
	* elf64-x86-64.c (elf_x86_64_relocate_section): Update comments
	for IE->LE transition.

gas/

	PR ld/17482
	* config/tc-i386.c (output_insn): Add a dummy REX_OPCODE prefix
	for structions with R_X86_64_GOTTPOFF relocation for x32 if needed.

gas/testsuite/

	PR ld/17482
	* gas/i386/ilp32/x32-tls.d: New file.
	* gas/i386/ilp32/x32-tls.s: Likewise.

ld/testsuite/

	PR ld/17482
	* ld-x86-64/tlsie4.dd: Updated.
2014-11-07 12:22:53 -08:00
Sandra Loosemore b4714c7c30 Add mach parameter to nios2_find_opcode_hash.
2014-11-06  Sandra Loosemore  <sandra@codesourcery.com>

	include/opcode/
	* nios2.h (nios2_find_opcode_hash): Add mach parameter to
	declaration.  Fix obsolete comment.

	opcodes/
	* nios2-dis.c (nios2_find_opcode_hash): Add mach parameter.
	(nios2_disassemble): Adjust call to nios2_find_opcode_hash.

	gas/
	* config/tc-nios2.c (nios2_diagnose_overflow): Adjust call to
	nios2_find_opcode_hash.
2014-11-06 13:12:21 -08:00
Matthew Fortune 09c14161c5 Update .MIPS.abiflags to support MIPS R6
bfd/

	* elfxx-mips.c (update_mips_abiflags_isa): Add E_MIPS_ARCH_32R6
	and E_MIPS_ARCH_64R6 support.

ld/testsuite/

	* ld-mips-elf/abiflags-strip10-ph.d: New file.
	* ld-mips-elf/mips-eld.exp: Run the new test.

gas/

	* config/tc-mips.c (mips_elf_final_processing): Add INSN_ISA32R6
	and INSN_ISA64R6 support.

gas/testsuite/

	* gas/mips/elf_arch_mips32r6.d: New file.
	* gas/mips/elf_arch_mips64r6.d: New file.
	* gas/mips/mips.exp: Run the new tests.
2014-11-05 10:48:38 +00:00
Alan Modra ed9e98c214 Don't use register keyword
* expr.c (expr_symbol_where): Don't use register keyword.
	* app.c (app_push, app_pop, do_scrub_chars): Likewise.
	* ecoff.c (add_string, add_ecoff_symbol, add_aux_sym_symint,
	add_aux_sym_rndx, add_aux_sym_tir, add_procedure, add_file,
	ecoff_build_lineno, ecoff_setup_ext, allocate_cluster.
	allocate_scope, allocate_vlinks, allocate_shash,
	allocate_thash, allocate_tag, allocate_forward, allocate_thead,
	allocate_lineno_list): Likewise.
	* frags.c (frag_more, frag_var, frag_variant, frag_wane): Likewise.
	* input-file.c (input_file_push, input_file_pop): Likewise.
	* input-scrub.c (input_scrub_push, input_scrub_next_buffer): Likewise.
	* subsegs.c (subseg_change): Likewise.
	* symbols.c (colon, symbol_table_insert, symbol_find_or_make)
	(dollar_label_name, fb_label_name): Likewise.
	* write.c (relax_align): Likewise.
	* config/tc-alpha.c (s_alpha_pdesc): Likewise.
	* config/tc-bfin.c (bfin_s_bss): Likewise.
	* config/tc-i860.c (md_estimate_size_before_relax): Likewise.
	* config/tc-m68hc11.c (md_convert_frag): Likewise.
	* config/tc-m68k.c (m68k_ip, crack_operand): Likewise.
	(md_convert_frag_1, s_even): Likewise.
	* config/tc-mips.c (mips_clear_insn_labels): Likewise.
	* config/tc-mn10200.c (md_begin): Likewise.
	* config/tc-s390.c (s390_setup_opcodes, md_begin): Likewise.
	* config/tc-sh.c (sh_elf_cons): Likewise.
	* config/tc-tic4x.c (tic4x_cons, tic4x_stringer): Likewise.
	* config/m68k-parse.y (m68k_reg_parse): Likewise.  Convert from K&R.
	(yylex, m68k_ip_op, yyerror): Convert from K&R.
2014-11-04 22:40:45 +10:30
Alan Modra 127a8db1ed Use frag_now_fix_octets in gas d10v, d30v
obstack_next_free is supposed to return a void* rather than the char*
it does currently, so expressions involving pointer arithmetic need
a cast.  Avoid the issue.

	* config/tc-d10v.c (find_opcode): Call frag_now_fix_octets rather
	than equivalent obstack_next_free expression.
	* config/tc-d30v.c (find_format): Likewise.
2014-11-04 22:40:44 +10:30
Nick Clifton 99b4a5a085 Fixes a snafu checking the size of 20-bit immedaite values.
* config/tc-msp430.c (msp430_srcoperand): Fix range test for
	20-bit values.
2014-11-03 11:15:53 +00:00
Naveen H.S 2c62985659 MIPS: Add Octeon 3 support
binutils:
2014-10-31  Andrew Pinski  <apinski@cavium.com>
            Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

	* readelf.c (print_mips_isa_ext): Print the value of Octeon3.

gas:
2014-10-31  Andrew Pinski  <apinski@cavium.com>
            Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

	* config/tc-mips.c (CPU_IS_OCTEON): Handle CPU_OCTEON3.
	(mips_cpu_info_table): Octeon3 enables virt ase.
	* doc/c-mips.texi: Document octeon3 as an acceptable value for
	-march=.

gas/testsuite:
2014-10-31  Andrew Pinski  <apinski@cavium.com>
            Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

	* gas/mips/mips.exp: Add support for Octeon3 architecture.
	Also add in support for running Octeon3 tests.
	* gas/mips/octeon3.d: New test.
	* gas/mips/octeon3.s: New test source.

opcodes:
2014-10-31  Andrew Pinski  <apinski@cavium.com>
            Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

	* mips-dis.c (mips_arch_choices): Add octeon3.
	* mips-opc.c (IOCT): Include INSN_OCTEON3.
	(IOCT2): Likewise.
	(IOCT3): New define.
	(IVIRT): New define.
	(mips_builtin_opcodes): Add dmfgc0, dmtgc0, hypcall, mfgc0, mtgc0,
	tlbinv, tlbinvf, tlbgr, tlbgwi, tlbginv, tlbginvf, tlbgwr, tlbgp, tlti
	IVIRT instructions.
	Extend mtm0, mtm1, mtm2, mtp0, mtp1, mtp2 instructions to take another
	operand for IOCT3.

bfd:
2014-10-31  Andrew Pinski  <apinski@cavium.com>
            Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

	* archures.c: Add octeon3 for mips target.
	* bfd-in2.h: Regenerate.
	* bfd/cpu-mips.c: Define I_mipsocteon3.
	nfo_struct): Add octeon3 support.
	* bfd/elfxx-mips.c: (_bfd_elf_mips_mach): Add support for
	octeon3.
	(mips_set_isa_flags): Add support for octeon3.
	(bfd_mips_isa_ext): Add bfd_mach_mips_octeon3.
	(mips_mach_extensions): Make bfd_mach_mips_octeon3 an
	extension of bfd_mach_mips_octeon2.
	(print_mips_isa_ext): Print the value of Octeon3.
2014-10-31 13:50:10 -07:00
Andrew Pinski 2220166513 Add forgotten changelog entry.
2014-10-21  Andrew Pinski  <apinski@cavium.com>

	* config/tc-aarch64.c (aarch64_cpus):
	Add thunderx.
	* doc/c-aarch64.texi: Document that thunderx
	is a valid processor name.
2014-10-31 13:24:24 -07:00
Dr Philipp Tomsich f803aa8ead Remove the artificial limit on code alignment through the use of the
fixed part of a fragment for output generation only, which required
MAX_MEM_FOR_RS_ALIGN_CODE to be large enough to hold the maximum pad.

	* config/tc-aarch64.h (MAX_MEM_FOR_RS_ALIGN_CODE): Define to 7.
	* config/tc-aarch64.c (aarch64_handle_align): Rewrite to handle
	large alignments with a constant fragment size of
	MAX_MEM_FOR_RS_ALIGN_CODE.
2014-10-30 10:53:09 +00:00
Nick Clifton 64b588b51e Updated/new translations provided by the Translations Project. 2014-10-29 16:34:04 +00:00
Sandra Loosemore 96ba42336f Refactoring/cleanup of nios2 opcodes and assembler code.
2014-10-23  Sandra Loosemore  <sandra@codesourcery.com>

	include/opcode/
	* nios2.h (enum iw_format_type): New.
	(struct nios2_opcode): Update comments.  Add size and format fields.
	(NIOS2_INSN_OPTARG): New.
	(REG_NORMAL, REG_CONTROL, REG_COPROCESSOR): New.
	(struct nios2_reg): Add regtype field.
	(GET_INSN_FIELD, SET_INSN_FIELD): Delete.
	(IW_A_LSB, IW_A_MSB, IW_A_SZ, IW_A_MASK): Delete.
	(IW_B_LSB, IW_B_MSB, IW_B_SZ, IW_B_MASK): Delete.
	(IW_C_LSB, IW_C_MSB, IW_C_SZ, IW_C_MASK): Delete.
	(IW_IMM16_LSB, IW_IMM16_MSB, IW_IMM16_SZ, IW_IMM16_MASK): Delete.
	(IW_IMM26_LSB, IW_IMM26_MSB, IW_IMM26_SZ, IW_IMM26_MASK): Delete.
	(IW_OP_LSB, IW_OP_MSB, IW_OP_SZ, IW_OP_MASK): Delete.
	(IW_OPX_LSB, IW_OPX_MSB, IW_OPX_SZ, IW_OPX_MASK): Delete.
	(IW_SHIFT_IMM5_LSB, IW_SHIFT_IMM5_MSB): Delete.
	(IW_SHIFT_IMM5_SZ, IW_SHIFT_IMM5_MASK): Delete.
	(IW_CONTROL_REGNUM_LSB, IW_CONTROL_REGNUM_MSB): Delete.
	(IW_CONTROL_REGNUM_SZ, IW_CONTROL_REGNUM_MASK): Delete.
	(OP_MASK_OP, OP_SH_OP): Delete.
	(OP_MASK_IOP, OP_SH_IOP): Delete.
	(OP_MASK_IRD, OP_SH_IRD): Delete.
	(OP_MASK_IRT, OP_SH_IRT): Delete.
	(OP_MASK_IRS, OP_SH_IRS): Delete.
	(OP_MASK_ROP, OP_SH_ROP): Delete.
	(OP_MASK_RRD, OP_SH_RRD): Delete.
	(OP_MASK_RRT, OP_SH_RRT): Delete.
	(OP_MASK_RRS, OP_SH_RRS): Delete.
	(OP_MASK_JOP, OP_SH_JOP): Delete.
	(OP_MASK_IMM26, OP_SH_IMM26): Delete.
	(OP_MASK_RCTL, OP_SH_RCTL): Delete.
	(OP_MASK_IMM5, OP_SH_IMM5): Delete.
	(OP_MASK_CACHE_OPX, OP_SH_CACHE_OPX): Delete.
	(OP_MASK_CACHE_RRS, OP_SH_CACHE_RRS): Delete.
	(OP_MASK_CUSTOM_A, OP_SH_CUSTOM_A): Delete.
	(OP_MASK_CUSTOM_B, OP_SH_CUSTOM_B): Delete.
	(OP_MASK_CUSTOM_C, OP_SH_CUSTOM_C): Delete.
	(OP_MASK_CUSTOM_N, OP_SH_CUSTOM_N): Delete.
	(OP_<insn>, OPX_<insn>, OP_MATCH_<insn>, OPX_MATCH_<insn>): Delete.
	(OP_MASK_<insn>, OP_MASK): Delete.
	(GET_IW_A, GET_IW_B, GET_IW_C, GET_IW_CONTROL_REGNUM): Delete.
	(GET_IW_IMM16, GET_IW_IMM26, GET_IW_OP, GET_IW_OPX): Delete.
	Include nios2r1.h to define new instruction opcode constants
	and accessors.
	(nios2_builtin_opcodes): Rename to nios2_r1_opcodes.
	(bfd_nios2_num_builtin_opcodes): Rename to nios2_num_r1_opcodes.
	(bfd_nios2_num_opcodes): Rename to nios2_num_opcodes.
	(NUMOPCODES, NUMREGISTERS): Delete.
	* nios2r1.h: New file.

	opcodes/
	* nios2-opc.c (nios2_builtin_regs): Add regtype field initializers.
	(nios2_builtin_opcodes): Rename to nios2_r1_opcodes.  Use new
	MATCH_R1_<insn> and MASK_R1_<insn> macros in initializers.  Add
	size and format initializers.  Merge 'b' arguments into 'j'.
	(NIOS2_NUM_OPCODES): Adjust definition.
	(bfd_nios2_num_builtin_opcodes): Rename to nios2_num_r1_opcodes.
	(nios2_opcodes): Adjust.
	(bfd_nios2_num_opcodes): Rename to nios2_num_opcodes.
	* nios2-dis.c (INSNLEN): Update comment.
	(nios2_hash_init, nios2_hash): Delete.
	(OPCODE_HASH_SIZE): New.
	(nios2_r1_extract_opcode): New.
	(nios2_disassembler_state): New.
	(nios2_r1_disassembler_state): New.
	(nios2_init_opcode_hash): Add state parameter.  Adjust to use it.
	(nios2_find_opcode_hash): Use state object.
	(bad_opcode): New.
	(nios2_print_insn_arg): Add op parameter.  Use it to access
	format.  Remove 'b' case.
	(nios2_disassemble): Remove special case for nop.  Remove
	hard-coded instruction size.

	gas/
	* config/tc-nios2.c (nios2_insn_infoS): Add constant_bits field.
	(nios2_arg_infoS, nios2_arg_hash, nios2_arg_lookup): Delete.
	(nios2_control_register_arg_p): Delete.
	(nios2_coproc_reg): Delete.
	(nios2_relax_frag): Remove hard-coded instruction size.
	(md_convert_frag): Use new insn accessor macros.
	(nios2_diagnose_overflow): Remove hard-coded instruction size.
	(md_apply_fix): Likewise.
	(bad_opcode): New.
	(nios2_parse_reg): New.
	(nios2_assemble_expression): Remove prev_reloc parameter.  Adjust
	uses and callers.
	(nios2_assemble_arg_c): New.
	(nios2_assemble_arg_d): New.
	(nios2_assemble_arg_s): New.
	(nios2_assemble_arg_t): New.
	(nios2_assemble_arg_i): New.
	(nios2_assemble_arg_u): New.
	(nios2_assemble_arg_o): New.
	(nios2_assemble_arg_j): New.
	(nios2_assemble_arg_l): New.
	(nios2_assemble_arg_m): New.
	(nios2_assemble_args): New.
	(nios2_assemble_args_dst): Delete.
	(nios2_assemble_args_tsi): Delete.
	(nios2_assemble_args_tsu): Delete.
	(nios2_assemble_args_sto): Delete.
	(nios2_assemble_args_o): Delete.
	(nios2_assemble_args_is): Delete.
	(nios2_assemble_args_m): Delete.
	(nios2_assemble_args_s): Delete.
	(nios2_assemble_args_tis): Delete.
	(nios2_assemble_args_dc): Delete.
	(nios2_assemble_args_cs): Delete.
	(nios2_assemble_args_ds): Delete.
	(nios2_assemble_args_ldst): Delete.
	(nios2_assemble_args_none): Delete.
	(nios2_assemble_args_dsj): Delete.
	(nios2_assemble_args_d): Delete.
	(nios2_assemble_args_b): Delete.
	(nios2_arg_info_structs): Delete.
	(NIOS2_NUM_ARGS): Delete.
	(nios2_consume_arg): Remove insn parameter.  Use new macros.
	Don't check register arguments here.  Remove 'b' case.
	(nios2_consume_separator): Move check for missing separators to...
	(nios2_parse_args): ...here.  Remove special case for optional
	arguments.
	(output_insn): Avoid using hard-coded insn size.
	(output_ubranch): Likewise.
	(output_cbranch): Likewise.
	(output_call): Use new macros.
	(output_addi): Likewise.
	(output_ori): Likewise.
	(output_xori): Likewise.
	(output_movia): Likewise.
	(md_begin): Remove nios2_arg_info_structs initialization.
	(md_assemble): Initialize constant_bits field.  Use
	nios2_parse_args instead of looking up parse function in hash table.

	gdb/
	* nios2-tdep.c (nios2_analyze_prologue): Use new instruction field
	accessors and constants from nios2 opcodes update.
	(nios2_get_next_pc): Likewise.
2014-10-23 09:54:15 -07:00
Matthew Fortune f179c51249 MIPS Documentation fixes
gas/
	* doc/as.texinfo: Update the MIPS FP ABI descriptions.
	* doc/c-mips.texi: Spell check and correct throughout.
2014-10-22 10:48:02 +01:00
Maciej W. Rozycki 7bb01e2d74 MIPS/GAS: Correct file option settings with `.insn'
This makes sure `HAVE_CODE_COMPRESSION' evaluates correctly when the
`.insn' directive is used at the beginning of a source file before any
instructions have been produced and that ELF file header's MIPS16 and
microMIPS ASE flags are set correctly in the case where no instructions
have been produced other than with the said directive.

	gas/
	* config/tc-mips.c (s_insn): Set file options.

	gas/testsuite/
	* gas/mips/insn-opts.d: New test.
	* gas/mips/insn-opts.s: New test source.
	* gas/mips/mips.exp: Run the new test.
2014-10-21 23:06:23 +01:00
Jan Beulich e74211b660 gas: avoid bogus warnings in false branches of conditional
The construct being added to the cond.s test case otherwise triggered
both the "missing closing ..." and the "stray ..." (twice) warnings in
_find_end_of_line(). As that code fragments suggests, this is needed to
support (include) files that can be used for both assembler .include
and compiler #include directives.
2014-10-21 09:57:41 +02:00
Jan Beulich 28f013d5cb aarch64: move bogus assertion
Asserting "idx" to be non-negative when subsequent code handles this
case is bogus. In fact the assertion triggers e.g. when mistakenly
using the arm32 comment character @ following an instruction.

While doing this I also noticed that despite there being local
variables "detail" and "idx", not all places where they could be used
did actually make use of them, so this is being adjusted at once.

Finally, for the code to be slightly more robust, also change
comparisons against -1 to such checking for a (non-)negative value.
2014-10-21 09:53:25 +02:00
Alan Modra a841bdf5d3 Fix PR17493, attempted output of *GAS `reg' section* symbol
The write.c change is to make gas report an error if reg_section
symbols should leak in future.  The tc-i386.c change is the real fix.

Note that the error isn't the most helpful, "redefined symbol cannot
be used on reloc", but I'm not inclined to improve what is really an
internal gas error.  reg_section symbols shouldn't leak..

gas/
	PR 17493
	* write.c (adjust_reloc_syms): Don't allow symbols in reg_section
	to be reduced to reg_section section symbol.
	* gas/config/tc-i386.c (i386_finalize_immediate): Reject all
	reg_section immediates.
gas/testsuite/
	* gas/i386/inval-equ-2.l: Adjust.
2014-10-18 23:07:07 +10:30
Matthew Fortune 8bd9785878 Fix bad @value references in MIPS documentation
gas/

	* doc/c-mips.texi: Fix bad @value references.
2014-10-17 20:25:53 +01:00
Tristan Gingold 91dc4e0a22 Bump bfd version.
bfd/
2014-10-15  Tristan Gingold  <gingold@adacore.com>

	* version.m4: Bump version to 2.25.51
	* configure: Regenerate.

binutils/
2014-10-15  Tristan Gingold  <gingold@adacore.com>

	* configure: Regenerate.

gas/
2014-10-15  Tristan Gingold  <gingold@adacore.com>

	* configure: Regenerate.

gprof/
2014-10-15  Tristan Gingold  <gingold@adacore.com>

	* configure: Regenerate.

ld/
2014-10-15  Tristan Gingold  <gingold@adacore.com>

	* configure: Regenerate.

opcodes/
2014-10-15  Tristan Gingold  <gingold@adacore.com>

	* configure: Regenerate.
2014-10-15 10:21:25 +02:00
Chen Gang 450ccef08d Fix memory overflow issue about strncat
If src contains n or more bytes, strncat() writes n+1 bytes to dest
(n from src plus the terminating null byte).   Therefore, the size of
dest must be at least strlen(dest)+n+1.

	* config/tc-tic4x.c (md_assemble): Correct strncat size.
2014-10-15 09:56:54 +10:30
Tristan Gingold c50415e24c Add NEWS markers for 2.25.
binutils/
2014-10-14  Tristan Gingold  <gingold@adacore.com>

	* NEWS: Add marker for 2.25.

gas/
2014-10-14  Tristan Gingold  <gingold@adacore.com>

	* NEWS: Add marker for 2.25.

ld/
2014-10-14  Tristan Gingold  <gingold@adacore.com>

	* NEWS: Add marker for 2.25.
2014-10-14 09:49:47 +02:00
Alan Modra 65879393f0 Avoid undefined behaviour with signed expressions
PR 17453
bfd/
	* libbfd.c (COERCE16, COERCE32, COERCE64): Use unsigned types.
	(EIGHT_GAZILLION): Delete.
binutils/
	* dwarf.c (read_leb128): Avoid signed overflow.
	(read_debug_line_header): Likewise.
gas/
	* config/tc-i386.c (fits_in_signed_long): Use unsigned param and
	expression to avoid signed overflow.
	(fits_in_signed_byte, fits_in_unsigned_byte, fits_in_unsigned_word,
	fits_in_signed_word, fits_in_unsigned_long): Similarly.
	* expr.c (operand <'-'>): Avoid signed overflow.
	* read.c (s_comm_internal): Likewise.
2014-10-14 14:36:35 +10:30
Alan Modra daf5e10e4c sparc-aout and sparc-coff breakage
* config/tc-sparc.c (sparc_md_end): Fix unused variable warnings.
2014-10-14 13:52:02 +10:30
Jose E. Marchesi 3d68f91c0f This is a series of patches that add support for the SPARC M7 cpu to
binutils.  They were discussed and approved here:

  https://sourceware.org/ml/binutils/2014-10/msg00038.html
2014-10-09 13:16:53 +01:00
Terry Guo d98b0e2bf6 2014-09-29 Terry Guo <terry.guo@arm.com>
* as.c (create_obj_attrs_section): Move it and call it from ...
        * write.c (create_obj_attrs_section): ... here.
        (subsegs_finish_section): Refactored.
2014-09-29 10:12:10 +08:00
Alan Modra 5f3fd8b405 Do away with hash table line lookup in dwarf2dbg.c
Hash lookup is silly when we can attach the line table info directly
to sections instead.  Worse, hash lookup fails when we have multiple
sections with the same name.

gas/
	* dwarf2dbg.c (all_segs_hash): Delete.
	(get_line_subseg): Delete last_seg, last_subseg, last_line_subseg.
	Retrieve line_seg for section via seg_info.
	* subsegs.h (segment_info_typet): Add dwarf2_line_seg.
gas/testsuite/
	* gas/elf/group2.d, * gas/elf/group2.s: New test.
	* gas/elf/elf.exp: Run it.
2014-09-27 16:18:30 +09:30
H.J. Lu 9e5e52835b Disallow VEX/EVEX encoded instructions in 16-bit mode
gas/

	PR gas/17421
	* config/tc-i386.c (md_assemble): Disallow VEX/EVEX encoded
	instructions in 16-bit mode.

gas/testsuite/

	PR gas/17421
	* gas/i386/i386.exp: Run inval-16.

	* gas/i386/inval-16.l: New file.
	* gas/i386/inval-16.s: Likewise.
2014-09-23 11:14:27 -07:00
Alan Modra 28a0da39c6 Fix various warnings seen when using gcc-5.0
* config/tc-m68k.c (md_assemble): Add assert to work around
	bogus trunk gcc warning.
	* config/tc-pj.h (md_convert_frag): Warning fix.
	* config/tc-xtensa.c (xg_assemble_vliw_tokens): Warning fix.
2014-09-22 19:01:25 +09:30
Tristan Gingold 2569ceb0b0 Fix arm-elf build failure on non-C99 systems (was using int64_t)
gas/
        * config/tc-arm.c (move_or_literal_pool, add_to_lit_pool): Use
        bfd_int64_t instead of int64_t.
2014-09-17 10:43:00 +02:00
Ilya Tocar d3d3c6db1a Add -mevexrcig={rne|rd|ru|rz} option to x86 assembler.
It is used to control which value is encoded in rounding control bits
for SAE-only EVEX instructions.

gas/
	* config/tc-i386.c (evexrcig): New.
	(build_evex_prefix): Force rounding bits.
	(OPTION_MEVEXRCIG): New.
	(md_longopts): Add mevexrcig.
	(md_parse_option): Handle OPTION_MEVEXRCIG.
	(md_show_usage): Document mevexrcig.
	* doc/c-i386.texi (mevexrcig): Document new option.

gas/testsuite/
	* gas/i386/avx512dq-rcig.s: New.
	* gas/i386/avx512dq-rcigrd-intel.d: Likewise.
	* gas/i386/avx512dq-rcigrd.d: Likewise.
	* gas/i386/avx512dq-rcigrne-intel.d: Likewise.
	* gas/i386/avx512dq-rcigrne.d: Likewise.
	* gas/i386/avx512dq-rcigru-intel.d: Likewise.
	* gas/i386/avx512dq-rcigru.d: Likewise.
	* gas/i386/avx512dq-rcigrz-intel.d: Likewise.
	* gas/i386/avx512dq-rcigrz.d: Likewise.
	* gas/i386/avx512er-rcig.s: Likewise.
	* gas/i386/avx512er-rcigrd-intel.d: Likewise.
	* gas/i386/avx512er-rcigrd.d: Likewise.
	* gas/i386/avx512er-rcigrne-intel.d: Likewise.
	* gas/i386/avx512er-rcigrne.d: Likewise.
	* gas/i386/avx512er-rcigru-intel.d: Likewise.
	* gas/i386/avx512er-rcigru.d: Likewise.
	* gas/i386/avx512er-rcigrz-intel.d: Likewise.
	* gas/i386/avx512er-rcigrz.d: Likewise.
	* gas/i386/avx512f-rcig.s: Likewise.
	* gas/i386/avx512f-rcigrd-intel.d: Likewise.
	* gas/i386/avx512f-rcigrd.d: Likewise.
	* gas/i386/avx512f-rcigrne-intel.d: Likewise.
	* gas/i386/avx512f-rcigrne.d: Likewise.
	* gas/i386/avx512f-rcigru-intel.d: Likewise.
	* gas/i386/avx512f-rcigru.d: Likewise.
	* gas/i386/avx512f-rcigrz-intel.d: Likewise.
	* gas/i386/avx512f-rcigrz.d: Likewise.
	* gas/i386/x86-64-avx512dq-rcig.s: Likewise.
	* gas/i386/x86-64-avx512dq-rcigrd-intel.d: Likewise.
	* gas/i386/x86-64-avx512dq-rcigrd.d: Likewise.
	* gas/i386/x86-64-avx512dq-rcigrne-intel.d: Likewise.
	* gas/i386/x86-64-avx512dq-rcigrne.d: Likewise.
	* gas/i386/x86-64-avx512dq-rcigru-intel.d: Likewise.
	* gas/i386/x86-64-avx512dq-rcigru.d: Likewise.
	* gas/i386/x86-64-avx512dq-rcigrz-intel.d: Likewise.
	* gas/i386/x86-64-avx512dq-rcigrz.d: Likewise.
	* gas/i386/x86-64-avx512er-rcig.s: Likewise.
	* gas/i386/x86-64-avx512er-rcigrd-intel.d: Likewise.
	* gas/i386/x86-64-avx512er-rcigrd.d: Likewise.
	* gas/i386/x86-64-avx512er-rcigrne-intel.d: Likewise.
	* gas/i386/x86-64-avx512er-rcigrne.d: Likewise.
	* gas/i386/x86-64-avx512er-rcigru-intel.d: Likewise.
	* gas/i386/x86-64-avx512er-rcigru.d: Likewise.
	* gas/i386/x86-64-avx512er-rcigrz-intel.d: Likewise.
	* gas/i386/x86-64-avx512er-rcigrz.d: Likewise.
	* gas/i386/x86-64-avx512f-rcig.s: Likewise.
	* gas/i386/x86-64-avx512f-rcigrd-intel.d: Likewise.
	* gas/i386/x86-64-avx512f-rcigrd.d: Likewise.
	* gas/i386/x86-64-avx512f-rcigrne-intel.d: Likewise.
	* gas/i386/x86-64-avx512f-rcigrne.d: Likewise.
	* gas/i386/x86-64-avx512f-rcigru-intel.d: Likewise.
	* gas/i386/x86-64-avx512f-rcigru.d: Likewise.
	* gas/i386/x86-64-avx512f-rcigrz-intel.d: Likewise.
	* gas/i386/x86-64-avx512f-rcigrz.d: Likewise.
	* gas/i386/i386.exp: Run new tests.
2014-09-16 08:45:28 -07:00
Kuan-Lin Chen 1c8f6a4d1f NDS32: Code refactoring of relaxation.
Refactor each relaxation pattern to raise the maintainability.
In origin, all patterns is analysed in nds32_elf_relax_section,
so it is hard to debug and maintain.  Therefore, we classify all
patterns into different functions in this patch.
Moreover, we adjust all optimizations into nds32_elf_relax_section
to take these optimizations in turn.  This can promise all relaxation
being done after calling gld${EMULATION_NAME}_after_allocation.
2014-09-16 13:08:00 +08:00
H.J. Lu a50942089d Rename OPTION_omit_lock_prefix to OPTION_OMIT_LOCK_PREFIX
* config/tc-i386.c (OPTION_omit_lock_prefix): Renamed to ...
	(OPTION_OMIT_LOCK_PREFIX): This.
	(md_longopts): Updated.
	(md_parse_option): Likewise.
2014-09-15 08:41:40 -07:00
Andrew Bennett 7361da2c95 Add support for MIPS R6.
bfd/
 	* aoutx.h (NAME (aout, machine_type)): Add mips32r6 and mips64r6.
 	* archures.c (bfd_architecture): Likewise.
 	* bfd-in2.h (bfd_architecture): Likewise.
 	(bfd_reloc_code_real): Add relocs BFD_RELOC_MIPS_21_PCREL_S2,
 	BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3 and
 	BFD_RELOC_MIPS_19_PCREL_S2.
 	* cpu-mips.c (arch_info_struct): Add mips32r6 and mips64r6.
 	* elf32-mips.c: Define relocs R_MIPS_PC21_S2, R_MIPS_PC26_S2
 	R_MIPS_PC18_S3, R_MIPS_PC19_S2, R_MIPS_PCHI16 and R_MIPS_PCLO16.
 	(mips_reloc_map): Add entries for BFD_RELOC_MIPS_21_PCREL_S2,
 	BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3,
 	BFD_RELOC_MIPS_19_PCREL_S2, BFD_RELOC_HI16_S_PCREL and
 	BFD_RELOC_LO16_PCREL.
 	* elf64-mips.c: Define REL, and RELA relocations R_MIPS_PC21_S2,
	R_MIPS_PC26_S2, R_MIPS_PC18_S3, R_MIPS_PC19_S2, R_MIPS_PCHI16
	and R_MIPS_PCLO16.
 	(mips_reloc_map): Add entries for BFD_RELOC_MIPS_21_PCREL_S2,
 	BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3,
 	BFD_RELOC_MIPS_19_PCREL_S2, BFD_RELOC_HI16_S_PCREL and
 	BFD_RELOC_LO16_PCREL.
 	* elfn32-mips.c: Likewise.
 	* elfxx-mips.c (MIPSR6_P): New define.
 	(mipsr6_exec_plt_entry): New array.
	(hi16_reloc_p): Add support for R_MIPS_PCHI16.
	(lo16_reloc_p): Add support for R_MIPS_PCLO16.
 	(aligned_pcrel_reloc_p): New function.
 	(mips_elf_relocation_needs_la25_stub): Add support for relocs:
 	R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
 	(mips_elf_calculate_relocation): Add support for relocs:
 	R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3, R_MIPS_PC19_S2,
 	R_MIPS_PCHI16 and R_MIPS_PCLO16.
 	(_bfd_elf_mips_mach): Add support for mips32r6 and mips64r6.
	(mips_elf_add_lo16_rel_addend): Add support for R_MIPS_PCHI16.
 	(_bfd_mips_elf_check_relocs): Add support for relocs:
	R_MIPS_PC21_S2 and R_MIPS_PC26_S2.
 	(_bfd_mips_elf_relocate_section): Add a check for unaligned
 	pc relative relocs.
 	(_bfd_mips_elf_finish_dynamic_symbol): Add support for MIPS r6
 	plt entry.
 	(mips_set_isa_flags): Add support for mips32r6 and mips64r6.
 	(_bfd_mips_elf_print_private_bfd_data): Likewise.
 	(mips_32bit_flags_p): Add support for mips32r6.
 	* libbfd.h (bfd_reloc_code_real_names): Add entries for
 	BFD_RELOC_MIPS_21_PCREL_S2, BFD_RELOC_MIPS_26_PCREL_S2,
 	BFD_RELOC_MIPS_18_PCREL_S3 and BFD_RELOC_MIPS_19_PCREL_S2.
 	* reloc.c: Document relocs BFD_RELOC_MIPS_21_PCREL_S2,
 	BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3 and
 	BFD_RELOC_MIPS_19_PCREL_S2.

binutils/
 	* readelf.c (get_machine_flags): Add support for mips32r6 and
 	mips64r6.

elfcpp/
 	* mips.h (E_MIPS_ARCH_32R6, E_MIPS_ARCH_64R6): New enum constants.

gas/
 	* config/tc-mips.c (mips_nan2008): New static global.
	(mips_flag_nan2008): Removed.
	(LL_SC_FMT): New define.
	(COP12_FMT): Updated.
	(ISA_IS_R6): New define.
 	(ISA_HAS_64BIT_REGS): Add mips64r6.
 	(ISA_HAS_DROR): Likewise.
 	(ISA_HAS_64BIT_FPRS): Add mips32r6 and mips64r6.
 	(ISA_HAS_ROR): Likewise.
 	(ISA_HAS_ODD_SINGLE_FPR): Likewise.
 	(ISA_HAS_MXHC1): Likewise.
 	(hilo_interlocks): Likewise.
 	(md_longopts): Likewise.
	(ISA_HAS_LEGACY_NAN): New define.
 	(options): Add OPTION_MIPS32R6 and OPTION_MIPS64R6.
 	(mips_ase): Add field rem_rev.
 	(mips_ases): Updated to add which ISA an ASE was removed in.
 	(mips_isa_rev): Add support for mips32r6 and mips64r6.
 	(mips_check_isa_supports_ase): Add support to check if an ASE
 	has been removed in the specified MIPS ISA revision.
 	(validate_mips_insn): Skip '-' character.
	(macro_build): Likewise.
	(mips_check_options): Prevent R6 working with fp32, mips16,
	micromips, or branch relaxation.
	(file_mips_check_options): Set R6 floating point registers to
	64 bit.  Also deal with the nan2008 option.
 	(limited_pcrel_reloc_p): Add relocs: BFD_RELOC_MIPS_21_PCREL_S2,
 	BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3,
 	BFD_RELOC_MIPS_19_PCREL_S2, BFD_RELOC_HI16_S_PCREL and
 	BFD_RELOC_LO16_PCREL.
 	(operand_reg_mask): Add support for OP_SAME_RS_RT, OP_CHECK_PREV
	and OP_NON_ZERO_REG.
 	(match_check_prev_operand): New static function.
 	(match_same_rs_rt_operand): New static function.
	(match_non_zero_reg_operand): New static function.
 	(match_operand): Added entries for: OP_SAME_RS_RT, OP_CHECK_PREV
	and OP_NON_ZERO_REG.
 	(insns_between): Added case to deal with forbidden slots.
 	(append_insn): Added support for relocs: BFD_RELOC_MIPS_21_PCREL_S2
 	and BFD_RELOC_MIPS_26_PCREL_S2.
 	(match_insn): Add support for operands -A, -B, +' and +".  Also
 	skip '-' character.
 	(mips_percent_op): Add entries for %pcrel_hi and %pcrel_lo.
 	(md_parse_option): Add support for mips32r6 and mips64r6.  Also
	update the nan option handling.
 	(md_pcrel_from): Add cases for relocs: BFD_RELOC_MIPS_21_PCREL_S2,
 	BFD_RELOC_MIPS_26_PCREL_S2.
 	(mips_force_relocation): Prevent forced relaxation for MIPS r6.
 	(md_apply_fix): Add support for relocs: BFD_RELOC_MIPS_21_PCREL_S2,
 	BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3,
 	BFD_RELOC_MIPS_19_PCREL_S2, BFD_RELOC_HI16_S_PCREL and
 	BFD_RELOC_LO16_PCREL.
 	(s_mipsset): Add support for mips32r6 and mips64r6.
	(s_nan): Update to support the new nan2008 framework.
 	(tc_gen_reloc): Add relocs: BFD_RELOC_MIPS_21_PCREL_S2,
 	BFD_RELOC_MIPS_26_PCREL_S2, BFD_RELOC_MIPS_18_PCREL_S3,
 	BFD_RELOC_MIPS_19_PCREL_S2, BFD_RELOC_HI16_S_PCREL and
 	BFD_RELOC_LO16_PCREL.
	(mips_elf_final_processing): Updated to use the mips_nan2008.
 	(mips_cpu_info_table): Add entries for mips32r6 and mips64r6.
	(macro): Enable ldc2, sdc2, ll, lld, swc2, sc, scd, cache, pref
	macros for R6.
	(mips_fix_adjustable): Make PC relative R6 relocations relative
	to the symbol and not the section.
 	* configure.ac: Add support for mips32r6 and mips64r6.
 	* configure: Regenerate.
 	* doc/c-mips.texi: Document the -mips32r6 and -mips64r6 command line
 	options.
	* doc/as.texinfo: Likewise.

gas/testsuite/
	* gas/mips/24k-triple-stores-1.s: If testing for r6 prevent
	non-supported instructions from being tested.
	* gas/mips/24k-triple-stores-2.s: Likewise.
	* gas/mips/24k-triple-stores-3.s: Likewise.
	* gas/mips/24k-triple-stores-6.s: Likewise.
	* gas/mips/beq.s: Likewise.
	* gas/mips/eva.s: Likewise.
	* gas/mips/ld-zero-3.s: Likewise.
	* gas/mips/mips32-cp2.s: Likewise.
	* gas/mips/mips32.s: Likewise.
	* gas/mips/mips4.s: Likewise.
	* gas/mips/add.s: Don't test the add instructions if r6, and
	add padding.
	* gas/mips/add.d: Check for a triple dot not a nop at the end of the
	disassembly output.
	* gas/mips/micromips@add.d: Likewise.
	* gas/mips/mipsr6@24k-branch-delay-1.d: New file.
	* gas/mips/mipsr6@24k-triple-stores-1.d: New file.
	* gas/mips/mipsr6@24k-triple-stores-2-llsc.d: New file.
	* gas/mips/mipsr6@24k-triple-stores-2.d: New file.
	* gas/mips/mipsr6@24k-triple-stores-3.d: New file.
	* gas/mips/mipsr6@24k-triple-stores-6.d: New file.
	* gas/mips/mipsr6@add.d: New file.
	* gas/mips/mipsr6@attr-gnu-4-1-msingle-float.l: New file.
	* gas/mips/mipsr6@attr-gnu-4-1-msingle-float.s: New file.
	* gas/mips/mipsr6@attr-gnu-4-1-msoft-float.l: New file.
	* gas/mips/mipsr6@attr-gnu-4-1-msoft-float.s: New file.
	* gas/mips/mipsr6@attr-gnu-4-2-mdouble-float.l: New file.
	* gas/mips/mipsr6@attr-gnu-4-2-mdouble-float.s: New file.
	* gas/mips/mipsr6@beq.d: New file.
	* gas/mips/mipsr6@bge.d: New file.
	* gas/mips/mipsr6@bgeu.d: New file.
	* gas/mips/mipsr6@blt.d: New file.
	* gas/mips/mipsr6@bltu.d: New file.
	* gas/mips/mipsr6@branch-misc-1.d: New file.
	* gas/mips/mipsr6@branch-misc-2-64.d: New file.
	* gas/mips/mipsr6@branch-misc-2pic-64.d: New file.
	* gas/mips/mipsr6@branch-misc-4-64.d: New file.
	* gas/mips/mipsr6@cache.d: New file.
	* gas/mips/mipsr6@eva.d: New file.
	* gas/mips/mipsr6@jal-svr4pic-noreorder.d: New file.
	* gas/mips/mipsr6@jal-svr4pic.d: New file.
	* gas/mips/mipsr6@ld-zero-2.d: New file.
	* gas/mips/mipsr6@ld-zero-3.d: New file.
	* gas/mips/mipsr6@loc-swap-dis.d: New file.
	* gas/mips/mipsr6@mips32-cp2.d: New file.
	* gas/mips/mipsr6@mips32-imm.d: New file.
	* gas/mips/mipsr6@mips32.d: New file.
	* gas/mips/mipsr6@mips32r2.d: New file.
	* gas/mips/mipsr6@mips4-fp.d: New file.
	* gas/mips/mipsr6@mips4-fp.l: New file.
	* gas/mips/mipsr6@mips4-fp.s: New file.
	* gas/mips/mipsr6@mips4.d: New file.
	* gas/mips/mipsr6@mips5-fp.d: New file.
	* gas/mips/mipsr6@mips5-fp.l: New file.
	* gas/mips/mipsr6@mips5-fp.s: New file.
	* gas/mips/mipsr6@mips64.d: New file.
	* gas/mips/mipsr6@msa-branch.d: New file.
	* gas/mips/mipsr6@msa.d: New file.
	* gas/mips/mipsr6@pref.d: New file.
	* gas/mips/mipsr6@relax-swap3.d: New file.
	* gas/mips/r6-64-n32.d: New file.
	* gas/mips/r6-64-n64.d: New file.
	* gas/mips/r6-64-removed.l: New file.
	* gas/mips/r6-64-removed.s: New file.
	* gas/mips/r6-64.s: New file.
	* gas/mips/r6-attr-none-double.d: New file.
	* gas/mips/r6-n32.d: New file.
	* gas/mips/r6-n64.d: New file.
	* gas/mips/r6-removed.l: New file.
	* gas/mips/r6-removed.s: New file.
	* gas/mips/r6.d: New file.
	* gas/mips/r6.s: New file.
	* gas/mips/mipsr6@mips32-dsp.d: New file.
	* gas/mips/mipsr6@mips32-dspr2.d: New file.
	* gas/mips/mipsr6@mips32r2-ill.l: New file.
	* gas/mips/mipsr6@mips32r2-ill.s: New file.
	* gas/mips/cache.s: Add r6 instruction varients.
	* gas/mips/mips.exp: Add support for the mips32r6 and mips64r6
	architectures.  Also prevent non r6 supported tests from running.
	Finally, add in support for running the new r6 tests.
	(run_dump_test_arch): Add support for mipsr6 tests.
	(run_list_test_arch): Add support for using files of the
	form arch@testname.l .

include/elf/
 	* mips.h: Add relocs: R_MIPS_PC21_S2, R_MIPS_PC26_S2, R_MIPS_PC18_S3,
 	R_MIPS_PC19_S2, R_MIPS_PCHI16 and R_MIPS_PCLO16.
 	(E_MIPS_ARCH_32R6): New define.
 	(E_MIPS_ARCH_64R6): New define.

include/opcode/
 	* mips.h (mips_operand_type): Add new entries: OP_SAME_RS_RT,
 	OP_CHECK_PREV and OP_NON_ZERO_REG.  Add descriptions for the MIPS R6
	instruction arguments: -a, -b, -d, -s, -t, -u, -v, -w, -x, -y, -A, -B,
	 +I, +O, +R, +:, +\, +", +;
	(mips_check_prev_operand): New struct.
 	(INSN2_FORBIDDEN_SLOT): New define.
 	(INSN_ISA32R6): New define.
 	(INSN_ISA64R6): New define.
	(INSN_UPTO32R6): New define.
	(INSN_UPTO64R6): New define.
	(mips_isa_table): Add INSN_UPTO32R6 and INSN_UPTO64R6.
 	(ISA_MIPS32R6): New define.
 	(ISA_MIPS64R6): New define.
 	(CPU_MIPS32R6): New define.
 	(CPU_MIPS64R6): New define.
 	(cpu_is_member): Add cases for CPU_MIPS32R6, and CPU_MIPS64R6.

ld/
 	* ldmain.c (get_emulation): Add support for -mips32r6 and -mips64r6.

opcodes/
 	* mips-dis.c (mips_arch_choices): Add entries for mips32r6 and
 	mips64r6.
 	(parse_mips_dis_option): Allow MSA and virtualization support for
 	mips64r6.
 	(mips_print_arg_state): Add fields dest_regno and seen_dest.
 	(mips_seen_register): New function.
 	(print_insn_arg): Refactored code to use mips_seen_register
	function.  Add support for OP_SAME_RS_RT, OP_CHECK_PREV and
	OP_NON_ZERO_REG.  Changed OP_REPEAT_DEST_REG case to print out
	the register rather than aborting.
 	(print_insn_args): Add length argument.  Add code to correctly
	calculate the instruction address for pc relative instructions.
	(validate_insn_args): New static function.
 	(print_insn_mips): Prevent jalx disassembling for r6.  Use
	validate_insn_args.
	(print_insn_micromips): Use validate_insn_args.
	all the arguments are valid.
	* mips-formats.h (PREV_CHECK): New define.
 	* mips-opc.c (decode_mips_operand): Add support for -a, -b, -d, -s,
 	-t, -u, -v, -w, -x, -y, -A, -B, +I, +O, +R, +:, +\, +", +;
 	(RD_pc): New define.
 	(FS): New define.
 	(I37): New define.
 	(I69): New define.
 	(mips_builtin_opcodes): Add MIPS R6 instructions.  Exclude recoded
 	MIPS R6 instructions from MIPS R2 instructions.
2014-09-15 12:15:55 +01:00
Matthew Fortune ea79f94a7a Ensure softfloat and singlefloat take precedence in consistency checks
gas/

	* tc-mips.c (check_fpabi): Move softfloat and singlefloat
	checks higher.

gas/testsuite/

	* gas/mips/attr-gnu-4-5-msingle-float.l: New file.
	* gas/mips/attr-gnu-4-5-msingle-float.s: Likewise.
	* gas/mips/attr-gnu-4-5-msoft-float.l: Likewise.
	* gas/mips/attr-gnu-4-5-msoft-float.s: Likewise.
	* gas/mips/attr-gnu-4-6-msingle-float.l: Update expected output.
	* gas/mips/attr-gnu-4-6-msoft-float.l: Likewise.
	* gas/mips/attr-gnu-4-7-msingle-float.l: Likewise.
	* gas/mips/attr-gnu-4-7-msoft-float.l: Likewise.
	* gas/mips/mips.exp: Update expected output for FP ABI 5,6,7.
2014-09-15 11:51:07 +01:00
Jose E. Marchesi 75ac3a7f57 gas: fix bumping to architectures >v9 in sparc64-* targets.
This patch fixes two related problems:

- By default gas is supposed to bump the current architecture
  (starting with v6) as it finds "higher" instructions as the
  assembling progresses.  There are four possible cases depending on
  the usage of the -A and -bump options:

  (a) No -A and -bump are specified.  In this case max_architecture
      must be the highest architecture not conflicting with the
      default architecture.  The default opcode architecture is
      indirectly set in configure.tgt and is "v9" in sparc64 systems
      (from "v9-64").  Thus the maximum architecture in sparc64
      systems must be "v9b".  No warnings are echoed when the assembly
      of an instruction bumps the current architecture.

  (b) Only -bump is specified.  This is like (a) but warnings are
      always issued when the assembly of an instruction bumps the
      current architecture.

  (c) Only -A is specified.  In this case bumping to a new
      architecture is an error.

  (d) Both -A and -bump are specified.  In this case max_architecture
      must be the highest architecture not conflicting with the
      default architecture, but warnings are only to be issued when
      bumping to an architecture higher than the architecture selected
      in the -A option.

  `max_architecture' is a global variable defined in tc-sparc.c which
  is initialized to the opcode architecture corresponding to the
  default architecture ("sparclite" for sparc-* targets and "v9" for
  sparc64-* targets).  Then in `md_begin' it is set to the highest
  non-conflicting architecture, but only when both -A and -bump are
  specified.

  Thus (a) does not work:

    $ echo "fzero %f0" | as
    {standard input}: Assembler messages:
    {standard input}:1: Error: Architecture mismatch on "fzero".
    {standard input}:1:  (Requires v9a|v9b; requested architecture is v9.)

  Neither (b):

    $ echo "fzero %f0" | as -bump
    {standard input}: Assembler messages:
    {standard input}:1: Error: Architecture mismatch on "fzero".
    {standard input}:1:  (Requires v9a|v9b; requested architecture is v9.)

  Only (d) does:

    $ echo "fzero %f0" | as -Av9 -bump
    {standard input}: Assembler messages:
    {standard input}:1: Warning: architecture bumped from "v6" to "v9a" on "fzero"

  This patch fixes that function to "upgrade" `max_architecture' also
  in the (a) and (b) cases.

  Note that this problem becomes apparent only in sparc64-* targets
  because in sparc-* targets the default architecture is the "higher"
  among the 32bit architectures ("sparclite").

- Gas maintains a set of hardware capabilities associated with each
  gas architecture, in `sparc_arch_table'.  On the other hand
  libopcodes maintains a set of hardware capabilities needed by each
  individual sparc instruction.

  When an instruction is assembled in `sparc_ip' gas checks for the
  presence of the hardware capabilities required by the instruction,
  emitting an error if some capability is missing.

  However, this mechanism does not work properly if the current
  architecture is bumped due to an instruction requiring new hw
  capabilities not present on either the default architecture or an
  architecture specified with -A:

  $ echo "fzero %f0" | as -bump
  {standard input}: Assembler messages:
  {standard input}:1: Warning: architecture bumped from "v6" to "v9a" on "fzero"
  {standard input}:1: Error: Hardware capability "vis" not enabled for "fzero".

  This patch fixes this by adding the set of required hw caps of an
  instruction if it triggers an architecture bump.

The patch has been tested in sparc64-unknown-linux-gnu.

gas/ChangeLog:

2014-09-12  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* config/tc-sparc.c (sparc_ip): Update the set of allowed hwcaps
	when bumping the current architecture.
	(md_begin): Adjust the highetst architecture level also when a
	specific architecture is not requested.
2014-09-12 15:38:21 +02:00
Andrew Bennett a9d58c068c Add mips*-img-elf* target triple.
/
	* configure.ac: Add mips*-img-elf* target triple.
	* configure: Regenerate.

bfd/
	* config.bfd: Add mips*-img-elf* target triple.

gas/
	* configure.tgt: Add mips*-img-elf* target triple.

gas/testsuite/
	* gas/mips/mips.exp: Add mips*-img-elf* target triple.

binutils/testsuite/
	* binutils-all/objcopy.exp: Add mips*-img-elf* target triple.
	* binutils-all/readelf.exp: Likewise.

ld/
	* configure.tgt: Add mips*-img-elf* target triple.

ld/testsuite/
	* ld-mips-elf/mips-elf.exp: Add support for mips*-img-elf* target
	triple.
2014-09-12 14:25:15 +01:00
Alan Modra ac4eb73652 Fix tc-i386.c -Werror=logical-not-parentheses error
* config/tc-i386.c (match_template): Remove redundant "!!" testing
	single-bit bitfields.
	(build_modrm_byte): Don't compare single-bit bitfields to "1".
2014-09-12 09:46:50 +09:30
Kyrylo Tkachov d7adf9603b [PATCH][ARM] Add Cortex-A17 support to gas
* config/tc-arm.c (arm_cpus): Add cortex-a17.
2014-09-09 10:10:00 +01:00
Jiong Wang df7b4545b2 [PATCH/AArch64] Generic support for all system registers using mrs and msr
2014-09-03  Jiong Wang  <jiong.wang@arm.com>

  opcode/
    * aarch64-tbl.h (aarch64_opcode_table): Update encoding for mrs/msr.
    * aarch64-dis-2.c: Update auto-generated file.

  gas/
    * config/tc-aarch64.c (parse_sys_reg): Remove the restriction on op0 field.

  gas/testsuite/
    * gas/aarch64/illegal.s: Update testcase.
    * gas/aarch64/illegal.d: Likewise.
    * gas/aarch64/sysreg-1.s: Likewise.
    * gas/aarch64/sysreg-1.d: Likewise.
2014-09-03 14:53:53 +01:00
Jiong Wang ee804238f0 [PATCH/AArch64] Implement LSE feature
2014-09-03  Jiong Wang  <jiong.wang@arm.com>

  gas/
	* config/tc-aarch64.c (parse_operands): Recognize PAIRREG.
	(aarch64_features): Add entry for lse extension.

  include/opcode/
	* aarch64.h (AARCH64_FEATURE_LSE): New feature added.
	(aarch64_opnd): Add AARCH64_OPND_PAIRREG.
	(aarch64_insn_class): Add lse_atomic.
	(F_LSE_SZ): New field added.
	(opcode_has_special_coder): Recognize F_LSE_SZ.

  opcode/
	* aarch64-tbl.h (QL_R4NIL): New qualifiers.
	(aarch64_feature_lse): New feature added.
	(LSE): New Added.
	(aarch64_opcode_table): New LSE instructions added.  Improve
	descriptions for ldarb/ldarh/ldar.
	(aarch64_opcode_table): Describe PAIRREG.
	* aarch64-opc.h (aarch64_field_kind): Add FLD_lse_sz.
	* aarch64-opc.c (fields): Add entry for F_LSE_SZ.
	(aarch64_print_operand): Recognize PAIRREG.
	(operand_general_constraint_met_p): Check reg pair constraints for CASP
	instructions.
	* aarch64-dis.c (aarch64_ext_regno_pair): New extractor for paired reg.
	(do_special_decoding): Recognize F_LSE_SZ.
	* aarch64-asm.c (do_special_encoding): Recognize F_LSE_SZ.

  gas/testsuite/
	* gas/aarch64/lse-atomic.d: New.
	* gas/aarch64/lse-atomic.s: Likewise.
	* gas/aarch64/illegal-lse.d: Likewise.
	* gas/aarch64/illegal-lse.l: Likewise.
	* gas/aarch64/illegal-lse.s: Likewise.
	* gas/aarch64/diagnostic.s: Check processor feature detect for lse
	instruction.
	* gas/aarch64/diagnostic.l: Likewise.
2014-09-03 14:53:53 +01:00
Jiong Wang 7f78eb340a [ARM] Update selected_cpu based on info got during parsing
gas/
    * config/tc-arm.c (aeabi_set_public_attributes): Update intended_arch based
    on the info we got during parsing.
    (arm_handle_align): Make sure the p2align expanding logic under thumb
    unchanged.

  gas/testsuite/
    * gas/arm/blx-bl-convert.d: New testcase.
    * gas/arm/blx-bl-convert.l: Warning expectation.
    * gas/arm/blx-bl-convert.s: Source file.
2014-08-26 16:18:36 +01:00
Maciej W. Rozycki 0db377d09c MIPS/gas: SAA/SAAD macro clean-ups
This change removes code duplication for the SAA macro in line with other
such macros and also adds a !microMIPS internal consistency guard as
there's no microMIPS encoding of the underlying SAA/SAAD instructions.

	* config/tc-mips.c (macro) <M_SAA_AB>: Remove duplicate code and
	jump to...
	<M_SAAD_AB>: ... here.  Assert that !microMIPS.
2014-08-26 13:18:30 +01:00
Jan-Benedict Glaw bc773698ce 2014-08-26 Jan-Benedict Glaw <jbglaw@lug-owl.de>
* config/tc-moxie.h (md_convert_frag): Silence warning.
2014-08-26 10:36:09 +02:00
Richard Henderson 49b9c17cf4 aarch64: Adjust dwarf2 encoding factors
* config/tc-aarch64.h (DWARF2_LINE_MIN_INSN_LENGTH): Set to 4.
	(DWARF2_CIE_DATA_ALIGNMENT): Set to -8.
2014-08-22 14:42:39 -07:00
Richard Henderson a2cac51cb0 aarch64: Fix CFA encoding of vector registers
* config/tc-aarch64.c (tc_aarch64_regname_to_dw2regnum): Fix
	register number for vector register types.
2014-08-22 14:41:43 -07:00
Maciej W. Rozycki fbd940576f Power/GAS: Don't set VLE annotation for non-VLE processors/instructions
Only set the VLE flag if the instruction has been pulled via the VLE
instruction set.  This way the flag is guaranteed to be set for VLE-only
instructions or for VLE-only processors, however it'll remain clear for
dual-mode instructions on dual-mode and, more importantly, standard-mode
processors.

	gas/
	* config/tc-ppc.c (md_assemble): Only set the PPC_APUINFO_VLE
	flag if both the processor and opcode flags match.

	ld/testsuite/
	* ld-powerpc/apuinfo-vle.rd: New test.
	* ld-powerpc/apuinfo-vle.s: New test source.
	* ld-powerpc/apuinfo.rd: Adjust according to GAS PPC_APUINFO_VLE
	handling change.
	* ld-powerpc/powerpc.exp: Run the new test.
2014-08-22 16:52:20 +01:00
Maciej W. Rozycki e56c722b60 ARM/gas: Fix a build failure with GCC 4.3.3
cc1: warnings being treated as errors
.../gas/config/tc-arm.c: In function 'add_to_lit_pool':
.../gas/config/tc-arm.c:3193: error: 'imm1' may be used uninitialized in this function

	* config/tc-arm.c (add_to_lit_pool): Preinitialize `imm1'.
2014-08-22 16:31:10 +01:00
Maciej W. Rozycki 83e12debff GAS: Replace leading spaces with tabs across dw2gencfi.c
* dw2gencfi.c (make_debug_seg): Replace leading spaces with tabs.
	(dot_cfi_val_encoded_addr, output_cfi_insn): Likewise.
	(output_cie, cfi_change_reg_numbers, cfi_finish): Likewise.
2014-08-20 20:41:37 +01:00
Kyrylo Tkachov aacf0b33aa [ARM] Fix vcmp with #0.0
* config/tc-arm.c (parse_ifimm_zero): New function.
	(enum operand_parse_code): Add OP_RSVD_FI0 value.
	(parse_operands): Handle OP_RSVD_FI0.
	(asm_opcode_insns): Use RSVD_FI0 for second operand of vcmp, vcmpe.

	* gas/arm/ual-vcmp.s: New file.
	* gas/arm/ual-vcmp.d: Likewise.
	* gas/arm/vcmp-zero-bad.s: Likewise.
	* gas/arm/vcmp-zero-bad.d: Likewise.
	* gas/arm/vcmp-zero-bad.l: Likewise.
2014-08-20 16:49:53 +01:00
Alan Modra 37186264f3 Fix typo in f7f2534e
* Makefile.am: Typo fix.
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
2014-08-20 10:01:53 +09:30
Nick Clifton f7f2534e71 This patch adds support for FreeBSD ARM in gas.
Before FreeBSD-8 there was/is no arm support from the OS side.
FreeBSD-9.x added ARM support but only for the OABI.
From FreeBSD-10 upwards there is EABI support.

    * Makefile.am: Add FreeBSD ARM support.
    * Mafefile.in: Regenerate.
    * configure.tgt: Add FreeBSD ARM support.
    * config/te-armfbsdeabi.h: New file.
    * config/te-armfbsdvfp.h: Likewise.
2014-08-19 15:51:43 +01:00
Alan Modra 2974be626b Fix --diable-shared --enable-plugins build breakage
Directories that don't use libtool need to add -ldl (on most *nix
hosts) to provide dlopen for libbfd.

config/
	* plugins.m4 (AC_PLUGINS): If plugins are enabled, add -ldl to
	LIBS via AC_SEARCH_LIBS.
gdb/
	* acinclude.m4 (GDB_AC_CHECK_BFD): Don't add -ldl.
	* config.in: Regenerate.
sim/ppc/
	* configure.ac: Invoke AC_PLUGINS.
	* config.in: Regenerate.

and regen lots of configure files.
2014-08-19 21:59:56 +09:30
Nick Clifton 3ce3a066e1 This fixes the processing of BFD_RELOC_RL78_DIFF fixups when the size is less
than 4.  This affects DWARF debug info generation in particular.

	* config/tc-rl78.c (md_apply_fix): Correct handling of small sized
	RELOC_RL78_DIFF fixups.
2014-08-18 17:34:03 +01:00
Alan Modra 1e53931944 Cast result of TC_PARSE_CONS_EXPRESSION
* read.c (parse_mri_cons): Warning fix.
2014-08-18 09:32:44 +09:30
Alan Modra b879806f2f configury changes to make ld plugin support controlled by --enable-plugins
This also makes --enable-plugins default to on for hosts that can
support plugins, so we have consistent lto toolchain support.  The
ACX_LARGEFILE moves aren't strictly necessary, but are harmless and
will be necessary if plugin support is extended to more hosts via
libtool's dlopen support.  I started down that path then decided it
was more work than I was interested in doing.  (ACX_LARGEFILE invokes
AC_PLUGINS.)

config/
	* plugins.m4: Test for dlfcn.h or windows.h here to set default
	for --enable-plugins.  Report error if someone tries to enable
	plugins on a host we don't support.
bfd/
	* configure.ac: Delete redundant plugin related checks.
	* configure: Regenerate.
binutils/
	* configure.ac: Move ACX_LARGEFILE after LT_INIT.
	* config.in: Regenerate.
	* configure: Regenerate.
gas/
	* configure.ac: Move ACX_LARGEFILE after LT_INIT.
	* config.in: Regenerate.
	* configure: Regenerate.
gprof/
	* configure.ac: Move ACX_LARGEFILE after LT_INIT.
	* configure: Regenerate.
	* gconfig.in: Regenerate.
ld/
	* configure.ac: Move AC_PROG_CC and other macros earlier.  Delete
	plugin checks now done in config/plugins.m4.
	* config.in: Regenerate.
	* configure: Regenerate.
2014-08-14 13:46:09 +09:30
Ilya Tocar d022bddd4f Add -momit_lock_prefix=[no|yes] option
This option serves as a workaround for processors, which fail on lock
prefix.

gas/
	* config/tc-i386.c (omit_lock_prefix): New.
	(output_insn): Omit lock prefix if omit_lock_prefix is true.
	(OPTION_omit_lock_prefix): New.
	(md_longopts): Add momit-lock-prefix.
	(md_parse_option): Handle momit-lock-prefix.
	(md_show_usage): Add momit-lock-prefix=[no|yes].
	* doc/c-i386.texi (momit-lock-prefix): Document.

gas/testsuite/

	* gas/i386/i386.exp: Run new tests.
	* gas/i386/omit-lock-no.d: New.
	* gas/i386/omit-lock-yes.d: Ditto.
	* gas/i386/omit-lock.s: Ditto.
2014-08-06 08:32:01 -07:00
Kaz Kojima b131d1fcfa Fix PR10378 which is SH relax bug. 2014-08-01 19:13:39 +09:00
Matthew Fortune 43885403ed [MIPS] Rename COPROC related macros
gas/

	* config/tc-mips.c: Rename INSN_LOAD_COPROC_DELAY to INSN_LOAD_COPROC
	and INSN_COPROC_MOVE_DELAY to INSN_COPROC_MOVE throughout.

include/opcode/

	* mips.h (INSN_LOAD_COPROC_DELAY): Rename to...
	(INSN_LOAD_COPROC): New define.
	(INSN_COPROC_MOVE_DELAY): Rename to...
	(INSN_COPROC_MOVE): New define.

opcodes/

	* micromips-opc.c (COD): Rename throughout to...
	(CM): New define, update to use INSN_COPROC_MOVE.
	(LCD): Rename throughout to...
	(LC): New define, update to use INSN_LOAD_COPROC.
	* mips-opc.c: Likewise.
2014-07-29 13:58:54 +01:00
Matthew Fortune 351cdf24d2 [MIPS] Implement O32 FPXX, FP64 and FP64A ABI extensions
Specification:
https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking

include/

	* elf/mips.h (PT_MIPS_ABIFLAGS, SHT_MIPS_ABIFLAGS): Define.
	(Val_GNU_MIPS_ABI_FP_OLD_64): Rename from Val_GNU_MIPS_ABI_FP_64.
	(Val_GNU_MIPS_ABI_FP_64): Redefine.
	(Val_GNU_MIPS_ABI_FP_XX): Define.
	(Elf_External_ABIFlags_v0, Elf_Internal_ABIFlags_v0): New structures.
	(AFL_REG_NONE, AFL_REG_32, AFL_REG_64, AFL_REG_128): Define.
	(AFL_ASE_DSP, AFL_ASE_DSPR2, AFL_ASE_EVA, AFL_ASE_MCU): Likewise.
	(AFL_ASE_MDMX, AFL_ASE_MIPS3D, AFL_ASE_MT, AFL_ASE_SMARTMIPS): Likewise.
	(AFL_ASE_VIRT, AFL_ASE_MSA, AFL_ASE_MIPS16): Likewise.
	(AFL_ASE_MICROMIPS, AFL_ASE_XPA): Likewise.
	(AFL_EXT_XLR, AFL_EXT_OCTEON2, AFL_EXT_OCTEONP): Likewise.
	(AFL_EXT_LOONGSON_3A, AFL_EXT_OCTEON, AFL_EXT_5900): Likewise.
	(AFL_EXT_4650, AFL_EXT_4010, AFL_EXT_4100, AFL_EXT_3900): Likewise.
	(AFL_EXT_10000, AFL_EXT_SB1, AFL_EXT_4111, AFL_EXT_4120): Likewise.
	(AFL_EXT_5400, AFL_EXT_5500, AFL_EXT_LOONGSON_2E): Likewise.
	(AFL_EXT_LOONGSON_2F): Likewise.
	(bfd_mips_elf_swap_abiflags_v0_in): Prototype.
	(bfd_mips_elf_swap_abiflags_v0_out): Likewise.
	(bfd_mips_isa_ext): Likewise.

bfd/

	* elfxx-mips.c (ABI_O32_P, MIPS_ELF_ABIFLAGS_SECTION_NAME_P): New macro.
	(mips_elf_obj_tdata): Add abiflags and abiflags_valid fields.
	(bfd_mips_elf_swap_abiflags_v0_in): New function.
	(bfd_mips_elf_swap_abiflags_v0_out): Likewise.
	(_bfd_mips_elf_section_from_shdr): Handle SHT_MIPS_ABIFLAGS.
	(_bfd_mips_elf_fake_sections): Likewise.
	(_bfd_mips_elf_always_size_sections): Handle .MIPS.abiflags.
	(_bfd_mips_elf_additional_program_headers): Account for new
	PT_MIPS_ABIFLAGS program header.
	(_bfd_mips_elf_modify_segment_map): Create PT_MIPS_ABIFLAGS segment and
	associate with .MIPS.abiflags.
	(_bfd_mips_elf_gc_mark_extra_sections): New function.
	(bfd_mips_isa_ext, update_mips_abiflags_isa): New static function.
	(infer_mips_abiflags): Likewise.
	(_bfd_mips_elf_final_link): Handle .MIPS.abiflags.
	(mips_32bit_flags_p): Moved higher.
	(mips_elf_merge_obj_attributes, _bfd_mips_fp_abi_string): Error
	checking for FP ABIs.
	(_bfd_mips_elf_merge_private_bfd_data): Restructure and add abiflags
	checks.  Check EF_MIPS_FP64 flag consistency.
	(print_mips_ases, print_mips_isa_ext): New static function.
	(print_mips_fp_abi_value, get_mips_reg_size): Likewise.
	(_bfd_mips_elf_print_private_bfd_data): Display abiflags data.
	(_bfd_mips_post_process_headers): Set EI_ABIVERSION = 3 for
	Val_GNU_MIPS_ABI_FP_64 or Val_GNU_MIPS_ABI_FP_64A.
	* elfxx-mips.h (_bfd_mips_elf_gc_mark_extra_sections): New prototype.
	* elf32-mips.c (elf_backend_gc_mark_extra_sections): Implement.
	* elfn32-mips.c (elf_backend_gc_mark_extra_sections): Implement.
	* elf64-mips.c (elf_backend_gc_mark_extra_sections): Implement.

binutils/

	* readelf.c (get_mips_segment_type): Display name for PT_MIPS_ABIFLAGS.
	(get_mips_section_type_name): Display name for SHT_MIPS_ABIFLAGS.
	(display_mips_gnu_attribute): Abstracted fp abi printing to...
	(print_mips_fp_abi_value): New static function. Handle new FP ABIs.
	(print_mips_ases, print_mips_isa_ext): New static functions.
	(get_mips_reg_size): Likewise.
	(process_mips_specific): Display abiflags data.

elfcpp/

	* elfcpp.h (PT_MIPS_ABIFLAGS): New program header type.

gas/

	* config/tc-mips.c (mips_flags_frag): New static global.
	(struct mips_set_options): Add oddspreg field.
	(file_mips_opts, mips_opts): Initialize oddspreg.
	(ISA_HAS_ODD_SINGLE_FPR): Add CPU argument and update for R5900 and
	Loongson-3a.
	(enum options, md_longopts, md_parse_option): Add -mfpxx, -modd-spreg
	and -mno-odd-spreg options.
	(md_begin): Create .MIPS.abiflags section.
	(fpabi_incompatible_with, fpabi_requires): New static function.
	(check_fpabi): Likewise.
	(mips_check_options): Handle fp=xx and oddspreg restrictions.
	(file_mips_check_options): Set oddspreg by default for fp=xx.
	(mips_oddfpreg_ok): Re-write function.
	(check_regno): Check odd numbered registers regardless of FPR size.
	For fp != 32 use as_bad instead of as_warn.
	(match_float_constant): Rewrite check regarding FP register width.  Add
	support for generating constants when MXHC1 is present.  Handle fp=xx
	to comply with the ABI.
	(macro): Update M_LI_DD similarly to match_float_constant.  Generate
	MTHC1 when available.  Check that correct code can be generated for
	fp=xx and fp=64 ABIs.
	(parse_code_option, s_mipsset): Add fp=xx, oddspreg and nooddspreg
	options.
	(mips_convert_ase_flags): New static function.
	(mips_elf_final_processing): Use fpabi == Val_GNU_MIPS_ABI_FP_OLD_64
	to determine when to add the EF_MIPS_FP64 flag.  Populate the
	.MIPS.abiflags section.
	(md_mips_end): Update .gnu_attribute based on command line and .module
	as applicable.  Use check_fpabi to ensure .gnu.attribute and command
	line/.module options are consistent.
	* doc/as.texinfo: Add missing -mgp64/-mfp64 options and document new
	-mfpxx, -modd-spreg and -mno-odd-spreg options.
	* doc/c-mips.texi: Document -mfpxx, -modd-spreg, -mno-odd-spreg,
	gnu_attribute values and FP ABIs.

ld/

	* emulparams/elf32bmip.sh: Add .MIPS.abiflags.
	* emulparams/elf32bmipn32-defs.sh: Likewise.
	* emulparams/elf64bmip-defs.sh: Likewise.

opcodes/

	* micromips-opc.c (COD, LCD) New macros.
	(cfc1, ctc1): Remove FP_S attribute.
	(dmfc1, mfc1, mfhc1): Add LCD attribute.
	(dmtc1, mtc1, mthc1): Add COD attribute.
	* mips-opc.c (cfc1, cftc1, ctc, cttc1): Remove FP_S attribute.

binutils/testsuite/

	* binutils-all/readelf.s: Account for .MIPS.abiflags and
	.gnu.attributes.
	* binutils-all/readelf.ss-tmips: Likewise.
	* binutils-all/strip-3.d: Likewise.

gas/testsuite/

	* gas/mips/attr-gnu-4-0.d: New.
	* gas/mips/attr-gnu-4-0.s: Likewise.
	* gas/mips/attr-gnu-4-1-mfp32.l: Likewise.
	* gas/mips/attr-gnu-4-1-mfp32.s: Likewise.
	* gas/mips/attr-gnu-4-1-mfp64.l: Likewise.
	* gas/mips/attr-gnu-4-1-mfp64.s: Likewise.
	* gas/mips/attr-gnu-4-1-mfpxx.s: Likewise.
	* gas/mips/attr-gnu-4-1-msingle-float.l: Likewise.
	* gas/mips/attr-gnu-4-1-msingle-float.s: Likewise.
	* gas/mips/attr-gnu-4-1-msoft-float.l: Likewise.
	* gas/mips/attr-gnu-4-1-msoft-float.s: Likewise.
	* gas/mips/attr-gnu-4-1.d: Likewise.
	* gas/mips/attr-gnu-4-1.s: Likewise.
	* gas/mips/attr-gnu-4-2-mdouble-float.l: Likewise.
	* gas/mips/attr-gnu-4-2-mdouble-float.s: Likewise.
	* gas/mips/attr-gnu-4-2-msoft-float.l: Likewise.
	* gas/mips/attr-gnu-4-2-msoft-float.s: Likewise.
	* gas/mips/attr-gnu-4-2.d: Likewise.
	* gas/mips/attr-gnu-4-2.s: Likewise.
	* gas/mips/attr-gnu-4-3-mhard-float.l: Likewise.
	* gas/mips/attr-gnu-4-3-mhard-float.s: Likewise.
	* gas/mips/attr-gnu-4-3.d: Likewise.
	* gas/mips/attr-gnu-4-3.s: Likewise.
	* gas/mips/attr-gnu-4-4.l: Likewise.
	* gas/mips/attr-gnu-4-4.s: Likewise.
	* gas/mips/attr-gnu-4-5-64.l: Likewise.
	* gas/mips/attr-gnu-4-5-64.s: Likewise.
	* gas/mips/attr-gnu-4-5.d: Likewise.
	* gas/mips/attr-gnu-4-5.l: Likewise.
	* gas/mips/attr-gnu-4-5.s: Likewise.
	* gas/mips/attr-gnu-4-6-64.l: Likewise.
	* gas/mips/attr-gnu-4-6-64.s: Likewise.
	* gas/mips/attr-gnu-4-6.d: Likewise.
	* gas/mips/attr-gnu-4-6.l: Likewise.
	* gas/mips/attr-gnu-4-6.s: Likewise.
	* gas/mips/attr-gnu-4-6-msingle-float.l: Likewise.
	* gas/mips/attr-gnu-4-6-msingle-float.s: Likewise.
	* gas/mips/attr-gnu-4-6-msoft-float.l: Likewise.
	* gas/mips/attr-gnu-4-6-msoft-float.s: Likewise.
	* gas/mips/attr-gnu-4-6-noodd.l: Likewise.
	* gas/mips/attr-gnu-4-6-noodd.s: Likewise.
	* gas/mips/attr-gnu-4-7-64.l: Likewise.
	* gas/mips/attr-gnu-4-7-64.s: Likewise.
	* gas/mips/attr-gnu-4-7-msingle-float.l: Likewise.
	* gas/mips/attr-gnu-4-7-msingle-float.s: Likewise.
	* gas/mips/attr-gnu-4-7-msoft-float.l: Likewise.
	* gas/mips/attr-gnu-4-7-msoft-float.s: Likewise.
	* gas/mips/attr-gnu-4-7-odd.l: Likewise.
	* gas/mips/attr-gnu-4-7-odd.s: Likewise.
	* gas/mips/attr-gnu-4-7.d: Likewise.
	* gas/mips/attr-gnu-4-7.l: Likewise.
	* gas/mips/attr-gnu-4-7.s: Likewise.
	* gas/mips/attr-none-double.d: Likewise.
	* gas/mips/attr-none-o32-fp64.d: Likewise.
	* gas/mips/attr-none-o32-fp64-nooddspreg.d
	* gas/mips/attr-none-o32-fpxx.d: Likewise.
	* gas/mips/attr-none-single-float.d: Likewise.
	* gas/mips/attr-none-soft-float.d: Likewise.
	* gas/mips/elf_arch_mips32r3.d: Likewise.
	* gas/mips/elf_arch_mips32r5.d: Likewise.
	* gas/mips/elf_arch_mips64r3.d: Likewise.
	* gas/mips/elf_arch_mips64r5.d: Likewise.
	* gas/mips/li-d.d: Likewise.
	* gas/mips/li-d.s: Likewise.
	* gas/mips/module-check-warn.l: Likewise.
	* gas/mips/module-check-warn.s: Likewise.
	* gas/mips/module-check.d: Likewise.
	* gas/mips/module-check.s: Likewise.
	* gas/mips/module-mfp32.d: Likewise.
	* gas/mips/module-mfp32.s: Likewise.
	* gas/mips/module-mfp64.d: Likewise.
	* gas/mips/module-mfp64.s: Likewise.
	* gas/mips/module-mfp64-noodd.d: Likewise.
	* gas/mips/module-mfp64-noodd.s: Likewise.
	* gas/mips/module-mfpxx.d: Likewise.
	* gas/mips/module-mfpxx.s: Likewise.
	* gas/mips/module-msingle-float.d: Likewise.
	* gas/mips/module-msingle-float.s: Likewise.
	* gas/mips/module-msoft-float.d: Likewise.
	* gas/mips/module-msoft-float.s: Likewise.
	* gas/mips/module-set-mfpxx.d: Likewise.
	* gas/mips/module-set-mfpxx.s: Likewise.
	* gas/mips/fpxx-oddfpreg.d: Likewise.
	* gas/mips/fpxx-oddfpreg.l: Likewise.
	* gas/mips/fpxx-oddfpreg.s: Likewise.
	* gas/mips/no-odd-spreg.d: Likewise.
	* gas/mips/odd-spreg.d: Likewise.
	* gas/elf/section2.e-mips: Adjust expected output.
	* gas/mips/attr-gnu-abi-fp-1.d: Likewise.
	* gas/mips/attr-gnu-abi-msa-1.d: Likewise.
	* gas/mips/call-nonpic-1.d: Likewise.
	* gas/mips/elf_arch_mips1.d: Likewise.
	* gas/mips/elf_arch_mips2.d: Likewise.
	* gas/mips/elf_arch_mips3.d: Likewise.
	* gas/mips/elf_arch_mips32.d: Likewise.
	* gas/mips/elf_arch_mips32r2.d: Likewise.
	* gas/mips/elf_arch_mips4.d: Likewise.
	* gas/mips/elf_arch_mips5.d: Likewise.
	* gas/mips/elf_arch_mips64.d: Likewise.
	* gas/mips/elf_arch_mips64r2.d: Likewise.
	* gas/mips/elf_ase_micromips-2.d: Likewise.
	* gas/mips/elf_ase_micromips.d: Likewise.
	* gas/mips/elf_ase_mips16-2.d: Likewise.
	* gas/mips/elf_ase_mips16.d: Likewise.
	* gas/mips/module-defer-warn1.d: Likewise.
	* gas/mips/module-override.d: Likewise.
	* gas/mips/n32-consec.d: Likewise.
	* gas/mips/nan-2008-1.d: Likewise.
	* gas/mips/nan-2008-2.d: Likewise.
	* gas/mips/nan-2008-3.d: Likewise.
	* gas/mips/nan-2008-4.d: Likewise.
	* gas/mips/nan-legacy-1.d: Likewise.
	* gas/mips/nan-legacy-2.d: Likewise.
	* gas/mips/nan-legacy-3.d: Likewise.
	* gas/mips/nan-legacy-4.d: Likewise.
	* gas/mips/nan-legacy-5.d: Likewise.
	* gas/mips/tmips16-e.d: Likewise.
	* gas/mips/tmips16-f.d: Likewise.
	* gas/mips/tmipsel16-e.d: Likewise.
	* gas/mips/tmipsel16-f.d: Likewise.
	* gas/testsuite/gas/mips/mips.exp: Add new tests.

ld/testsuite/

	* ld-mips-elf/abiflags-strip1-ph.d: New.
	* ld-mips-elf/abiflags-strip2-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip3-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip4-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip5-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip6-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip7-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip8-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip9-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-0-n32-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-0-n64-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-0-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-06.d: Likewise.
	* ld-mips-elf/attr-gnu-4-07.d: Likewise.
	* ld-mips-elf/attr-gnu-4-08.d: Likewise.
	* ld-mips-elf/attr-gnu-4-1-n32-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-1-n64-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-1-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-16.d: Likewise.
	* ld-mips-elf/attr-gnu-4-17.d: Likewise.
	* ld-mips-elf/attr-gnu-4-18.d: Likewise.
	* ld-mips-elf/attr-gnu-4-2-n32-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-2-n64-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-2-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-26.d: Likewise.
	* ld-mips-elf/attr-gnu-4-27.d: Likewise.
	* ld-mips-elf/attr-gnu-4-28.d: Likewise.
	* ld-mips-elf/attr-gnu-4-3-n32-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-3-n64-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-3-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-36.d: Likewise.
	* ld-mips-elf/attr-gnu-4-37.d: Likewise.
	* ld-mips-elf/attr-gnu-4-38.d: Likewise.
	* ld-mips-elf/attr-gnu-4-4-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-46.d: Likewise.
	* ld-mips-elf/attr-gnu-4-47.d: Likewise.
	* ld-mips-elf/attr-gnu-4-48.d: Likewise.
	* ld-mips-elf/attr-gnu-4-5-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-50.d: Likewise.
	* ld-mips-elf/attr-gnu-4-52.d: Likewise.
	* ld-mips-elf/attr-gnu-4-53.d: Likewise.
	* ld-mips-elf/attr-gnu-4-54.d: Likewise.
	* ld-mips-elf/attr-gnu-4-55.d: Likewise.
	* ld-mips-elf/attr-gnu-4-56.d: Likewise.
	* ld-mips-elf/attr-gnu-4-57.d: Likewise.
	* ld-mips-elf/attr-gnu-4-58.d: Likewise.
	* ld-mips-elf/attr-gnu-4-6-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-6.s: Likewise.
	* ld-mips-elf/attr-gnu-4-60.d: Likewise.
	* ld-mips-elf/attr-gnu-4-61.d: Likewise.
	* ld-mips-elf/attr-gnu-4-62.d: Likewise.
	* ld-mips-elf/attr-gnu-4-63.d: Likewise.
	* ld-mips-elf/attr-gnu-4-64.d: Likewise.
	* ld-mips-elf/attr-gnu-4-65.d: Likewise.
	* ld-mips-elf/attr-gnu-4-66.d: Likewise.
	* ld-mips-elf/attr-gnu-4-67.d: Likewise.
	* ld-mips-elf/attr-gnu-4-68.d: Likewise.
	* ld-mips-elf/attr-gnu-4-7-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-7.s: Likewise.
	* ld-mips-elf/attr-gnu-4-70.d: Likewise.
	* ld-mips-elf/attr-gnu-4-71.d: Likewise.
	* ld-mips-elf/attr-gnu-4-72.d: Likewise.
	* ld-mips-elf/attr-gnu-4-73.d: Likewise.
	* ld-mips-elf/attr-gnu-4-74.d: Likewise.
	* ld-mips-elf/attr-gnu-4-75.d: Likewise.
	* ld-mips-elf/attr-gnu-4-76.d: Likewise.
	* ld-mips-elf/attr-gnu-4-77.d: Likewise.
	* ld-mips-elf/attr-gnu-4-78.d: Likewise.
	* ld-mips-elf/attr-gnu-4-8.s: Likewise.
	* ld-mips-elf/attr-gnu-4-81.d: Likewise.
	* ld-mips-elf/empty.s: Likewise.
	* ld-mips-elf/attr-gnu-4-00.d: Adjust expected output.
	* ld-mips-elf/attr-gnu-4-01.d: Likewise.
	* ld-mips-elf/attr-gnu-4-02.d: Likewise.
	* ld-mips-elf/attr-gnu-4-03.d: Likewise.
	* ld-mips-elf/attr-gnu-4-04.d: Likewise.
	* ld-mips-elf/attr-gnu-4-05.d: Likewise.
	* ld-mips-elf/attr-gnu-4-10.d: Likewise.
	* ld-mips-elf/attr-gnu-4-11.d: Likewise.
	* ld-mips-elf/attr-gnu-4-14.d: Likewise.
	* ld-mips-elf/attr-gnu-4-15.d: Likewise.
	* ld-mips-elf/attr-gnu-4-2.s: Likewise.
	* ld-mips-elf/attr-gnu-4-20.d: Likewise.
	* ld-mips-elf/attr-gnu-4-22.d: Likewise.
	* ld-mips-elf/attr-gnu-4-24.d: Likewise.
	* ld-mips-elf/attr-gnu-4-25.d: Likewise.
	* ld-mips-elf/attr-gnu-4-3.s: Likewise.
	* ld-mips-elf/attr-gnu-4-30.d: Likewise.
	* ld-mips-elf/attr-gnu-4-33.d: Likewise.
	* ld-mips-elf/attr-gnu-4-34.d: Likewise.
	* ld-mips-elf/attr-gnu-4-35.d: Likewise.
	* ld-mips-elf/attr-gnu-4-40.d: Likewise.
	* ld-mips-elf/attr-gnu-4-41.d: Likewise.
	* ld-mips-elf/attr-gnu-4-42.d: Likewise.
	* ld-mips-elf/attr-gnu-4-43.d: Likewise.
	* ld-mips-elf/attr-gnu-4-44.d: Likewise.
	* ld-mips-elf/attr-gnu-4-45.d: Likewise.
	* ld-mips-elf/attr-gnu-4-5.s: Likewise.
	* ld-mips-elf/attr-gnu-4-51.d: Likewise.
	* ld-mips-elf/attr-gnu-8-00.d: Likewise.
	* ld-mips-elf/attr-gnu-8-01.d: Likewise.
	* ld-mips-elf/attr-gnu-8-02.d: Likewise.
	* ld-mips-elf/attr-gnu-8-10.d: Likewise.
	* ld-mips-elf/attr-gnu-8-11.d: Likewise.
	* ld-mips-elf/attr-gnu-8-20.d: Likewise.
	* ld-mips-elf/attr-gnu-8-22.d: Likewise.
	* ld-mips-elf/jalx-2.dd: Likewise.
	* ld-mips-elf/mips16-pic-1.gd: Likewise.
	* ld-mips-elf/mips16-pic-2.gd: Likewise.
	* ld-mips-elf/mips16-pic-3.gd: Likewise.
	* ld-mips-elf/mips16-pic-4a.gd: Likewise.
	* ld-mips-elf/multi-got-no-shared.d: Likewise.
	* ld-mips-elf/nan-2008.d: Likewise.
	* ld-mips-elf/nan-legacy.d: Rework test.
	* ld-mips-elf/pic-and-nonpic-3a.gd: Likewise.
	* ld-mips-elf/pic-and-nonpic-3b.gd: Likewise.
	* ld-mips-elf/pic-and-nonpic-5b.gd: Likewise.
	* ld-mips-elf/pic-and-nonpic-6.ld: Likewise.
	* ld-mips-elf/rel32-n32.d: Likewise.
	* ld-mips-elf/rel32-o32.d: Likewise.
	* ld-mips-elf/rel64.d: Likewise.
	* ld-mips-elf/tls-multi-got-1.r: Likewise.
	* ld-elf/group.ld: Discard .MIPS.abiflags and .gnu.attributes.
	* ld-elf/orphan-region.ld: Likewise.
	* ld-elf/orphan.ld: Likewise.
	* ld-mips-elf/compressed-plt-1.ld: Likewise.
	* ld-mips-elf/dyn-sec64.ld: Likewise.
	* ld-mips-elf/got-dump-1.ld: Likewise.
	* ld-mips-elf/got-dump-2.ld: Likewise.
	* ld-mips-elf/got-page-1.ld: Likewise.
	* ld-mips-elf/mips-dyn.ld: Likewise.
	* ld-mips-elf/mips-lib.ld: Likewise.
	* ld-mips-elf/pic-and-nonpic-3a.ld: Likewise.
	* ld-mips-elf/pic-and-nonpic-3b.ld: Likewise.
	* ld-mips-elf/pic-and-nonpic-4b.ld: Likewise.
	* ld-mips-elf/pic-and-nonpic-5b.ld: Likewise.
	* ld-mips-elf/region1.t: Likewise.
	* ld-mips-elf/stub-dynsym-1.ld: Likewise.
	* ld-mips-elf/tls-hidden3.ld: Likewise.
	* ld-mips-elf/vxworks1.ld: Likewise.
	* ld-scripts/overlay-size.t: Likewise.
	* ld-mips-elf/elf-rel-got-n32-embed.d: Remove .MIPS.abiflags from
	objects.
	* ld-mips-elf/elf-rel-got-n32.d: Likewise.
	* ld-mips-elf/elf-rel-got-n64-embed.d: Likewise.
	* ld-mips-elf/elf-rel-got-n64-linux.d: Likewise.
	* ld-mips-elf/elf-rel-got-n64.d: Likewise.
	* ld-mips-elf/elf-rel-xgot-n32.d: Likewise.
	* ld-mips-elf/elf-rel-xgot-n32-embed.d: Likewise.
	* ld-mips-elf/elf-rel-xgot-n64.d: Likewise.
	* ld-mips-elf/elf-rel-xgot-n64-linux.d: Likewise.
	* ld-mips-elf/elf-rel-xgot-n64-embed.d: Likewise.
	* ld-mips-elf/mips-elf.exp: Add new tests.
2014-07-29 11:27:59 +01:00
Joel Sherrill 8a196b99a8 or1k: RTEMS target support and simplify matching
* gas/configure.tgt (or1k*-*-rtems*): Ensure a match.
	(or1k*-*-*): Use or1k* to match or1knd and or1kZ.

Signed-off-by: Christian Svensson <blue@cmd.nu>
2014-07-27 18:43:33 +02:00
Anthony Green 48494700d5 Add moxiebox target 2014-07-27 08:51:20 -04:00
Alan Modra e57e6ddc2e Prepare gas for 64-bit obstacks
Use size_t in a few places involved with obstacks, and don't include
obstack.h in files that don't use obstacks.

gas/
	* config/bfin-parse.y: Don't include obstack.h.
	* config/obj-aout.c: Likewise.
	* config/obj-coff.c: Likewise.
	* config/obj-som.c: Likewise.
	* config/tc-bfin.c: Likewise.
	* config/tc-i960.c: Likewise.
	* config/tc-rl78.c: Likewise.
	* config/tc-rx.c: Likewise.
	* config/tc-tic4x.c: Likewise.
	* expr.c: Likewise.
	* listing.c: Likewise.
	* config/obj-elf.c (elf_file_symbol): Make name_length a size_t.
	* config/tc-aarch64.c (symbol_locate): Likewise.
	* config/tc-arm.c (symbol_locate): Likewise.
	* config/tc-mmix.c (mmix_handle_mmixal): Make len_0 a size_t.
	* config/tc-score.c (s3_build_score_ops_hsh): Make len a size_t.
	(s3_build_dependency_insn_hsh): Likewise.
	* config/tc-score7.c (s7_build_score_ops_hsh): Likewise.
	(s7_build_dependency_insn_hsh): Likewise.
	* frags.c (frag_grow): Make parameter a size_t, and use size_t locals.
	(frag_new): Make parameter a size_t.
	(frag_var_init): Make max_chars and var parameters size_t.
	(frag_var, frag_variant): Likewise.
	(frag_room): Return a size_t.
	(frag_align_pattern): Make n_fill parameter a size_t.
	* frags.h: Update function prototypes.
	* symbols.c (save_symbol_name): Make name_length a size_t.
2014-07-26 21:00:50 +09:30
Ilya Tocar 90a915bf0c Add AVX512DQ instructions and their AVX512VL variants.
gas/

	* config/tc-i386.c (cpu_arch): Add .avx512dq, CPU_AVX512DQ_FLAGS.
	* doc/c-i386.texi: Document avx512dq/.avx512dq.

gas/testsuite/

	* gas/i386/avx512dq-intel.d: New.
	* gas/i386/avx512dq.d: New.
	* gas/i386/avx512dq.s: New.
	* gas/i386/avx512dq_vl-intel.d: New.
	* gas/i386/avx512dq_vl.d: New.
	* gas/i386/avx512dq_vl.s: New.
	* gas/i386/i386.exp: Run new AVX-512 tests.
	* gas/i386/x86-64-avx512dq-intel.d: New.
	* gas/i386/x86-64-avx512dq.d: New.
	* gas/i386/x86-64-avx512dq.s: New.
	* gas/i386/x86-64-avx512dq_vl-intel.d: New.
	* gas/i386/x86-64-avx512dq_vl.d: New.
	* gas/i386/x86-64-avx512dq_vl.s: New.

opcodes/

	* i386-dis-evex.h: Updated.
	* i386-dis.c (PREFIX enum): Add PREFIX_EVEX_0F54, PREFIX_EVEX_0F55,
	PREFIX_EVEX_0F56, PREFIX_EVEX_0F57, PREFIX_EVEX_0F3A16,
	PREFIX_EVEX_0F3A22, PREFIX_EVEX_0F3A50, PREFIX_EVEX_0F3A51,
	PREFIX_EVEX_0F3A56, PREFIX_EVEX_0F3A57, PREFIX_EVEX_0F3A66,
	PREFIX_EVEX_0F3A67.
	(VEX_LEN enum): Add VEX_LEN_0F92_P_2, VEX_LEN_0F93_P_2,
	VEX_W_0F92_P_2_LEN_0, VEX_W_0F93_P_2_LEN_0.
	(VEX_W enum): Add EVEX_W_0F54_P_0, EVEX_W_0F54_P_2, EVEX_W_0F55_P_0,
	EVEX_W_0F55_P_2, EVEX_W_0F56_P_0, EVEX_W_0F56_P_2, EVEX_W_0F57_P_0,
	EVEX_W_0F57_P_2, EVEX_W_0F78_P_2, EVEX_W_0F79_P_2, EVEX_W_0F7A_P_2,
	EVEX_W_0F7B_P_2, EVEX_W_0F3838_P_1, EVEX_W_0F3839_P_1,
	EVEX_W_0F3A16_P_2, EVEX_W_0F3A22_P_2, EVEX_W_0F3A50_P_2,
	EVEX_W_0F3A51_P_2, EVEX_W_0F3A56_P_2, EVEX_W_0F3A57_P_2,
	EVEX_W_0F3A66_P_2, EVEX_W_0F3A67_P_2.
	(prefix_table): Add entries for new instructions.
	(vex_len_table): Ditto.
	(vex_w_table): Ditto.
	(OP_E_memory): Update xmmq_mode handling.
	* i386-gen.c (cpu_flag_init): Add CPU_AVX512DQ_FLAGS.
	(cpu_flags): Add CpuAVX512DQ.
	* i386-init.h: Regenerared.
	* i386-opc.h (CpuAVX512DQ): New.
	(i386_cpu_flags): Add cpuavx512dq.
	* i386-opc.tbl: Add AVX512DQ instructions.
	* i386-tbl.h: Regenerate.
2014-07-22 10:23:49 -07:00
Ilya Tocar 1ba585e8f4 Add support for AVX512BW instructions and their AVX512VL versions.
gas/

	* config/tc-i386.c (cpu_arch): Add .avx512bw, CPU_AVX512BW_FLAGS.
	* doc/c-i386.texi: Document avx512bw/.avx512bw.

gas/testsuite/

	* gas/i386/avx512bw-intel.d: New.
	* gas/i386/avx512bw-opts-intel.d: New.
	* gas/i386/avx512bw-opts.d: New.
	* gas/i386/avx512bw-opts.s: New.
	* gas/i386/avx512bw-wig.s: New.
	* gas/i386/avx512bw-wig1-intel.d: New.
	* gas/i386/avx512bw-wig1.d: New.
	* gas/i386/avx512bw.d: New.
	* gas/i386/avx512bw.s: New.
	* gas/i386/avx512bw_vl-intel.d: New.
	* gas/i386/avx512bw_vl-opts-intel.d: New.
	* gas/i386/avx512bw_vl-opts.d: New.
	* gas/i386/avx512bw_vl-opts.s: New.
	* gas/i386/avx512bw_vl-wig.s: New.
	* gas/i386/avx512bw_vl-wig1-intel.d: New.
	* gas/i386/avx512bw_vl-wig1.d: New.
	* gas/i386/avx512bw_vl.d: New.
	* gas/i386/avx512bw_vl.s: New.
	* gas/i386/i386.exp: Run new AVX-512 tests.
	* gas/i386/x86-64-avx512bw-intel.d: New.
	* gas/i386/x86-64-avx512bw-opts-intel.d: New.
	* gas/i386/x86-64-avx512bw-opts.d: New.
	* gas/i386/x86-64-avx512bw-opts.s: New.
	* gas/i386/x86-64-avx512bw-wig.s: New.
	* gas/i386/x86-64-avx512bw-wig1-intel.d: New.
	* gas/i386/x86-64-avx512bw-wig1.d: New.
	* gas/i386/x86-64-avx512bw.d: New.
	* gas/i386/x86-64-avx512bw.s: New.
	* gas/i386/x86-64-avx512bw_vl-intel.d: New.
	* gas/i386/x86-64-avx512bw_vl-opts-intel.d: New.
	* gas/i386/x86-64-avx512bw_vl-opts.d: New.
	* gas/i386/x86-64-avx512bw_vl-opts.s: New.
	* gas/i386/x86-64-avx512bw_vl-wig.s: New.
	* gas/i386/x86-64-avx512bw_vl-wig1-intel.d: New.
	* gas/i386/x86-64-avx512bw_vl-wig1.d: New.
	* gas/i386/x86-64-avx512bw_vl.d: New.
	* gas/i386/x86-64-avx512bw_vl.s: New.

opcodes/

	* i386-dis-evex.h: Add new instructions (prefixes bellow).
	* i386-dis.c (fetch_data): Add EdqwS, Edb, Edw, MaskBDE.
	(enum): Add dqw_swap_mode, db_mode, dw_mode, mask_bd_mode, REG_EVEX_0F71.
	(PREFIX enum): Add PREFIX_VEX_0F4A, PREFIX_VEX_0F99, PREFIX_VEX_0F3A31,
	PREFIX_VEX_0F3A33, PREFIX_EVEX_0F60, PREFIX_EVEX_0F61, PREFIX_EVEX_0F63,
	PREFIX_EVEX_0F64, PREFIX_EVEX_0F65, PREFIX_EVEX_0F67, PREFIX_EVEX_0F68,
	PREFIX_EVEX_0F69, PREFIX_EVEX_0F6B, PREFIX_EVEX_0F71_REG_2, PREFIX_EVEX_0F71_REG_4,
	PREFIX_EVEX_0F71_REG_6, PREFIX_EVEX_0F73_REG_3, PREFIX_EVEX_0F73_REG_7,
	PREFIX_EVEX_0F74, PREFIX_EVEX_0F75, PREFIX_EVEX_0FC4, PREFIX_EVEX_0FC5,
	PREFIX_EVEX_0FD1, PREFIX_EVEX_0FD5, PREFIX_EVEX_0FD8, PREFIX_EVEX_0FD9,
	PREFIX_EVEX_0FDA, PREFIX_EVEX_0FDC, PREFIX_EVEX_0FDD, PREFIX_EVEX_0FDE,
	PREFIX_EVEX_0FE0, PREFIX_EVEX_0FE1, PREFIX_EVEX_0FE3, PREFIX_EVEX_0FE4,
	PREFIX_EVEX_0FE5, PREFIX_EVEX_0FE8, PREFIX_EVEX_0FE9, PREFIX_EVEX_0FEA,
	PREFIX_EVEX_0FEC, PREFIX_EVEX_0FED, PREFIX_EVEX_0FEE, PREFIX_EVEX_0FF1,
	PREFIX_EVEX_0FF5, PREFIX_EVEX_0FF6, PREFIX_EVEX_0FF8, PREFIX_EVEX_0FF9,
	PREFIX_EVEX_0FFC, PREFIX_EVEX_0FFD, PREFIX_EVEX_0F3800, PREFIX_EVEX_0F3804,
	PREFIX_EVEX_0F380B, PREFIX_EVEX_0F3810, PREFIX_EVEX_0F381C, PREFIX_EVEX_0F381D,
	PREFIX_EVEX_0F3820, PREFIX_EVEX_0F3826, PREFIX_EVEX_0F382B, PREFIX_EVEX_0F3830,
	PREFIX_EVEX_0F3838, PREFIX_EVEX_0F383C, PREFIX_EVEX_0F383E, PREFIX_EVEX_0F3866,
	PREFIX_EVEX_0F3875, PREFIX_EVEX_0F3878, PREFIX_EVEX_0F3879, PREFIX_EVEX_0F387A,
	PREFIX_EVEX_0F387B, PREFIX_EVEX_0F387D, PREFIX_EVEX_0F388D, PREFIX_EVEX_0F3A0F,
	PREFIX_EVEX_0F3A14, PREFIX_EVEX_0F3A15, PREFIX_EVEX_0F3A20, PREFIX_EVEX_0F3A3E,
	PREFIX_EVEX_0F3A3F, PREFIX_EVEX_0F3A42.
	(VEX_LEN enum): Add VEX_LEN_0F41_P_2, VEX_LEN_0F42_P_2, VEX_LEN_0F44_P_2,
	VEX_LEN_0F45_P_2, VEX_LEN_0F46_P_2, VEX_LEN_0F47_P_2, VEX_LEN_0F4A_P_0,
	VEX_LEN_0F4A_P_2, VEX_LEN_0F4B_P_0, VEX_LEN_0F90_P_2, VEX_LEN_0F91_P_2,
	VEX_LEN_0F92_P_3, VEX_LEN_0F93_P_3, VEX_LEN_0F98_P_2, VEX_LEN_0F99_P_0,
	VEX_LEN_0F99_P_2, VEX_LEN_0F3A31_P_2, VEX_LEN_0F3A33_P_2, VEX_W_0F41_P_2_LEN_1,
	VEX_W_0F42_P_2_LEN_1, VEX_W_0F44_P_2_LEN_0, VEX_W_0F45_P_2_LEN_1,
	VEX_W_0F46_P_2_LEN_1, VEX_W_0F47_P_2_LEN_1, VEX_W_0F4A_P_0_LEN_1,
	VEX_W_0F4A_P_2_LEN_1, VEX_W_0F4B_P_0_LEN_1, VEX_W_0F90_P_2_LEN_0,
	VEX_W_0F91_P_2_LEN_0, VEX_W_0F92_P_3_LEN_0, VEX_W_0F93_P_3_LEN_0,
	VEX_W_0F98_P_2_LEN_0, VEX_W_0F99_P_0_LEN_0, VEX_W_0F99_P_2_LEN_0,
	VEX_W_0F3A31_P_2_LEN_0, VEX_W_0F3A33_P_2_LEN_0.
	(VEX_W enum): Add EVEX_W_0F6B_P_2, EVEX_W_0F6F_P_3, EVEX_W_0F7F_P_3,
	EVEX_W_0F3810_P_1, EVEX_W_0F3810_P_2, EVEX_W_0F3811_P_2, EVEX_W_0F3812_P_2,
	EVEX_W_0F3820_P_1, EVEX_W_0F3826_P_1, EVEX_W_0F3826_P_2, EVEX_W_0F3828_P_1,
	EVEX_W_0F3829_P_1, EVEX_W_0F382B_P_2, EVEX_W_0F3830_P_1, EVEX_W_0F3866_P_2,
	EVEX_W_0F3875_P_2, EVEX_W_0F3878_P_2, EVEX_W_0F3879_P_2, EVEX_W_0F387A_P_2,
	EVEX_W_0F387B_P_2, EVEX_W_0F387D_P_2, EVEX_W_0F388D_P_2, EVEX_W_0F3A3E_P_2,
	EVEX_W_0F3A3F_P_2, EVEX_W_0F3A42_P_2.
	(prefix_table): Add entries for new instructions.
	(vex_table) : Ditto.
	(vex_len_table): Ditto.
	(vex_w_table): Ditto.
	(intel_operand_size): Add db_mode, dw_mode, dqw_swap_mode,
	mask_bd_mode handling.
	(OP_E_register): Add dqw_swap_mode, dw_mode, db_mode, mask_bd_mode
	handling.
	(OP_E_memory): Add dqw_mode, dw_mode, dqw_swap_mode, dqb_mode, db_mode
	handling.
	(OP_G): Add db_mode, dw_mode, dqw_swap_mode, mask_bd_mode handling.
	(OP_EX): Add dqw_swap_mode handling.
	(OP_VEX): Add mask_bd_mode handling.
	(OP_Mask): Add mask_bd_mode handling.
	* i386-gen.c (cpu_flag_init): Add CPU_AVX512BW_FLAGS.
	(cpu_flags): Add CpuAVX512BW.
	* i386-init.h: Regenerated.
	* i386-opc.h (CpuAVX512BW): New.
	(i386_cpu_flags): Add cpuavx512bw.
	* i386-opc.tbl: Add AVX512BW instructions.
	* i386-tbl.h: Regenerate.
2014-07-22 10:23:44 -07:00
Ilya Tocar b28d1bda54 Add support for AVX512VL. Add AVX512VL versions of AVX512F instructions.
gas/

	* config/tc-i386.c (cpu_arch): Add .avx512vl, CPU_AVX512VL_FLAGS.
	(build_vex_prefix): Don't abort on VEX.W.
	(check_VecOperands): Support BROADCAST_1TO4 and BROADCAST_1TO2.
	(check_VecOperations): Ditto.
	* doc/c-i386.texi: Document avx512vl/.avx512vl.

gas/testsuite/

	* gas/i386/avx512f_vl-intel.d: New.
	* gas/i386/avx512f_vl-opts-intel.d: New.
	* gas/i386/avx512f_vl-opts.d: New.
	* gas/i386/avx512f_vl-opts.s: New.
	* gas/i386/avx512f_vl-wig.s: New.
	* gas/i386/avx512f_vl-wig1-intel.d: New.
	* gas/i386/avx512f_vl-wig1.d: New.
	* gas/i386/avx512f_vl.d: New.
	* gas/i386/avx512f_vl.s: New.
	* gas/i386/i386.exp: Run new AVX-512 tests.
	* gas/i386/x86-64-avx512f_vl-intel.d: New.
	* gas/i386/x86-64-avx512f_vl-opts-intel.d: New.
	* gas/i386/x86-64-avx512f_vl-opts.d: New.
	* gas/i386/x86-64-avx512f_vl-opts.s: New.
	* gas/i386/x86-64-avx512f_vl-wig.s: New.
	* gas/i386/x86-64-avx512f_vl-wig1-intel.d: New.
	* gas/i386/x86-64-avx512f_vl-wig1.d: New.
	* gas/i386/x86-64-avx512f_vl.d: New.
	* gas/i386/x86-64-avx512f_vl.s: New.

opcodes/

	* i386-dis.c (intel_operand_size): Support 128/256 length in
	vex_vsib_q_w_dq_mode.
	(OP_E_memory): Add ymmq_mode handling, handle new broadcast.
	* i386-gen.c (cpu_flag_init): Add CPU_AVX512VL_FLAGS.
	(cpu_flags): Add CpuAVX512VL.
	* i386-init.h: Regenerated.
	* i386-opc.h (CpuAVX512VL): New.
	(i386_cpu_flags): Add cpuavx512vl.
	(BROADCAST_1TO4, BROADCAST_1TO2): Define.
	* i386-opc.tbl: Add AVX512VL instructions.
	* i386-tbl.h: Regenerate.
2014-07-22 10:23:40 -07:00
Joel Sherrill 3d52a869b2 Add or reactivate or1k-*-rtems*
* bfd/config.bfd (or1k-*-rtems*): Reactivate.
	* gas/configure.tgt (or1k-*-rtems*): Add.

Signed-off-by: Christian Svensson <blue@cmd.nu>
2014-07-22 01:15:41 +02:00
Ilya Tocar d3bb6b49b6 Properly handle EVEX register aliases
gas/

	* config/tc-i386.c (parse_register): Set need_vrex.

gas/testsuite/

	* gas/i386/x86-64-equ.d: New.
	* gas/i386/x86-64-equ.s: New.
	* gas/i386/i386.exp: Run x86-64-equ.
2014-07-17 08:54:05 -07:00
Jiong Wang 19f2f6a9c4 [ARM] Fix 32-bit host build failure.
gas/
    * config/tc-arm.c (add_to_lit_pool): Use "inst.operands[1].imm" for * sign
    extension.  Casting the type of imm1 and imm2 to offsetT.  Fix one logic
    error when checking X_op.
2014-07-15 10:15:43 +01:00
Andreas Schwab ea7cc5bfc8 Don't complain about dbCC to long branch conversion
* config/tc-m68k.c (md_convert_frag_1): Don't complain with
--pcrel about TAB (DBCCLBR, LONG) conversion.
2014-07-15 10:11:01 +02:00
Alan Modra 76bd66cfb5 Don't force "set" symbols local for PE
gas/
	* read.c (assign_symbol): Don't force "set" symbols local for PE.
gas/testsuite/
	* gas/pe/set.s, * gas/pe/set.d: New test.
	* gas/pe/pe.exp: Run it.
2014-07-12 18:50:53 +09:30
Jiong Wang 8335d6aa34 Fix PR 16722 by adding support for 8-byte vector constants.
* config/tc-arm.c (literal_pool): New field "alignment".
  (find_or_make_literal_pool): Initialize "alignment" to 2.
  (s_ltorg): Align the pool using value of "alignment"
  (parse_big_immediate): New parameter "in_exp". Return
  parsed expression if "in_exp" is not null.
  (parse_address_main): Invoke "parse_big_immediate" for
  constant parameter.
  (add_to_lit_pool): Add one parameter 'nbytes'.
  Split 8 byte entry into two 4 byte entry.
  Add padding to align 8 byte entry to 8 byte boundary.
  (encode_arm_cp_address): Generate literal pool entry if possible.
  (move_or_literal_pool): Generate entry for vldr case.
  (enum lit_type): New enum type.
  (do_ldst): Use new enum type.
  (do_ldstv4): Likewise.
  (do_t_ldst): Likewise.
  (neon_write_immbits): Support Thumb-2 mode.

  * gas/arm/ldconst.s: Add test cases for symbol literal.
  * gas/arm/ldconst.d: Likewise.
  * gas/arm/vldconst.s: Add test cases for vldr.
  * gas/arm/thumb2_vpool.s: Likewise.
  * gas/arm/vldconst.d: New pattern for little-endian.
  * gas/arm/thumb2_vpool.d: Likewise.
  * gas/arm/vldconst_be.d: New pattern for big-endian.
  * gas/arm/thumb2_vpool_be.d: Likewise.
2014-07-08 12:14:56 +01:00
Barney Stratford 75f580857a Adds support for writing values to AVR system I/O registers.
* elf32-avr.c: Handle R_AVR_PORT5 and R_AVR_PORT6.
	* reloc.c: Add BFD_RELOC_AVR_PORT5 and BFD_RELOC_AVR_PORT6.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.

	* avr.h: Add R_AVR_PORT5 and R_AVR_PORT6.

	* config/tc-avr.c (avr_operand): Permit referring to r26-r31 by
	name as [xyz][hl].  Permit using a symbol whoes name begins with
	`r' to refer to a register.
	Allow arbitrary expressions for the P and p operators.
	(md_apply_fix): Check the BFD_RELOC_AVR_PORT5 and
	BFD_RELOC_AVR_PORT6 relocations.
2014-07-07 16:15:19 +01:00
Alan Modra 1110793abe Update "configure.in" in comments and doco
bfd/
	* Makefile.am: Update "configure.in" comments.
	* PORTING: Likewise.
	* aoutx.h: Likewise.
	* configure.host: Likewise.
	* doc/bfdint.texi: Likewise.
	* targets.c: Likewise.
	* warning.m4: Likewise.
	* Makefile.in: Regenerate.
gas/
	* doc/internals.texi: Update "configure.in" comments.
	* acinclude.m4: Likewise.
	* config/tc-sparc.c: Likewise.
ld/
	* configure.ac: Update "configure.in" comments.
	* configure: Regenerate.
2014-07-04 15:06:40 +09:30
Alan Modra 35eafcc71b Rename configure.in to configure.ac
bfd/
	* configure.ac: Rename from configure.in.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
	* doc/Makefile.in: Regenerate.
opcodes/
	* configure.ac: Rename from configure.in.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
binutils/
	* configure.ac: Rename from configure.in.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
	* doc/Makefile.in: Regenerate.
gas/
	* configure.ac: Rename from configure.in.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
	* doc/Makefile.in: Regenerate.
gprof/
	* configure.ac: Rename from configure.in.
	* configure.ac: Rename from configure.in.
	* Makefile.in: Regenerate.
	* gconfig.in: Regenerate.
ld/
	* configure.ac: Rename from configure.in.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
2014-07-04 13:40:28 +09:30
Alan Modra 82b57a900f Remove some more bfd/configure.in dependencies
Missed from 2e98a7bd

bfd/
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove configure.in.
	* Makefile.in: Regenerate.
gas/
	* doc/Makefile.am (CONFIG_STATUS_DEPENDENCIES): Delete.
	* doc/Makefile.in: Regenerate.
2014-07-04 13:25:49 +09:30
Alan Modra 2e98a7bd88 Use modern AC_INIT in configure.in
This removes usage of the obsolete AC_INIT and AM_INIT_AUTOMAKE in all
binutils configure.in files.  The BFD version is now in bfd/version.m4
rather than bfd/configure.in, which allows automake to automatically
track this dependency.

bfd/
	* version.m4: New file.
	* configure.in: Include version.m4.
	(AC_INIT): Update.
	* Makefile.am (RELEASE): Delete.
	(bfdver.h): Depend on development.sh, use instead of RELEASE.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
opcodes/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
binutils/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
gas/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* configure.com: Get bfd version from bfd/version.m4.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
gprof/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
ld/
	* configure.in: Include bfd/version.m4.
	(AC_INIT, AM_INIT_AUTOMAKE): Use modern form.
	(BFD_VERSION): Delete.
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
2014-07-04 12:41:26 +09:30
Barney Stratford f36e88862f Add support for the AVR Tiny series of microcontrollers.
* archures.c: add avrtiny architecture for avr target.
	* bfd-in2.h: Regenerate.
	* cpu-avr.c (arch_info_struct): add avrtiny arch info.
	* elf32-avr.c (elf_avr_howto_table): new relocation R_AVR_LDS_STS_16
	added for 16 bit LDS/STS instruction of avrtiny arch.
	(avr_reloc_map): reloc R_AVR_LDS_STS_16 is mapped to
	BFD_RELOC_AVR_LDS_STS_16.
	(bfd_elf_avr_final_write_processing): select machine number avrtiny arch.
	(elf32_avr_object_p): set machine number for avrtiny arch.
	* libbfd.h: Regenerate.
	* reloc.c: Add documentation for BFD_RELOC_AVR_LDS_STS_16 reloc.

         * config/tc-avr.c (mcu_types): Add avrtiny arch.
	Add avrtiny arch devices attiny4, attiny5, attiny9, attiny10, attiny20
	and attiny40.
	(md_show_usage): Add avrtiny arch in usage message.
	(avr_operand): validate and issue error for invalid register for avrtiny.
	add new reloc exp for 16 bit lds/sts instruction.
	(md_apply_fix): check 16 bit lds/sts operand for out of range and encode.
	(md_assemble): check ISA for arch and issue diagnostic.

	* include/elf/avr.h (E_AVR_MACH_AVRTINY): define avrtiny machine number.
	(R_AVR_LDS_STS_16): define 16 bit lds/sts reloc number.
	* include/opcode/avr.h (AVR_ISA_TINY): define avrtiny specific ISA.
	(AVR_ISA_2xxxa): define ISA without LPM.
	(AVR_ISA_AVRTINY): define avrtiny arch ISA.
	Add doc for contraint used in 16 bit lds/sts.
	Adjust ISA group for icall, ijmp, pop and push.
	Add 16 bit lds/sts encoding and update 32 bit lds/sts constraints.
	* opcodes/avr-dis.c (avr_operand): Handle constraint j for 16 bit lds/sts.
	(print_insn_avr): do not select opcode if insn ISA is avrtiny and machine
	is not avrtiny.

	* Makefile.am (ALL_EMULATION_SOURCES): add avrtiny emulation source.
	(eavrtiny.c): add rules for avrtiny emulation source.
	* Makefile.in: Regenerate.
	* configure.tgt: Add avrtiny to avr target emulations.
	* scripttempl/avrtiny.sc: New file.
	linker script template for avrtiny arch.
	* emulparams/avrtiny.sh: New file.
	emulation parameters for avrtiny arch.
2014-07-01 10:20:17 +01:00
Alan Modra a03f9b1acf Avoid cascading errors due to write_object_file change
* config/obj-macho.c (obj_mach_o_set_symbol_qualifier): Don't set
	SYM_MACHO_FIELDS_NOT_VALIDATED after reporting an error.
	(obj_mach_o_frob_label): Avoid cascading errors.
	(obj_mach_o_frob_symbol): Don't set SYM_MACHO_FIELDS_NOT_VALIDATED.
2014-06-28 00:20:14 +09:30
DJ Delorie 827dfb62b3 [rx] Make .B suffix optional when possible.
* config/rx-parse.y (BSET, BCLR, BTST, BNOT, BMCMD): Make .B
suffix optional.
2014-06-18 17:16:30 -04:00
Hans-Peter Nilsson a968e61d8e GAS: Fix MMIX err-fb-2.s regression caused by recent generic GAS changes. 2014-06-18 00:11:01 +02:00
Chris Metcalf 6d1ace6861 This fixes a bug whereby #line directives inside a macro would be ignored,
thus resulting in bad line debug information.

	PR gas/16908
	* macro.c (buffer_and_nest): Honour #line directives inside
	macros.
2014-06-17 17:21:08 +01:00
Jiong Wang c8de034b6a gas/ARM: Misses deprecated IT instruction warning for ARMv8
Add sp increment and decrement to ARMv8 IT block deprecate
  pattern.

  gas/
    * config/tc-arm.c (depr_it_insns): New check for inc/dec sp.

  gas/testsuite/
    * gas/arm/armv8-a-it-bad.s: New check for inc/dec sp.
    * gas/arm/armv8-a-it-bad.l: Likewise.
2014-06-17 10:12:52 +01:00
Hans-Peter Nilsson 29cf29a2cf GAS: Fix CRIS double-error reports caused by recent generic GAS changes. 2014-06-17 00:56:01 +02:00
Nick Clifton b97e87cc01 Fixes a problem exposed by the aarcg64/illegal.s test case - where the assembler was
generating too many error messages.

	* config/tc-aarch64.c (md_apply_fix): Ignore unused relocs.
2014-06-16 17:40:02 +01:00
Jiong Wang f4c51f600e This fixes the aarch64 assembler so that it will generate error messages when
a syntax error is detected in an optional operand.

  * config/tc-aarch64.c (END_OF_INSN): New macro.
  (parse_operands): Handle operand given and be in wrong
  format when operand is optional.

  * gas/aarch64/diagnostic.s: New test patterns.
  * gas/aarch64/diagnostic.l: Likewise.
2014-06-16 17:22:19 +01:00
Alan Modra 85024cd8bc Run write_object_file after errors
This is to fix unitialised memory access when printing listings.
Many targets don't initialise parts of insn frags or data frags that
have fixups, relying on md_apply_fix to finalise the frag.  Which is
fine normally, but means we need to run write_object_file after
errors, for listings.  Otherwise MALLOC_PERTURB_=1 causes errors like:
x86_64-linux  +FAIL: i386 mpx-inval-1
x86_64-linux  +FAIL: i386 inval-equ-1
x86_64-linux  +FAIL: i386 x86-64-mpx-inval-1

Running write_object_file after errors requires some tweaking to the
testsuite, since we then get extra errors reported from md_apply_fix.

gas/
	* write.h (subsegs_finish): Delete declaration.
	* write.c (subsegs_finish): Make static.
	(write_object_file): Call subsegs_finish from here.  Don't print
	warning and error count here..
	* as.c (main): ..do so here instead.  Remove dead code for "no
	object file generated".  Split out count strings to better support
	internationalisation.  Don't call subsegs_finish. Tidy setting of
	"keep_it".  Run write_object_file even after errors.
	(keep_it): Make static.
	* config/obj-elf.c (elf_frob_symbol): Remove assert.
	(elf_frob_file_before_adjust): Likewise.
gas/testsuite/
	* gas/elf/bad-group.s: Use %function.
	* gas/elf/bad-group.err: Expect correct line number.  Allow
	other errors.
	* gas/elf/bad-size.err: Allow other errors.  Match expected
	error somewhat more rigorously.
	* gas/i386/reloc32.l: Allow other errors.
	* gas/i386/mpx-inval-1.l: Match applied relocs.
	* gas/i386/x86-64-mpx-inval-1.l: Likewise, and nop padding.
	* gas/i386/x86-64-mpx-inval-2.l: Match nop padding, and allow
	other errors.
	* gas/macros/dot.s: Use .balign.
	* gas/macros/dot.l: Update alignment output.
	* gas/symver/symver6.l: Allow other errors.
2014-06-16 12:34:45 +09:30
Alan Modra 97d24fbbf5 Don't leave DLX the_insn uninitialised
In particular the_insn.reloc must be initialised, otherwise the early
exit cases for bad opcodes will result in cascading errors if
write_object_file is called after an error.

	* config/tc-dlx.c (machine_ip): Move initialisation of the_insn
	earlier.
2014-06-16 12:33:42 +09:30
Alan Modra 1ab668bf2a Report an error on x86 pcrel BFD_RELOC_SIZE64
* config/tc-i386.c (reloc): Don't avoid pcrel check for
	BFD_RELOC_SIZE64.  Return NO_RELOC on failing pcrel check.
2014-06-16 12:32:56 +09:30
Alan Modra 7e9def1e93 Fix unintitialised TIC6X data
MALLOC_PERTURB_=1 results in the following fails due to uninitialised
exindx data:

FAIL: C6X unwinding directives 1 (little endian)
FAIL: C6X unwinding directives 2 (big endian)
FAIL: C6X unwinding directives 3 (segment change)
FAIL: ld-tic6x/unwind-1
FAIL: ld-tic6x/unwind-2
FAIL: ld-tic6x/unwind-3
FAIL: ld-tic6x/unwind-4
FAIL: ld-tic6x/unwind-6

	* config/tc-tic6x.c (s_tic6x_ehtype): Clear after frag_more.
	(tic6x_output_exidx_entry): Likewise.
	(md_apply_fix): Simplify 1 byte md_number_to_chars.
2014-06-16 12:31:53 +09:30
Alan Modra 6e210b4129 Fix TIC54X buffer overruns
MALLOC_PERTURB_=1 results in "FAIL: c54x macros".

	* config/tc-tic54x.c (tic54x_mlib): Don't write garbage past
	end of archive to temp file.
	(tic54x_start_line_hook): Start scan for parallel on next line,
	not one char into next line (which may overrun the buffer).
2014-06-16 12:30:53 +09:30
Alan Modra ee0738df02 Fix uninitialised VAX insn
MALLOC_PERTURB_=1 results in "FAIL: VAX ELF relocations", due to object
file being emitted with uninitialised fields.  Since these fields had
RELA relocs the field value won't be used at final link time, so the
problem is only seen in relocatable object files.

This rewrite of md_apply_fix clears all fields with relocs, whereas
before some fields had non-zero values.

gas/
	* config/tc-vax.c (md_apply_fix): Rewrite.
	(tc_gen_reloc, vax_cons, vax_cons_fix_new): Style: Use NO_RELOC
	define rather than the equivalent BFD_RELOC_NONE.
gas/testsuite/
	* gas/vax/elf-rel.d: Update.
2014-06-16 12:29:52 +09:30
Alan Modra 4b1a927e92 Fix uninitialised ARM data
MALLOC_PERTURB_=1 results in "FAIL: PIC" on arm-vxworks, due to garbage
in words with got relocs.

	* config/tc-arm.c (s_arm_elf_cons): Initialise after frag_more.
	(md_apply_fix): Delete now unnecessary zeroing for BFD_RELOC_ARM_GOT*
	and BFD_RELOC_ARM_TLS* relocs.  Simplify BFD_RELOC_8 case.
2014-06-16 12:26:38 +09:30
Alan Modra 44ed9ef26f Fix uninitialised CRIS insn
gas/
	* config/tc-cris.c (md_create_long_jump): Follow "short" jump
	with a nop rather than leaving uninitialised.
gas/testsuite/
	* gas/cris/rd-bkw4v32.d: Update.
2014-06-16 12:23:54 +09:30
Chen Gang f26c187e29 Fix seg-faults when fetching the frags of local symbols.
* config/tc-score7.c: (s7_b32_relax_to_b16): Use symbol_get_frag() to access a symbol's frag.
	* config/tc-score.c (s3_relax_branch_inst16): Likewise.
	(s3_relax_cmpbranch_inst32): Likewise.
2014-06-13 16:07:21 +01:00
Chen Gang 2132b4072f A simple replacement of sprintf (xxx, "%s", xxx) with strcpy.
* config/tc-score7.c: Replace sprintf with strcpy where
	appropriate.
2014-06-13 15:52:55 +01:00
Alan Modra a47622ac1b Allow both signed and unsigned fields in PowerPC cmpli insn
There are legitimate reasons to allow a signed value in a cmpli insn
field, for example to test for a "stw r1,lock@sdarel(r13)" instruction
in user code, a kernel might use
	subis r3,r3,STW_R1_0R13@ha	# subtract off high part
	cmplwi r3,lock@sdarel		# is low part accessing lock?
Since the lock@sdarel may take a range of -32768 to 32767,
the allowed range of cmpli immediate must be at least [-32768,65535].

bfd/
	* elf32-ppc.c (ppc_elf_relocate_section): Treat field of cmpli
	insn as a bitfield; Use complain_overflow_bitfield.
	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
opcodes/
	* ppc-opc.c (UISIGNOPT): Define and use with cmpli.
gas/
	* config/tc-ppc.c (ppc_insert_operand): Handle PPC_OPERAND_SIGNOPT
	on unsigned fields.  Comment on PPC_OPERAND_SIGNOPT signed fields
	in 64-bit mode.
gold/
	* powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2014-06-07 14:55:11 +09:30
Martin Storsjo 34fd659b79 [AArch64] Fix the documentation on :pg_hi21: 2014-06-06 07:29:19 +01:00
Joel Brobecker 270c993744 Make it easy to make --disable-werror the default for both binutils and gdb
The goal of this patch is to provide an easy way to make
--disable-werror the default when building binutils, or the parts
of binutils that need to get built when building GDB. In development
mode, we want to continue making -Werror the default with GCC.
But, when making releases, I think we want to make it as easy as
possible for regular users to successfully build from sources.

GDB already has this kind of feature to turn -Werror as well as
the use of the libmcheck library. As GDB Release Manager, I take
advantage of it to turn those off after having cut the branch.
I'd like to be able to do the same for the binutils bits. And
perhaps Tristan will want to do the same for his releases too
(not sure, binutils builders might be a little savvier than GDB
builders).

This patch introduces a new file, called development.sh, which
just sets a variable called $development. In our development branches
(Eg. "master"), it's set to true. But setting it to false would allow
us to change the default behavior of various development-related
features to be turned off; in this case, it turns off the use of
-Werror by default (use --enable-werror to turn it back on).

bfd/ChangeLog:

        * development.sh: New file.
        * warning.m4 (AM_BINUTILS_WARNINGS): Source bfd/development.sh.
        Make -Werror the default with GCC only if DEVELOPMENT is true.
        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add
        $(srcdir)/development.sh.
        * Makefile.in, configure: Regenerate.

binutils/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

gas/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

gold/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
        * Makefile.in, configure: Regenerate.

gprof/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

ld/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

opcodes/ChangeLog:

        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
        bfd's development.sh.
        * Makefile.in, configure: Regenerate.

gdb/ChangeLog:

        * development.sh: Delete.
        * Makefile.in (config.status): Adjust dependency on development.sh.
        * configure.ac: Adjust development.sh source call.
        * configure: Regenerate.

gdb/gdbserver/ChangeLog:

        * configure.ac: Adjust development.sh source call.
        * Makefile.in (config.status): Adjust dependency on development.sh.
        * configure: Regenerate.

Tested on x86_64-linux by building two ways: One with DEVELOPMENT
set to true, and one with DEVELOPMENT set to false. In the first
case, I could see the use of -Werror, while it disappeared in
the second case.
2014-06-05 05:47:29 -07:00
Nick Clifton 69227609dc Change -mz command line option to -my for the MSP430 port of GAS.
* config/tc-msp430.c (OPTION_WARN_INTR_NOPS): Use y instead of z.
	(OPTION_NO_WARN_INTR_NOPS): Use Y instead of Z.
	* doc/c-msp430.texi: Update command line option description.

	* gas/msp430/bad.d: Use -my not -mz.
2014-06-03 08:49:02 +01:00
Alan Modra b52855e7a0 Fix whitespace in gas listing errors and warnings
gas/
	* listing.c (listing_warning, listing_error): Add space after colon.
	* messages.c (as_warn_internal, as_bad_internal): Use the same
	string as above.
gas/testsuite/
	* gas/d30v/bittest.l: Update for changed whitespace.
	* gas/d30v/serial.l: Likewise.
	* gas/d30v/serial2.l: Likewise.
	* gas/d30v/serial2O.l: Likewise.
	* gas/d30v/warn_oddreg.l: Likewise.
	* gas/i386/inval-equ-2.l: Likewise.
	* gas/i386/mpx-inval-1.l: Likewise.
	* gas/i386/sse-check-error.l: Likewise.
	* gas/i386/x86-64-mpx-inval-1.l: Likewise.
	* gas/i386/x86-64-mpx-inval-2.l: Likewise.
	* gas/i386/x86-64-size-inval-1.l: Likewise.
	* gas/i386/x86-64-sse-check-error.l: Likewise.
2014-05-22 18:53:22 +09:30
mfortune 9096206c9a Add ChangeLog from previous MIPS .module commit 2014-05-20 23:51:06 +01:00
mfortune 153ff4340d Remove newly introduced whitespace from warnings.
* messages.c (as_warn_internal): Remove extra whitespace from
	warning messages.
2014-05-20 23:40:49 +01:00
mfortune 82bda27b2f Mark MSA as requiring FP64
gas/
	* config/tc-mips.c (FP64_ASES): Add ASE_MSA.
	(mips_after_parse_args): Do not select ASE_MSA without -mfp64.

gas/testsuite/

	* gas/mips/micromips@msa-branch.d: Rework expected output for fp64.
	* gas/mips/msa-branch.d: Likewise.
2014-05-20 23:05:03 +01:00
Mike Stump 39128ec026 * messages.c (as_warn_internal): Ensure we don't interleave output
within a single line when make -j is used.
	(as_bad_internal): Likewise.
2014-05-20 12:45:30 -07:00
Richard Sandiford 9440a90459 gas/
* config/obj-elf.h (obj_elf_seen_attribute): Declare.
	* config/obj-elf.c (recorded_attribute_info): New structure.
	(recorded_attributes): New variable.
	(record_attribute, obj_elf_seen_attribute): New functions.
	(obj_elf_vendor_attribute): Record which attributes have been seen.
2014-05-20 19:02:41 +01:00
Nick Clifton 00b32ff21f Fix MSP430 assembler to support #hi(<symbol>).
* config/tc-msp430.c (CHECK_RELOC_MSP430): Add OP parameter.
	Generate BFD_RELOC_MSP430_ABS_HI16 if vshift is 1.
	(msp430_srcoperand): Store vshift value in operand.

	* msp430.h (struct msp430_operand_s): Add vshift field.

	* gas/elf/struct.d: Expect extra output from some toolchains.
	* gas/symver/symver0.d: Likewise.
	* gas/symver/symver1.d: Likewise.
2014-05-20 10:28:42 +01:00
Nick Clifton 296a868924 Extend the fix already created for PR 16858 so that it works with x86 PE targets as well.
PR gas/16858
	* config/tc-i386.c (md_apply_fix): Improve the detection of code
	symbols for 32-bit PE targets.
2014-05-19 14:29:31 +01:00