Commit Graph

5608 Commits

Author SHA1 Message Date
Nick Clifton e3ec6cc681 Change 7-byte NOP instruction for RX target, so that it only takes 1 cycle to excute.
* config/tc-rx.c (nop_7): Recode using MAX.
2015-09-22 17:32:28 +01:00
Chen Gang dce55a03c1 config/tc-avr.c (md_section_align): Append UL for -1 to avoid the latest gcc's warning
The related warning is:

  gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/gas  -I. -I../../binutils-gdb/gas -I../bfd -I../../binutils-gdb/gas/config -I../../binutils-gdb/gas/../include -I../../binutils-gdb/gas/.. -I../../binutils-gdb/gas/../bfd -DLOCALEDIR="\"/upstream/release-avr32/share/locale\""  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -I../../binutils-gdb/gas/../zlib -g -O2 -MT tc-avr.o -MD -MP -MF .deps/tc-avr.Tpo -c -o tc-avr.o `test -f 'config/tc-avr.c' || echo '../../binutils-gdb/gas/'`config/tc-avr.c
../../binutils-gdb/gas/config/tc-avr.c: In function ‘md_section_align’:
../../binutils-gdb/gas/config/tc-avr.c:1233:43: error: left shift of negative value [-Werror=shift-negative-value]
     return ((addr + (1 << align) - 1) & (-1 << align));
                                             ^

2015-09-05  Chen Gang  <gang.chen.5i5j@gmail.com>

	* config/tc-avr.c (md_section_align): Append UL for -1 to avoid
	the latest gcc's warning.
2015-09-08 21:43:35 +08:00
Alan Modra 2e57ce7b14 More fallout from "Allow symbol and label names to be enclosed in double quotes"
Some of the TC_START_LABEL implementations need to adjust the end of
the symbol, when a colon doesn't mean a label definition.  That means
they need access to nul_char both the restore the NUL location (it may
be a quote rather than a colon) and to store the new nul_char.  Others
need adjusting to step over a potential trailing quote.

	PR gas/18581
	* config/tc-aarch64.h (TC_START_LABEL): Redefine.
	* config/tc-arm.c (tc_start_label_without_colon): Delete params.
	Use input_line_pointer directly.
	* config/tc-arm.h (TC_START_LABEL): Redefine.
	(TC_START_LABEL_WITHOUT_COLON): Redefine.
	(tc_start_label_without_colon): Update prototype.
	* config/tc-bfin.c (bfin_start_label): Delete ptr param.  Check
	for NUL instead.
	* config/tc-bfin.h (bfin_start_label): Update prototype.
	(TC_START_LABEL): Redefine.
	* config/tc-d30v.h (TC_START_LABEL): Redefine.
	* config/tc-fr30.c (restore_colon): Rewrite.
	(fr30_is_colon_insn): Add nul_char param.  Return int.  Bump
	i_l_p over quote.  Update restore_colon calls.
	* config/tc-fr30.h (TC_START_LABEL): Redefine.
	(fr30_is_colon_insn): Update prototype.
	* config/tc-m32c.c (restore_colon, m32c_is_colon_insn): As above.
	* config/tc-m32c.h (TC_START_LABEL): Redefine.
	(m32c_is_colon_insn): Update prototype.
	* config/tc-m32r.h (TC_START_LABEL): Redefine.
	* config/tc-mep.h (TC_START_LABEL): Redefine.
	* config/tc-nds32.h (TC_START_LABEL): Redefine.
	* config/tc-tic54x.c (tic54x_start_label): Replace params with
	nul_char and next_char.  Step over trailing quote.
	* config/tc-tic54x.h (TC_START_LABEL_WITHOUT_COLON): Redefine.
	(tic54x_start_label): Update prototype.
	* read.c (TC_START_LABEL): Redefine.  Update invocation.
	(TC_START_LABEL_WITHOUT_COLON): Update invocation.
	* config/tc-nios2.c (s_nios2_set): Save initial input_line_pointer
	and restore if calling s_set.  Don't restore delim again.
2015-08-27 23:19:59 +09:30
Alan Modra 2d011dc169 Fallout from "Allow symbol and label names to be enclosed in double quotes"
PR gas/18581
	* config/tc-mn10200.c (md_assemble <mdr>): Move restore_line_pointer
	call to where input line used to be restored.
	* config/tc-mn10300.c (md_assemble <usp>): Remove redundant input
	line restore.
	* config/tc-tilepro.c (parse_reg_expression): Add regname var.
2015-08-26 23:07:24 +09:30
Nick Clifton 2a7f4fa91f Add asprintf to the list of functions whose decls are checked at configure time.
PR gas/18842
	* configure.ac (AS_CHECK_DECLS): Add asprintf.
	* configure: Regenerate.
	* config.in: Regenerate.
2015-08-26 10:56:26 +01:00
Jose E. Marchesi 3807431192 Support for the sparc %pmcdper privileged register.
opcodes/ChangeLog:

2015-08-25  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* sparc-dis.c (print_insn_sparc): Handle the privileged register
	%pmcdper.

gas/ChangeLog:

2015-08-25  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* config/tc-sparc.c (priv_reg_table): New privileged register
	%pmcdper.

gas/testsuite/ChangeLog:

2015-08-25  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* gas/sparc/wrpr.s: Test writing to the privileged %pmcdper
	register.
	* gas/sparc/wrpr.d: ...and the expected result.
	* gas/sparc/rdpr.s: Test reading from the privileged %pmcdper
	register.
	* gas/sparc/rdpr.d: ...and the expected result.
2015-08-25 17:16:34 +02:00
Nick Clifton d02603dc20 Allow symbol and label names to be enclosed in double quotes.
gas	PR gas/18581
	* expr.c (get_symbol_end): Rename to get_symbol_name.  Add a
	return parameter pointing to the start of the symbol.  Allow
	symbol names enclosed in double quotes.
	(restore_line_pointer): New function.  Replace the NUL character
	inserted into the input stream with the given character.  If the
	character was a double quote, advance the input pointer.
	* expr.h (get_symbol_end): Delete.
	(get_symbol_name): Add prototype.
	(restore_line_pointer): Prototype.
	* read.h (SKIP_WHITESPACE_AFTER_NAME): New macro.
	* doc/as.texinfo (Symbol Intro): Document that symbol names can
	now be enclosed in double quotes.
	* cond.c (s_ifdef): Replace get_symbol_end with get_symbol_name.
	Use restore_line_pointer to replace the NUL in the input stream.
	Use SKIP_WHITESPACE_AFTER_NAME to skip past the end of a symbol.
	Check for the use of double quoted symbol names.
	* expr.c: Likewise.
	* config/obj-aout.c: Likewise.
	* config/obj-coff-seh.c: Likewise.
	* config/obj-coff.c: Likewise.
	* config/obj-elf.c: Likewise.
	* config/obj-evax.c: Likewise.
	* config/obj-macho.c: Likewise.
	* config/obj-som.c: Likewise.
	* config/tc-alpha.c: Likewise.
	* config/tc-arc.c: Likewise.
	* config/tc-arm.c: Likewise.
	* config/tc-dlx.c: Likewise.
	* config/tc-h8300.c: Likewise.
	* config/tc-hppa.c: Likewise.
	* config/tc-i370.c: Likewise.
	* config/tc-i386-intel.c: Likewise.
	* config/tc-i386.c: Likewise.
	* config/tc-i960.c: Likewise.
	* config/tc-ia64.c: Likewise.
	* config/tc-iq2000.c: Likewise.
	* config/tc-m32r.c: Likewise.
	* config/tc-m68hc11.c: Likewise.
	* config/tc-m68k.c: Likewise.
	* config/tc-microblaze.c: Likewise.
	* config/tc-mips.c: Likewise.
	* config/tc-mmix.c: Likewise.
	* config/tc-mn10200.c: Likewise.
	* config/tc-mn10300.c: Likewise.
	* config/tc-nios2.c: Likewise.
	* config/tc-ppc.c: Likewise.
	* config/tc-s390.c: Likewise.
	* config/tc-score.c: Likewise.
	* config/tc-score7.c: Likewise.
	* config/tc-sparc.c: Likewise.
	* config/tc-tic4x.c: Likewise.
	* config/tc-tic54x.c: Likewise.
	* config/tc-tic6x.c: Likewise.
	* config/tc-tilegx.c: Likewise.
	* config/tc-tilepro.c: Likewise.
	* config/tc-v850.c: Likewise.
	* config/tc-xtensa.c: Likewise.
	* config/tc-z80.c: Likewise.
	* dw2gencfi.c: Likewise.
	* dwarf2dbgc.: Likewise.
	* ecoff.c: Likewise.
	* read.c: Likewise.
	* stabs.c: Likewise.

tests	PR gas/18581
	* gas/all/byte.d: Disable this test.  Quoted expressions
	are now allowed in .byte directives.
	* gas/all/quoted-sym-names.s: New test.
	* gas/all/quoted-sym-names.d: Expected output.
	* gas/all/gas.exp: Run the new test.
2015-08-21 16:42:14 +01:00
Jiong Wang 4c5625238c [AArch64][5/6] GAS support TLSLD load/store relocation types
2015-08-19  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * reloc.c: New entries, including
  BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
  BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
  BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
  BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
  BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
  BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC.
  BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
  BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation types support for
  dtprel_lo12.
  (ldst_lo12_determine_real_reloc_type): Support
  BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12,
  BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
  BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12,
  BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
  BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12,
  BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
  BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12,
  BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC.
  (parse_operands): Likewise.
  (md_apply_fix): Likewise
  (aarch64_force_relocation): Likewise.
  (process_movw_reloc_info): Likewise.

gas/testsuite/
  * gas/aarch64/reloc-dtprel_lo12-ldst8.s: New testcase.
  * gas/aarch64/reloc-dtprel_lo12_nc-ldstc.s: Likewise.
  * gas/aarch64/reloc-dtprel_lo12-ldst16.s: Likewise.
  * gas/aarch64/reloc-dtprel_lo12_nc-ldst16.s: Likewise.
  * gas/aarch64/reloc-dtprel_lo12-ldst32.s: Likewise.
  * gas/aarch64/reloc-dtprel_lo12_nc-ldst32.s: Likewise.
  * gas/aarch64/reloc-dtprel_lo12-ldst64.s: Likewise.
  * gas/aarch64/reloc-dtprel_lo12_nc-ldst64.s: Likewise.
  * gas/aarch64/reloc-dtprel_lo12-ldst8.d: New expectation file.
  * gas/aarch64/reloc-dtprel_lo12_nc-ldst8.d: Likewise.
  * gas/aarch64/reloc-dtprel_lo12-ldst16.d: Likewise.
  * gas/aarch64/reloc-dtprel_lo12_nc-ldst16.d: Likewise.
  * gas/aarch64/reloc-dtprel_lo12-ldst32.d: Likewise.
  * gas/aarch64/reloc-dtprel_lo12_nc-ldst32.d: Likewise.
  * gas/aarch64/reloc-dtprel-lo12-ldst64.d: Likewise.
  * gas/aarch64/reloc-dtprel_lo12_nc-ldst64.d: Likewise.
2015-08-19 16:54:39 +01:00
Jiong Wang 49df5539f9 [AArch64][3/6] GAS support TLSLD move/add relocation types
2015-08-19  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12,
  BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0,
  BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,
  BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1,
  BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,
  BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2): New entries.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers,
  "dtprel_hi12", "dtprel_g0", "dtprel_g0_nc", "dtprel_g1",
  "dtprel_g1_nc", "dtprel_g2".
  (md_apply_fix): Support new relocation types.
  (aarch64_force_relocation): Likewise.
  (process_movw_reloc_info): Likewise.

gas/testsuite/
  * gas/aarch64/reloc-dtprel_g0.s: New testcase.
  * gas/aarch64/reloc-dtprel_g0-ilp32.s: Likewise.
  * gas/aarch64/reloc-dtprel_g0_nc.s: Likewise.
  * gas/aarch64/reloc-dtprel_g0_nc-ilp32.s: Likewise.
  * gas/aarch64/reloc-dtprel_g1.s: Likewise.
  * gas/aarch64/reloc-dtprel_g1-ilp32.s: Likewise.
  * gas/aarch64/reloc-dtprel_g1_nc.s: Likewise.
  * gas/aarch64/reloc-dtprel_g2.s: Likewise.
  * gas/aarch64/reloc-dtprel_hi12.s: Likewise.
  * gas/aarch64/reloc-dtprel_hi12-ilp32.s: Likewise.
  * gas/aarch64/reloc-dtprel_g0.d: New expectation file.
  * gas/aarch64/reloc-dtprel_g0-ilp32.d: Likewise.
  * gas/aarch64/reloc-dtprel_g0_nc.d: Likewise.
  * gas/aarch64/reloc-dtprel_g0_nc-ilp32.d: Likewise.
  * gas/aarch64/reloc-dtprel_g1.d: Likewise.
  * gas/aarch64/reloc-dtprel_g1-ilp32.d: Likewise.
  * gas/aarch64/reloc-dtprel_g1_nc.d: Likewise.
  * gas/aarch64/reloc-dtprel_g2.d: Likewise.
  * gas/aarch64/reloc-dtprel_hi12.d: Likewise.
  * gas/aarch64/reloc-dtprel_hi12-ilp32.d: Likewise.
2015-08-19 16:36:22 +01:00
Jiong Wang 13289c10e2 [AArch64][1/6] GAS support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC
2015-08-19  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC): New entry.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
  BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers.
  (md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
  (aarch64_force_relocation): Likewise.

gas/testsuite/
  * gas/aarch64/reloc-dtprel_lo12_nc.s: New testcase.
  * gas/aarch64/reloc-dtprel_lo12_nc-ilp32.s: Likewise.
  * gas/aarch64/reloc-dtprel_lo12_nc.d: New expectation file.
  * gas/aarch64/reloc-dtprel_lo12_nc-ilp32.d: Likewise.
2015-08-19 16:28:08 +01:00
Alan Modra db2ed2e0b9 Rationalize ARM .align
* gas/config/tc-arm.c (s_align): Delete.
	(md_pseudo_table): Use s_align_ptwo for "align".
	* gas/config/tc-arm.h (TC_ALIGN_ZERO_IS_DEFAULT): Define.
	* read.c (s_align): Modify for TC_ALIGN_ZERO_IS_DEFAULT.
2015-08-17 09:05:54 +09:30
Alan Modra 19c2883a9b gas 0f handling
_start:
 .byte 0f-_start
0:

Fixes
..:2: Error: floating point number invalid
..:2: Error: junk at end of line, first unrecognized character is `_'

	* expr.c (operand): Rewrite handling of operands starting with "0f".
	If atof_generic only parses "-" or "+", treat as expression.
2015-08-13 16:06:20 +09:30
Alan Modra c14c7a8a61 gas 0b vs 0b0 vs 00b
* expr.c (integer_constant): Return O_absent expression if eol.
	(operand): For targets with both LOCAL_LABELS_FB and
	NUMBERS_WITH_SUFFIX set, treat "0b" not followed by binary
	digits as a local label reference.  Correct handling of 0b prefix.
	If a suffix is not allowed, error on 0B.
2015-08-13 15:59:40 +09:30
Alan Modra 9791c25049 Correct local label doc
* doc/as.texinfo (Local Labels): Allowed range of N in local
	labels is non-negative integers, not positive integers.
2015-08-13 15:53:49 +09:30
Max Filippov b46824bd49 xtensa: add --auto-litpools option
Auto-litpools is the automated version of text-section-literals: literal
pool candidate frags are planted every N frags and during relaxation
they are turned into actual literal pools where literals are moved to
become reachable for their first reference by L32R instruction.

2015-08-12  David Weatherford  <weath@cadence.com>
gas/
	* config/tc-xtensa.c (struct litpool_frag, struct litpool_seg):
	New structures.
	(xtensa_maybe_create_literal_pool_frag): New function.
	(litpool_seg_list, auto_litpools, auto_litpool_limit)
	(litpool_buf, litpool_slotbuf): New static variables.
	(option_auto_litpools, option_no_auto_litpools)
	(option_auto_litpool_limit): New enum identifiers.
	(md_longopts): Add entries for auto-litpools, no-auto-litpools
	and auto-litpool-limit.
	(md_parse_option): Handle option_auto_litpools,
	option_no_auto_litpools and option_auto_litpool_limit.
	(md_show_usage): Add help for --[no-]auto-litpools and
	--auto-litpool-limit.
	(xtensa_mark_literal_pool_location): Record a place for literal
	pool with a call to xtensa_maybe_create_literal_pool_frag.
	(get_literal_pool_location): Find highest priority literal pool
	or convert candidate to literal pool when auto-litpools are used.
	(xg_assemble_vliw_tokens): Create literal pool after jump
	instruction.
	(xtensa_check_frag_count): Create candidate literal pool every
	auto_litpool_limit frags.
	(xtensa_relax_frag): Add jump around literals to non-empty
	literal pool.
	(xtensa_move_literals): Estimate literal pool addresses and move
	unreachable literals closer to their users, converting candidate
	to literal pool if needed.
	(xtensa_switch_to_non_abs_literal_fragment): Only emit error
	about missing .literal_position in case auto-litpools are not
	used.
	* config/tc-xtensa.h (xtensa_relax_statesE): New relaxation
	state: RELAX_LITERAL_POOL_CANDIDATE_BEGIN.
	* doc/as.texinfo (Xtensa options):  Document --auto-litpools and
	--no-auto-litpools options.
	* doc/c-xtensa.texi (Xtensa options): Likewise.

2015-08-12  Max Filippov  <jcmvbkbc@gmail.com>
gas/testsuite/
	* gas/xtensa/all.exp: Add auto-litpools to the list of xtensa
	tests.
	* gas/xtensa/auto-litpools.s: New file: auto-litpools test.
	* gas/xtensa/auto-litpools.s: New file: auto-litpools test
	result pattern.
2015-08-12 20:19:58 +03:00
Simon Dardis 40fc1451c6 [MIPS] Map 'move' to 'or'.
The MIPS assembly idiom 'move' now maps to the 'or' machine instruction. This
change affects microMIPS, MIPS32, MIPS64.

2015-08-12  Simon Dardis  <simon.dardis@imgtec.com>

opcodes/

	* micromips-opc.c (micromips_opcodes): Re-order table so that move
	based on 'or' is first.
	* mips-opc.c (mips_builtin_opcodes): Ditto.

bfd/

	* elfxx-mips.c (STUB_MOVE): Change to use 'or' only.
	(mips_o32_exec_plt0_entry, mips_n32_exec_plt0_entry,
	mips_n64_exec_plt0_entry, micromips_insn32_o32_exec_plt0_entry):
	Update to use 'or' instead of 'addu/daddu'.
	(_bfd_mips_elf_finish_dynamic_symbol): Update usage of STUB_MOVE.
	(move_insns_32): Reorder table.

gas/

	* config/tc-mips.c (move_register): Change to use 'or' only.
	(s_cpload, s_cpsetup, s_cprestore, s_cpreturn): Update to
	use or for move.

gas/testsuite/

	* gas/mips/elf-rel23.d: Update test.
	* gas/mips/elf-rel23.d: Ditto.
	* gas/mips/elf-rel23a.d: Ditto.
	* gas/mips/elf-rel23b.d: Ditto.
	* gas/mips/elf_e_flags1.d: Ditto.
	* gas/mips/elf_e_flags2.d: Ditto.
	* gas/mips/elf_e_flags3.d: Ditto.
	* gas/mips/elf_e_flags4.d: Ditto.
	* gas/mips/loc-swap-dis.d: Ditto.
	* gas/mips/micromips-insn32.d: Ditto.
	* gas/mips/micromips-noinsn32.d: Ditto.
	* gas/mips/micromips-trap.d: Ditto.
	* gas/mips/micromips.d: Ditto.
	* gas/mips/mips-abi32-pic.d: Ditto.
	* gas/mips/mips-abi32.d: Ditto.
	* gas/mips/mips-gp32-fp32-pic.d: Ditto.
	* gas/mips/mips-gp32-fp32.d: Ditto.
	* gas/mips/mips-gp32-fp64-pic.d: Ditto.
	* gas/mips/mips-gp32-fp64.d: Ditto.
	* gas/mips/mips-gp64-fp32-pic.d: Ditto.
	* gas/mips/mips-gp64-fp32.d: Ditto.
	* gas/mips/mips-gp64-fp64-pic.d: Ditto.
	* gas/mips/mips-gp64-fp64.d: Ditto.
	* gas/mips/mipsr6@loc-swap-dis.d: Ditto.
	* gas/mips/tls-o32.d: Ditto.
	* gas/mips/uld2-eb.d: Ditto.
	* gas/mips/uld2-el.d: Ditto.
	* gas/mips/ulw2-eb-ilocks.d: Ditto.
	* gas/mips/ulw2-eb.d: Ditto.
	* gas/mips/ulw2-el-ilocks.d: Ditto.
	* gas/mips/ulw2-el.d: Ditto.
	* gas/mips/move.d: New test.
	* gas/mips/move.s: Ditto.
	* gas/mips/micromips32-move.d: Ditto.
	* gas/mips/micromips32-move.s: Ditto.
	* gas/mips/mips.exp: Run the new tests.

gold/

	* mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
	lazy_stub_normal_1, lazy_stub_normal_1_n64,
	lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
	lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
	lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
	lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
	of 'addu/daddu'.

ld/testsuite/

	* ld-mips-elf/compressed-plt-1-n32-mips16.od: Update test.
	* ld-mips-elf/compressed-plt-1-n32-umips.od: Ditto.
	* ld-mips-elf/compressed-plt-1-o32-mips16-got.od: Ditto.
	* ld-mips-elf/compressed-plt-1-o32-mips16-only.od: Ditto.
	* ld-mips-elf/compressed-plt-1-o32-mips16-word.od: Ditto.
	* ld-mips-elf/compressed-plt-1-o32-mips16.od: Ditto.
	* ld-mips-elf/compressed-plt-1-o32-se.od: Ditto.
	* ld-mips-elf/compressed-plt-1-o32-umips-got.od: Ditto.
	* ld-mips-elf/compressed-plt-1-o32-umips-word.od: Ditto.
	* ld-mips-elf/compressed-plt-1-o32-umips.od: Ditto.
	* ld-mips-elf/jalx-2.dd: Ditto.
	* ld-mips-elf/mips16-pic-3.dd: Ditto.
	* ld-mips-elf/pic-and-nonpic-3a.dd: Ditto.
	* ld-mips-elf/pic-and-nonpic-3b.dd: Ditto.
	* ld-mips-elf/pic-and-nonpic-5b.dd: Ditto.
	* ld-mips-elf/pic-and-nonpic-6-n32.dd: Ditto.
	* ld-mips-elf/pic-and-nonpic-6-o32.dd: Ditto.
	* ld-mips-elf/stub-dynsym-1-10000.d: Ditto.
	* ld-mips-elf/stub-dynsym-1-2fe80.d: Ditto.
	* ld-mips-elf/stub-dynsym-1-7fff.d: Ditto.
	* ld-mips-elf/stub-dynsym-1-8000.d: Ditto.
	* ld-mips-elf/stub-dynsym-1-fff0.d: Ditto.
	* ld-mips-elf/tlsbin-o32.d: Ditto.
	* ld-mips-elf/tlsdyn-o32-1.d: Ditto.
	* ld-mips-elf/tlsdyn-o32-2.d: Ditto.
	* ld-mips-elf/tlsdyn-o32-3.d: Ditto.
	* ld-mips-elf/tlsdyn-o32.d: Ditto.
	* ld-mips-elf/tlslib-o32.d: Ditto.
2015-08-12 17:10:22 +01:00
Jiong Wang 70151fb54a [AArch64][7/8] GAS support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

include/elf/
  * aarch64.h (R_AARCH64_P32_TLSLD_ADD_DTPREL_LO12): Define.

bfd/
  * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12): New entry.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
  BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers
  "dtprel_lo12".
  (md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
  (aarch64_force_relocation): Likewise.

gas/testsuite/
  * gas/aarch64/reloc-dtprel_lo12-1.s: New testcase.
  * gas/aarch64/reloc-dtprel_lo12-ilp32-1.s: Likewise.
  * gas/aarch64/reloc-dtprel_lo12-1.d: New expectation file.
  * gas/aarch64/reloc-dtprel_lo12-ilp32-1.d: Likewise.
2015-08-11 21:26:31 +01:00
Jiong Wang a12fad50d2 [AArch64][5/8] GAS support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC): New entry.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
  BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers.
  (md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
  (aarch64_force_relocation): Likewise.

gas/testsuite/
  * gas/aarch64/reloc-tlsldm_lo12_nc-1.s: New testcase.
  * gas/aarch64/reloc-tlsldm_lo12_nc-ilp32-1.s: Likewise.
  * gas/aarch64/reloc-tlsldm_lo12_nc-1.d: New expectation file.
  * gas/aarch64/reloc-tlsldm_lo12_nc-ilp32-1.d: Likewise.
2015-08-11 21:25:51 +01:00
Jiong Wang 1107e076cf [AArch64][2/8] GAS support BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21
2015-08-11  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21): New entry.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
  BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers.
  (md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21.
  (aarch64_force_relocation): Likewise.

gas/testsuite/
  * gas/aarch64/reloc-tlsldm-page-1.s: New testcase.
  * gas/aarch64/reloc-tlsldm-page-ilp32-1.s: Likewise.
  * gas/aarch64/reloc-tlsldm-page-1.d: New expectation file.
  * gas/aarch64/reloc-tlsldm-page-ilp32-1.d: Likewise.
2015-08-11 21:24:38 +01:00
Nick Clifton eff0bc54a3 Fix compile time warning messages about constant expressions where a value is being shifted into bit 31.
PR gas/18765
	* config/tc-arm.c (move_or_literal_pool): Use U suffix to remove
	compile time warnings about constant expressions being shifted
	into bit 31.
	(do_iwmmxt_wldstd): Likewise.
	(do_iwmmxt_wrwrwr_or_imm5): Likewise.
	(md_assemble): Likewise.
2015-08-11 10:07:21 +01:00
Nick Clifton e66c3c2568 Convert 'A && (!A || B)' to 'A || B' in various places.
PR gas/18574
	* config/tc-msp430.c (msp430_operands): Rewrite if statements to
	remove redundant checks.
	(md_apply_fix): Likewise.
2015-08-11 09:49:18 +01:00
Nick Clifton d29b2a1ece Fix typo checking MMIX operands.
PR gas/18677
	* config/tc-mmix.c (md_assemble): Fix typo checking operands with
	a numeric constant value.
2015-08-11 09:43:16 +01:00
Nick Clifton 88fd0449a3 Fix typo checking number of operands.
PR gas/18678
	* config/tc-tic4x.c (tic4x_insn_check): Fix typo.
2015-08-11 09:40:02 +01:00
Nick Clifton 2b29bb41d5 Fix a typo where the same name was checked twice.
PR gas/18679
	* config/xtensa-relax.c (same_operand_name): Fix typo.
2015-08-11 09:36:57 +01:00
Hans-Peter Nilsson 8fe3f3d6af tc-arm.c: Append ULL to 0xFFFFFFFFFFFFF to avoid errors on 32-bit hosts. 2015-08-08 22:44:37 +02:00
Thomas Preud'homme edc66de9a5 2015-08-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
* doc/c-aarch64.texi (.xword): Document directive.
2015-08-04 09:39:42 +08:00
Nick Clifton d60646b958 Fix thinkos in the description of the --hash-size command line option for GAS.
* doc/as.texinfo (Overview): Add --hash-size to the synopsis and
	fix typo in its entry: @kindex -> @item.
2015-08-03 09:19:00 +01:00
Robert Suchanek c6e5c03a2c Add cores for M5100 series
gas/

	* config/tc-mips.c (mips_cpu_info_table): Add m5100 and m5101 entries.
	* doc/c-mips.texi: Document m5100 and m5101 for -march=.
2015-07-28 11:26:39 +01:00
Robert Suchanek 77403ce966 Add -march=interaptiv
gas/

	* config/tc-mips.c (mips_cpu_info_table): Add interaptiv entry.
	* doc/c-mips.text: Document -march=interaptiv.
2015-07-28 11:26:31 +01:00
H.J. Lu 37a42ee9ad Regenerate configure files
bfd/

	* configure: Regenerated.

binutils/

	* configure: Regenerated.

gas/

	* configure: Regenerated.

gold/

	* configure: Regenerated.

gprof/

	* configure: Regenerated.

ld/

	* configure: Regenerated.

opcodes/

	* configure: Regenerated.
2015-07-27 07:56:32 -07:00
Nick Clifton aff1a65ecb Fix the evaluation of RL78 complex relocs, by making immediate values be computed relative to a new absolute symbol.
gas	* config/tc-rl78.c (rl78_abs_sym): New local variable.
	(md_begin): Initialise the new symbol.
	(OPIMM): Define the value to be relative to the new symbol and not
	the absolute section symbol.

ld	* emulparams/elf32rl78.sh (OTHER_SECTIONS): Provide a value for
	the _-rl78_abs__ symbol.

tests	* gas/all/struct.d: Allow for extra symbols in the output.
	* gas/macros/test1.d: Likewise.
	* gas/elf/elf.exp: Add an rl78 machine.
	* gas/elf/sections2e-rl78: New file.

tests	* binutils-all/localize-hidden-1.d: Allow for extra symbols in the
	output.
        * binutils-all/strip-11.d: Skip for the RL78.
2015-07-24 16:44:27 +01:00
H.J. Lu 72f4393d8c Remove leading/trailing white spaces in ChangeLog 2015-07-24 04:16:47 -07:00
Alan Modra 511b1657d2 gas line buffer handling
This fixes a segfault when macro definitions end on the last line of a
file, and that line isn't properly terminated with a newline.  gas
used to throw away the last line in cases like this, whereas in other
cases gas added the missing newline.  So I've also made gas
consistently provide a missing newline.

	PR gas/18687
	* input-scrub.c (input_scrub_next_buffer): Rearrange and simplify
	loop.  Don't drop lines at end of file lacking a newline, add a
	newline instead.  Ensure partial_size is zero whenever
	partial_where is NULL.  Adjust buffer size for extra char.
	(input_scrub_push, input_scrub_begin): Adjust buffer size here too.
2015-07-22 22:04:28 +09:30
Matthew Wahab f33026a965 [ARM] Support correctly spelled ARMv6KZ architecture names
2015-07-20  Matthew Wahab  <matthew.wahab@arm.com>

gas/
    * NEWS: Mention corrected spelling of armv6kz.
    * config/tc-arm.c (arm_cpus): Replace ARM_ARCH_V6ZK with
    ARM_ARCH_V6KZ.
    (arm_archs): Likewise. Also add "armv6kz" and "armv6kzt2".
    * doc/c-arm.texi: Replace "armv6zk" with "armv6kz".

gas/testsuite

    * gas/arm/attr-march-armv6kz.d: New.
    * gas/arm/attr-march-armv6kzt2.d: New.

include/opcode

    * arm.h (ARM_AEXT_V6ZK): Rename to ARM_AEXT_V6KZ.
    (ARM_AEXT_V6ZKT2): Rename to ARM_AEXT_V6KZT2.
    (ARM_ARCH_V6ZK): Rename to ARM_ARCH_V6KZ.
    (ARM_ARCH_V6ZKT2): Rename to ARM_ARCH_V6KZT2.
2015-07-21 09:43:35 +01:00
Jiong Wang 6c37fedc41 [AArch64][2/3] GAS support BFD_RELOC_AARCH64_TLSLD_ADR_PREL21 2015-07-16 15:43:21 +01:00
Matthew Wahab 081e4c7d67 [ARM] Add crypto-neon-fp-armv8.1 as an fpu option
2015-07-16  Matthew Wahab  <matthew.wahab@arm.com>

gas/
  * config/tc-arm.c (arm_fpus): Add crypto-neon-fp-armv8.1.
  * doc/c-arm.texi (-mfpu=): Likewise.  Correct the entry for
  neon-fp-armv8.1.
2015-07-16 15:11:30 +01:00
James Greenhalgh 84b52b6651 [ARM] Make human parsing of "processor does not support instruction in mode" error messages easier
2015-07-16  James Greenhalgh  <james.greenhalgh@arm.com>

      gas/
	* config/tc-arm.c (md_assemble): Rephrase the "selected processor does
	not support ARM mode" error messages.

      gas/testsuite/
	* gas/arm/arch7em-bad.l: Update expected errors.
	* gas/arm/arch7m-bad.l: Likewise.
	* gas/arm/arm-idiv-bad.l: Likewise.
	* gas/arm/arm7-bad.l: Likewise.
	* gas/arm/armv1-bad.l: Likewise.
	* gas/arm/thumb-w-bad.l: Likewise.
2015-07-16 14:43:00 +01:00
H.J. Lu 189ebcf915 Make x86 Linux assembler default to gABI compliant
The default compression is gABI compliant now.  This patch makes the
x86 Linux assembler default to gABI compliant.

	* config/tc-i386.c (flag_compress_debug): Replace
	COMPRESS_DEBUG_GNU_ZLIB with COMPRESS_DEBUG_GABI_ZLIB.
2015-07-15 07:31:55 -07:00
H.J. Lu 19a7fe52ae Make default compression gABI compliant
All programs in binutils+gdb git repo now support gABI compression
with the SHF_COMPRESSED bit.  This patch makes the zlib-gabi option
as compression default for gas, gold, ld and objcopy, instead of the
zlib-gnu option whose outputs are incompatible with gABI.

binutils/

	* objcopy.c (copy_file): Set BFD_COMPRESS_GABI if not
	zlib-gnu.
	* doc/binutils.texi: Change --compress-debug-sections and
	--compress-debug-sections=zlib to zlib-gabi.

binutils/testsuite/

	* binutils-all/compress.exp: Update.

gas/

	* as.c (parse_args): Make --compress-debug-sections and
	--compress-debug-sections=zlib the same as
	--compress-debug-sections=zlib-gabi.
	* doc/as.texinfo: Change --compress-debug-sections and
	--compress-debug-sections=zlib to zlib-gabi.

gold/

	* compressed_output.cc (Output_compressed_section::set_final_data_size):
	Make --compress-debug-sections=zlib the same as
	--compress-debug-sections=zlib-gabi.
	* testsuite/Makefile.am (flagstest_compress_debug_sections.check):
	Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
	".zdebug_".
	* testsuite/Makefile.in: Regenerated.

ld/

	* emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Make
	--compress-debug-sections=zlib the same as
	--compress-debug-sections=zlib-gabi.
	* ld.texinfo: Change --compress-debug-sections=zlib to zlib-gabi.

ld/testsuite/

	* ld-elf/zlibbegin.rS: Updated to .debug_.* with the
	SHF_COMPRESSED bit.
	* ld-elf/zlibnormal.rS: Likewise.
2015-07-14 10:26:23 -07:00
Catherine Moore 3350cc01de 2015-07-09 Catherine Moore <clm@codesourcery.com>
include/
        * elf/mips/mips.h (Val_GNU_MIPS_ABI_FP_NAN2008): New.

        gas/
        * config/tc-mips.c (check_fpabi):  Handle
        VAL_GNU_MIPS_ABI_FP_NAN2008.

        binutils/
        * readelf.c (print_mips_fp_abi_value): Handle
        Val_GNU_MIPS_ABI_FP_NAN2008.

        ld/testsuite/
        * ld-mips-elf/attr-gnu-4-08.d: Update expected output.
        * ld-mips-elf/attr-gnu-4-09.d: New.
        * ld-mips-elf/attr-gnu-4-19.d: New.
        * ld-mips-elf/attr-gnu-4-29.d: New.
        * ld-mips-elf/attr-gnu-4-39.d: New.
        * ld-mips-elf/attr-gnu-4-49.d: New.
        * ld-mips-elf/attr-gnu-4-59.d: New.
        * ld-mips-elf/attr-gnu-4-69.d: New.
        * ld-mips-elf/attr-gnu-4-79.d: New.
        * ld-mips-elf/attr-gnu-4-89.d: New.
        * ld-mips-elf/attr-gnu-4-9.s: New.
        * ld-mips-elf/mips-elf.exp: Run new tests.
2015-07-09 08:26:10 -07:00
Richard Sandiford 7e30235281 Clarify case requirements for gas pseudo-ops
gas/
2015-07-08  Ciro Santilli  <ciro.santilli@gmail.com>

	* doc/as.texinfo: Clarify case requirements for pseudo ops.
2015-07-08 20:11:06 +01:00
Denis Chertykov 328e7bfdde Define DIFF_EXPR_OK for avr target to allow PC relative difference relocation.
When generating relocation (tc_gen_reloc) 32 bit relocation fixup
is changed to new 32 bit PC relative relocation if the fixup has pc-relative
flag set.

bfd/ChangeLog

2015-07-06  Pitchumani Sivanupandi <pitchumani.s@atmel.com>

    * elf32-avr.c: Add 32 bit PC relative relocation for AVR target.

gas/ChangeLog

2015-07-06  Pitchumani Sivanupandi <pitchumani.s@atmel.com>

    * config/tc-avr.c (tc_gen_reloc): Change 32 bit relocation to
    32 bit PC relative and update offset if the fixup is pc-relative.
    * config/tc-avr.h (DIFF_EXPR_OK): Define to enable PC relative diff
    relocs.

gas/testsuite/ChangeLog

2015-07-06  Pitchumani Sivanupandi <pitchumani.s@atmel.com>

    * gas/avr/pc-relative-reloc.d: New test for 32 bit pc relative reloc.
    * gas/avr/per-function-debugline.s: New test source.

include/ChangeLog

2015-07-06  Pitchumani Sivanupandi <pitchumani.s@atmel.com>

    * elf/avr.h: Add new 32 bit PC relative relocation.

ld/testsuite/ChangeLog

2015-07-06  Pitchumani Sivanupandi <pitchumani.s@atmel.com>

    * ld-avr/gc-section-debugline.d: New test.
    * ld-avr/per-function-debugline.s: Source for new test.
2015-07-08 21:41:52 +03:00
Alan Modra ef5a96d564 Remove ppc860, ppc750cl, ppc7450 insns from common ppc.
Back in the day support for these processors was added, we probably
didn't want to waste PPC_OPCODE bits on minor variations.  I've had a
complaint that disassembly of mfspr/mtspr was wrong for power8.  This
patch fixes that problem.

Note that since -m860/-m850/-m821 are new gas options enabling the
mpc8xx specific mfspr/mtspr variants it is possible that this change
will break some mpc8xx assembly code.  ie. you might need to modify
makefiles to pass -m860 to gas.

include/opcode/
	* ppc.h (PPC_OPCODE_750, PPC_OPCODE_7450, PPC_OPCODE_860): Define.
opcodes/
	* ppc-opc.c (PPC750, PPC7450, PPC860): Define using PPC_OPCODE_*.
	* ppc-dis.c (ppc_opts): Add 821, 850 and 860 entries.  Add
	PPC_OPCODE_7450 to 7450 entry.  Add PPC_OPCODE_750 to 750cl entry.
gas/
	* config/tc-ppc.c (md_show_usage): Add -m821, -m850, -m860.
	* doc/c-ppc.texi (PowerPC-Opts): Likewise.
gas/testsuite/
	* gas/ppc/titan.d: Correct mfmcsrr0 disassembly.
2015-07-03 10:57:14 +09:30
Sandra Loosemore c8c8175b62 Opcodes and assembler support for Nios II R2
2015-07-01  Sandra Loosemore  <sandra@codesourcery.com>
	    Cesar Philippidis  <cesar@codesourcery.com>

	gas/
	* config/tc-nios2.c (nios2_min_align): New.
	(nop): Replace with....
	(nop_r1, nop_r2, nop_r2_cdx, nop32, nop16): New.
	(nios2_align): Handle alignment on 2-byte boundaries when CDX
	instructions may be present.
	(s_nios2_align): Adjust reference to nop.
	(CDXBRANCH, IS_CDXBRANCH): New.
	(CDX_UBRANCH_SUBTYPE, CDX_CBRANCH_SUBTYPE): New.
	(nios2_relax_subtype_size): Handle 2-byte CDX branches.
	(nios2_relax_frag): Likewise.
	(md_convert_frag): Handle R2 encodings.
	(nios2_check_overflow): Check that low-order bits are zero
	before applying rightshift from howto.
	(nios2_check_overflow): Correct negative overflow calculation.
	(nios2_diagnose_overflow): Handle signed_immed12_overflow.  Issue
	generic overflow messages for miscellaneous instruction formats.
	(md_apply_fix): Recognize new R2 relocations.  For pc_relative
	relocations, store fixup in *valP.
	(nios2_reglist_mask, nios2_reglist_dir): New.
	(nios2_parse_reglist): New.
	(nios2_parse_base_register): New.
	(nios2_assemble_expression): Handle constant expressions designated
	by BFD_RELOC_NONE.
	(nios2_assemble_reg3): New.
	(nios2_assemble_arg_c): Handle R2 instruction formats.
	(nios2_assemble_arg_d): Likewise.
	(nios2_assemble_arg_s): Likewise.
	(nios2_assemble_arg_t): Likewise.
	(nios2_assemble_arg_D): New.
	(nios2_assemble_arg_S): New.
	(nios2_assemble_arg_T): New.
	(nios2_assemble_arg_i): Handle R2 instruction formats.
	(nios2_assemble_arg_I): New.
	(nios2_assemble_arg_u): Handle R2 instruction formats.
	(nios2_assemble_arg_U): New.
	(nios2_assemble_arg_V): New.
	(nios2_assemble_arg_W): New.
	(nios2_assemble_arg_X): New.
	(nios2_assemble_arg_Y): New.
	(nios2_assemble_arg_o): Handle R2 instruction formats.
	(nios2_assemble_arg_O): New.
	(nios2_assemble_arg_P): New.
	(nios2_assemble_arg_j): Handle R2 instruction formats.
	(nios2_assemble_arg_k): New.
	(nios2_assemble_arg_l): Handle R2 instruction formats.
	(nios2_assemble_arg_m): Likewise.
	(nios2_assemble_arg_M): New.
	(nios2_assemble_arg_N): New.
	(nios2_assemble_arg_e): New.
	(nios2_assemble_arg_f): New.
	(nios2_assemble_arg_g): New.
	(nios2_assemble_arg_h): New.
	(nios2_assemble_arg_R): New.
	(nios2_assemble_arg_B): New.
	(nios2_assemble_args): Handle new argument letters.
	(nios2_consume_arg): Likewise.
	(nios2_translate_pseudo_insn): Avoid dereferencing null pointer
	in error message.
	(nios2_ps_insn_info_structs): Add nop.n.
	(output_ubranch): Handle CDX branches.
	(output_cbranch): Likewise.
	(output_call): Handle R2 encodings.
	(output_movia): Likewise.
	(md_begin): Initialize nios2_min_align.
	(md_assemble): Align to nios2_min_align.  Adjust nios2_min_align
	if a 16-bit instruction is seen.
	(nios2_cons_align): Use appropriate nop pattern.

	include/opcode/
	* nios2.h (enum iw_format_type): Add R2 formats.
	(enum overflow_type): Add signed_immed12_overflow and
	enumeration_overflow for R2.
	(struct nios2_opcode): Document new argument letters for R2.
	(REG_3BIT, REG_LDWM, REG_POP): Define.
	(includes): Include nios2r2.h.
	(nios2_r2_opcodes, nios2_num_r2_opcodes): Declare.
	(nios2_r2_asi_n_mappings, nios2_num_r2_asi_n_mappings): Declare.
	(nios2_r2_shi_n_mappings, nios2_num_r2_shi_n_mappings): Declare.
	(nios2_r2_andi_n_mappings, nios2_num_r2_andi_n_mappings): Declare.
	(nios2_r2_reg3_mappings, nios2_num_r2_reg3_mappings): Declare.
	(nios2_r2_reg_range_mappings, nios2_num_r2_reg_range_mappings):
	Declare.
	* nios2r2.h: New file.

	opcodes/
	* nios2-dis.c (nios2_extract_opcode): New.
	(nios2_disassembler_state): New.
	(nios2_find_opcode_hash): Use mach parameter to select correct
	disassembler state.
	(nios2_print_insn_arg): Extend to support new R2 argument letters
	and formats.
	(print_insn_nios2): Check for 16-bit instruction at end of memory.
	* nios2-opc.c (nios2_builtin_regs): Add R2 register attributes.
	(NIOS2_NUM_OPCODES): Rename to...
	(NIOS2_NUM_R1_OPCODES): This.
	(nios2_r2_opcodes): New.
	(NIOS2_NUM_R2_OPCODES): New.
	(nios2_num_r2_opcodes): New.
	(nios2_r2_asi_n_mappings, nios2_num_r2_asi_n_mappings): New.
	(nios2_r2_shi_n_mappings, nios2_num_r2_shi_n_mappings): New.
	(nios2_r2_andi_n_mappings, nios2_num_r2_andi_n_mappings): New.
	(nios2_r2_reg3_mappings, nios2_num_r2_reg3_mappings): New.
	(nios2_r2_reg_range_mappings, nios2_num_r2_reg_range_mappings):	New.
2015-07-01 16:08:03 -07:00
Sandra Loosemore 965b1d8083 Add Nios II arch flags and compatibility tests
2015-07-01  Sandra Loosemore  <sandra@codesourcery.com>
	    Cesar Philippidis  <cesar@codesourcery.com>

	bfd/
	* archures.c (bfd_mach_nios2r1, bfd_mach_nios2r2): New.
	* bfd-in2.h: Regenerated.
	* cpu-nios2.c (nios2_compatible): New.
	(N): Use nios2_compatible instead of bfd_default_compatible.
	(NIOS2R1_NEXT, NIOS2R2_NEXT): Define.
	(arch_info_struct): New.
	(bfd_nios2_arch): Chain to NIOS2R1_NEXT.
	* elf32-nios2.c (is_nios2_elf): New.
	(nios2_elf32_merge_private_bfd_data): New.
	(nios2_elf32_object_p): New.
	(bfd_elf32_bfd_merge_private_bfd_data): Define.
	(elf_backend_object_p): Define.

	gas/
	* config/tc-nios2.c: Adjust includes.
	(OPTION_MARCH): Define.
	(md_longopts): Add -march option.
	(nios2_architecture): New.
	(nios2_use_arch): New.
	(md_parse_option): Handle OPTION_MARCH.
	(md_show_usage): Document -march.
	(md_begin): Set arch in BFD.
	(nios2_elf_final_processing): New.
	* config/tc-nios2.h (elf_tc_final_processing): Define.
	(nios2_elf_final_processing): New.
	* doc/c-nios2.texi (-march): Add documentation.

	include/elf/
	* nios2.h (EF_NIOS2_ARCH_R1, EF_NIOS2_ARCH_R2): Define.

	ld/testsuite/
	* ld-nios2/mixed1a.d: New.
	* ld-nios2/mixed1a.s: New.
	* ld-nios2/mixed1b.d: New.
	* ld-nios2/mixed1b.s: New.
	* ld-nios2/nios2.exp: Build the new compatibility tests.
2015-07-01 15:55:28 -07:00
Amit Pawar 9916071f8d Add support for monitorx/mwaitx instructions
gas/

	* config/tc-i386.c (cpu_arch): Add .mwaitx.
	(process_immext): Check operands for monitorx/mwaitx instructions.
	* doc/c-i386.texi: Document mwaitx.

gas/testsuite/

	* gas/i386/i386.exp: Add new mwaitx test cases.
	* gas/i386/mwaitx.s: New.
	* gas/i386/mwaitx-bdver4.d: New.
	* gas/i386/x86-64-mwaitx.s: New.
	* gas/i386/x86-64-mwaitx-bdver4.d: New.
	* gas/i386/mwaitx-reg.s: New.
	* gas/i386/mwaitx-reg.l: New.
	* gas/i386/x86-64-mwaitx-reg.l: New.
	* gas/i386/x86-64-mwaitx-reg.s: New.
	* gas/i386/arch-13.s: Updated.
	* gas/i386/arch-13.d: Updated.
	* gas/i386/arch-13-znver1.d: Updated.
	* gas/i386/x86-64-arch-3.s: Updated.
	* gas/i386/x86-64-arch-3.d: Updated.
	* gas/i386/x86-64-arch-3-znver1.d: Updated.

opcodes/

	* i386-dis.c (OP_Mwaitx): New.
	(rm_table): Add monitorx/mwaitx.
	* i386-gen.c (cpu_flag_init): Add CpuMWAITX to CPU_BDVER4_FLAGS
	and CPU_ZNVER1_FLAGS.  Add CPU_MWAITX_FLAGS.
	(operand_type_init): Add CpuMWAITX.
	* i386-opc.h (CpuMWAITX): New.
	(i386_cpu_flags): Add cpumwaitx.
	* i386-opc.tbl: Add monitorx and mwaitx.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.
2015-06-30 07:50:12 -07:00
H.J. Lu ee0c0c503d Remove COMPRESS_DEBUG_ZLIB
COMPRESS_DEBUG_ZLIB isn't needed.  This patch removes COMPRESS_DEBUG_ZLIB
and replace COMPRESS_DEBUG_ZLIB with COMPRESS_DEBUG_GNU_ZLIB.

bfd/

	* bfd-in.h (compressed_debug_section_type): Remove
	COMPRESS_DEBUG_ZLIB.
	* bfd-in2.h : Regenerated.
gas/

	* as.c (parse_args): Replace COMPRESS_DEBUG_ZLIB with
	COMPRESS_DEBUG_GNU_ZLIB.
	* config/tc-i386.c (flag_compress_debug): Likewise.

ld/

	* emultempl/elf32.em  (gld${EMULATION_NAME}_handle_option):
	Replace COMPRESS_DEBUG_ZLIB with COMPRESS_DEBUG_GNU_ZLIB.
2015-06-28 06:30:10 -07:00
H.J. Lu 68c3545dc3 Remove the extra @section .cfi_lsda
Commit 2f0c68f23b added an extra @section
.cfi_lsda:

 @subsection @code{.cfi_lsda @var{encoding} [, @var{exp}]}
+@section @code{.cfi_lsda @var{encoding} [, @var{exp}]}
 @code{.cfi_lsda} defines LSDA and its encoding.

It shouldn't be there.

	* doc/as.texinfo (.cfi_lsda): Remove the extra @section.
2015-06-24 15:30:11 -07:00
Peter Bergner 11a0cf2ec0 Allow for optional operands with non-zero default values.
ISA 2.07 (ie, POWER8) added the rfebb instruction which takes one operand
with the value of either a 0 or 1.  It also defines an extended mnemonic
with no operands (ie, "rfebb") that is supposed to be equivalent to "rfebb 1".
I implemented rfebb's lone operand with PPC_OPERAND_OPTIONAL, but the
problem is, optional operands that are ommitted always default to the
value 0, which is wrong in this case.  I have added support for allowing
non-zero default values by adding an additional flag PPC_OPERAND_OPTIONAL_VALUE
that specifies that the default operand value to be used is stored in the
SHIFT field of the operand field immediately following this one.

This fixes the rfebb issue.  I also fixed the mftb and mfcr instructions
so they use the same mechanism.  This allows us to flag invalid uses of
mfcr where we explicitly pass in a zero FXM value, like the use in a2.[sd].

include/opcode/

	* ppc.h (PPC_OPERAND_OPTIONAL_VALUE): New.
	(ppc_optional_operand_value): New inline function.

opcodes/
	* ppc-dis.h (skip_optional_operands): Use ppc_optional_operand_value.
	* ppc-opc.c (FXM4): Add non-zero optional value.
	(TBR): Likewise.
	(SXL): Likewise.
	(insert_fxm): Handle new default operand value.
	(extract_fxm): Likewise.
	(insert_tbr): Likewise.
	(extract_tbr): Likewise.

gas/
	* config/tc-ppc.c (md_assemble): Use ppc_optional_operand_value.
	Allow for optional operands without insert functions.

gas/testsuite/
	* gas/ppc/power8.d: Fixup rfebb test results.
	* gas/ppc/a2.s: Fix invalid mfcr test.
	* gas/ppc/a2.d: Likewise.
2015-06-19 17:17:07 -05:00
Nick Clifton c12d2c9d48 Add support for using the ADR alias in Thumb mode against nearby symbols.
PR gas/18541
gas	* config/tc-arm.c (md_apply_fix): Add support for ADR in thumb
	mode against a nearby symbol.

tests	* gas/arm/thumb.s: Add test of ADR against a nearby symbol.
	* gas/arm/thumb.d: Update expected output.
	* gas/arm/thumb-eabi.d: Likewise.
2015-06-18 10:23:16 +01:00
Nick Clifton 75c1199967 Fix the computation of the addends for an ARM_TLS_LE32 reloc.
PR gas/18481
bfd	* elf32-arm.c (R_ARM_TLS_LE32): Set the special function to NULL.

gas	* config/tc-arm.c (tc_gen_reloc): Include BFD_RELOC_ARM_TLS_LE32
	in the same case as BFD_RELOC_ARM_TLS_IS32.

tests	* gas/arm/tls.s: Add tests of the tpoff pseudo with a local
	symbol.
	* gas/arm/tls.d: Update expected output.
2015-06-18 10:18:42 +01:00
Nick Clifton 5fc177c895 Fix compile warnings building previous delta in a 32-bit environment.
* config/tc-arm.c (is_double_a_single): Make conditional upon the
	availablity of a 64-bit type.  Use this type for the argument and
	mantissa.
	(double_to_single): Likewise.
	* config/tc-arm.c (move_or_literal_pool): Use a 64-bit type for
	the constant value, if available.  Generate a 64-bit value from a
	bignum if supported.  Only perform the second optimization for
	PR 18500 if the 64-bit type is available.
2015-06-17 16:10:36 +01:00
Alessandro Marzocchi 1256987795 Add support for converting LDR Rx,=<imm> to MOV or MVN in Thumb2 mode.
PR gas/18499
gas	* config/tc-arm.c (move_or_literal_pool): Add support for LDR Rx,=
	to MOV.w or MVN.w for Thumb2.

tests	* gas/arm/thumb2_ldr_immediate_armv6.s: New test case.
	* gas/arm/thumb2_ldr_immediate_armv6.d: Expected disassembly.
	* gas/arm/thumb2_ldr_immediate_armv6t2.s: New test case.
	* gas/arm/thumb2_ldr_immediate_armv6t2.d: Expected disassembly.
2015-06-17 13:50:52 +01:00
Alessandro Marzocchi ba592044bc Add support for converting VLDR <reg>,=<constant> to a VMOV instruction when appropriate.
PR gas/18500
gas	* config/tc-arm.c (is_double_a_single): New function.
	(double_to_single): New function.
	(move_or_literal_pool): Add support for	converting VLDR to VMOV.

tests	* gas/arm/vfpv2-ldr_immediate.s: New test case.
	* gas/arm/vfpv2-ldr_immediate.d: Expected disassembly.
	* gas/arm/vfpv3-ldr_immediate.s: New test case.
	* gas/arm/vfpv3-ldr_immediate.d: Expected disassembly.
	* gas/arm/vfpv3xd-ldr_immediate.s: New test case.
	* gas/arm/vfpv3xd-ldr_immediate.d: Expected disassembly.
2015-06-17 12:56:17 +01:00
Nicolas Pitre 451133cefa gas: section name substitution sequence
This patch adds the ability to automatically construct a section name
based on the prior section.

When gas is invoked with --sectname-subst, the occurrence of %S in a
section name will be substituted by the name of the current section. For
example:

	.macro exception_code
	.pushsection %S.exception
	[exception code here]
	.popsection
	.endm

	.text
	[code]
	exception_code
	[...]

	.section .init
	[init code]
	exception_code
	[...]

The first and second exception_code invocations create the
.text.exception and the .init.exception sections respectively.  This is
useful e.g. to discriminate between anciliary sections that are tied to
.init code and can be discarded at run time when initialization is over
vs anciliary sections tied to .text sections that need to stay resident.

	* as.c (show_usage): Document --sectname-subst.
	(parse_args): Add --sectname-subst.
	* as.h (flag_sectname_subst): New.
	* config/obj-elf.c (obj_elf_section_name): Add %S substitution.
	* doc/as.texinfo: Document it.
2015-06-17 08:52:00 +09:30
Renlin Li 87f5fbcc7a [AArch64] Gas add BFD_RELOC_AARCH64_LD64_GOTOFF_LO15 support
2015-06-15  Renlin Li <renlin.li@arm.com>
bfd/
    * reloc.c (BFD_RELOC_AARCH64_LD64_GOTOFF_LO15): New entry.
    * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
    BFD_RELOC_AARCH64_LD64_GOTOFF_LO15.
    * bfd-in2.h: Regenerate.
    * libbfd.h: Regenerate.

gas/
    * config/tc-aarch64.c (reloc_table): New relocation modifier.
    (md_apply_fix): Support BFD_RELOC_AARCH64_LD64_GOTOFF_LO15.
    (aarch64_force_relocation): Ditto

gas/testsuite/
    * gas/aarch64/reloc-insn.s: Update test
    * gas/aarch64/reloc-insn.d: Update expected result.
2015-06-15 11:07:37 +01:00
Mark Wielaard d025d5e5b5 gas: Don't use frag_align but use plain padding to align .debug_aranges.
out_debug_aranges uses frag_align to make sure the addresses start
out aligned. Using frag_align will call frag_var[_init], which will
end up calling TC_FRAG_INIT. On arm and aarch64 TC_FRAG_INIT will
generate a $d mapping symbol for the .debug_aranges to show that at
that point a sequence of data items starts.

Such a symbol pointing into a non-allocated debug section will confuse
eu-strip -g. And it seems inefficient and wrong in general to have
additional mapping symbols for debug sections, which won't contain
actual code in the first place.

Just keep track of the aranges header size and use plain padding to
align the addresses which avoids generating any mapping symbols on
aarch64 and arm.

Includes a testcase for aarch64 that PASS with this patch and shows
the extra $d mapping symbol in .debug_aranges before.

gas/ChangeLog

       * dwarf2dbg.c (out_header): Document EXPR->X_add_number value,
       out_debug_aranges depends on it.
       (out_debug_aranges): Track size of header to properly pad header
       for address alignment.

gas/testsuite/ChangeLog

       * gas/aarch64/dwarf.d: New.
       * gas/aarch64/dwarf.s: New.
2015-06-15 09:25:21 +02:00
John David Anglin 18c208b229 tc-hppa.c: Speed up search for last label 2015-06-11 18:50:39 -04:00
Nick Clifton f0e8c65e02 Fix RX GAS handling of integer bignums.
* config/tc-rx.c (rx_op): Correct handling of integer bignums.
2015-06-08 11:32:38 +01:00
Nick Clifton 239c0f4ceb Fix compile time warning for tc-h8300.c when using gcc 5+.
* config/tc-h8300.c (md_section_align): Fix compile time warning
	about left shifting a negative value.
2015-06-04 16:25:03 +01:00
Matthew Wahab 88f0ea342d [AArch64] Add support for ARMv8.1 command line option 2015-06-04 11:14:07 +01:00
Jiong Wang b968d18a6d [ARM] Use frag's thumb_mode information when available
2015-06-04  Renlin Li  <renlin.li@arm.com>

	* config/tc-arm.c (arm_init_frag): Use frag's thumb_mode information
	when available.
2015-06-04 09:36:35 +01:00
Matthew Wahab a5932920ef [ARM] Support for ARMv8.1 command line option
2015-06-03  Matthew Wahab  <matthew.wahab@arm.com>

gas/
	* config/tc-arm.c (arm_archs): Add "armv8.1-a".
	* doc/c-arm.texi (ARM Options, -march): Add "armv8.1-a".
	* NEWS: Mention ARMv8.1 support.

include/opcode/
	* arm.h (FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_1): New.
	(ARM_ARCH_V8_1A): New.
	(ARM_ARCH_V8_1A_FP): New.
	(ARM_ARCH_V8_1A_SIMD): New.
	(ARM_ARCH_V8_1A_CRYPTOV1): New.
	(ARM_FEATURE_CORE): New.
2015-06-03 10:03:50 +01:00
Matthew Wahab ddfded2f7b [ARM] Add support for ARMv8.1 PAN extension 2015-06-02 12:30:38 +01:00
Matthew Wahab 9e1f0fa7f3 [AArch64] Support for ARMv8.1a Adv.SIMD instructions
2015-06-02  Matthew Wahab  <matthew.wahab@arm.com>

gas/
  * config/tc-aarch64.c (aarch64_features): Add "rdma".
  * doc/c-aarch64.texi (AArch64 Extensions): Add "rdma".

gas/testsuite/
  * rdma-directive.d: New.
  * rdma.d: New.
  * rdma.s: New.

include/opcode/
  * aarch64.h (AARCH64_FEATURE_RDMA): New.

opcode/
  * aarch64-tbl.h (aarch64_feature_rdma): New.
  (RDMA): New.
  (aarch64_opcode_table): Add "sqrmlah" and "sqrdmlsh" instructions.
  * aarch64-asm-2.c: Regenerate.
  * aarch64-dis-2.c: Regenerate.
  * aarch64-opc-2.c: Regenerate.
2015-06-02 12:20:00 +01:00
Matthew Wahab 290806fd94 [AArch64] Support for ARMv8.1a Limited Ordering Regions extension
2015-06-02  Matthew Wahab  <matthew.wahab@arm.com>
include/
  * aarch64.h (AARCH64_FEATURE_LOR): New.

opcodes/
  * aarch64-tbl.h (aarch64_feature_lor): New.
  (LOR): New.
  (aarch64_opdocde_table): Add "ldlar", "ldlarb", "ldlarh", "stllr",
  "stllrb", "stllrh".
  * aarch64-asm-2.c: Regenerate.
  * aarch64-dis-2.c: Regenerate.
  * aarch64-opc-2.c: Regenerate.

gas/
  * config/tc-aarch64.c (aarch64_features): Add "lor".
  * doc/c-aarch64.c (Aarch64 Extensions): Add "lor" to list of
  architecture extensions.

gas/testsuite/
  * lor-directive.d: New.
  * lor.d: New.
  * lor.s: New.
2015-06-02 11:30:12 +01:00
Matthew Wahab 72ca8fad61 [AArch64][GAS] Add support for PAN architecture extension
2015-06-01  Matthew Wahab  <matthew.wahab@arm.com>
gas/
	* config/tc-aarch64.c (parse_sys_reg): New parameter.  Check
	target support.  Fix whitespace.
	(parse_operands): Update for parse_sys_reg changes.
	(aarch64_features): Add "pan".
	* doc/c-aarch64.texi (Aarch64 Extensions): Add "pan".

gas/testsuite/
	* pan-directive.d: New.
	* pan.d: New.
	* pan.s: New
2015-06-01 16:05:58 +01:00
Jiong Wang 3d715ce420 [AArch64] GAS support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14
This patch add BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14 support in Gas.

The relocation modifier
===
  :gotpage_lo14:symbol

2015-06-01 Jiong.Wang <jiong.wang@arm.com>

bfd/
  * reloc.c (BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14): New entry.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
  BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers.
  (md_apply_fix): Support BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14.
  (aarch64_force_relocation): Ditto.

gas/testsuite/
  * gas/aarch64/ilp32-basic.s: New testcase.
  * gas/aarch64/ilp32-basic.d: Ditto.
2015-06-01 15:41:54 +01:00
Jiong Wang a921b5bd70 [AArch64] GAS Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15
2015-06-01 Jiong.Wang <jiong.wang@arm.com>

bfd/
  * reloc.c (BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15): New entry.
  * bfd-in2.h: Regenerate.
  * libbfd.h: Regenerate.
  * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
  BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.

gas/
  * config/tc-aarch64.c (reloc_table): New relocation modifiers.
  (md_apply_fix): Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15.
  (aarch64_force_relocation): Ditto.

gas/testsuite/
  * gas/aarch64/reloc-insn.s: New testcase.
  * gas/aarch64/reloc-insn.d: Ditto.
2015-06-01 10:22:15 +01:00
Catherine Moore 2f0c68f23b Compact EH Support
The specification for the Compact EH format is available at:
https://github.com/MentorEmbedded/cxx-abi/blob/master/MIPSCompactEH.pdf

2015-05-28  Catherine Moore  <clm@codesourcery.com>
	    Bernd Schmidt <bernds@codesourcery.com>
	    Paul Brook <paul@codesourcery.com>

	bfd/
	* bfd-in2.h: Regenerated.
	* elf-bfd.h (DWARF2_EH_HDR, COMPACT_EH_HDR): Define.
	(COMPACT_EH_CANT_UNWIND_OPCODE): Define.
	(dwarf_eh_frame_hdr_info): Move dwarf-specific fields from
	eh_frame_hdr_info.
	(compact_eh_frame_hdr_info): Declare.
	(eh_frame_hdr_info):  Redeclare with union for dwarf-specific
	fields and compact-eh fields.
	(elf_backend_data): Add cant_unwind_opcode and compact_eh_encoding.
	(bfd_elf_section_data): Add eh_frame_entry_field.
	(elf_section_eh_frame_entry): Define.
	(bfd_elf_parse_eh_frame_entries): Declare.
	(_bfd_elf_parse_eh_frame_entry): Declare.
	(_bfd_elf_end_eh_frame_parsing): Declare.
	(_bfd_elf_write_section_eh_frame_entry): Declare.
	(_bfd_elf_eh_frame_entry_present): Declare.
	(_bfd_elf_section_for_symbol): Declare.
	* elf-eh-frame.c (bfd_elf_discard_eh_frame_entry): New function.
	(bfd_elf_record_eh_frame_entry): New function.
	(_bfd_elf_parse_eh_frame_entry): New function.
	(_bfd_elf_parse_eh_frame): Update hdr_info field references.
	(cmp_eh_frame_hdr): New function.
	(add_eh_frame_hdr_terminator): New function.
	(_bfd_elf_end_eh_frame_parsing): New function.
	(find_merged_cie): Update hdr_info field references.
	(_bfd_elf_discard_section_eh_frame): Likewise.
	(_bfd_elf_discard_section_eh_frame_hdr): Add Compact EH support.
	(_bfd_elf_eh_frame_entry_present): New function.
	(_bfd_elf_maybe_strip_eh_frame_hdr): Add Compact EH support.
	(_bfd_elf_write_section_eh_frame_entry): New function.
	(_bfd_elf_write_section_eh_frame): Update hdr_info field references.
	(_bfd_elf_fixup_eh_frame_hdr): New function.
	(write_compact_eh_frame_hdr): New function.
	(write_dwarf_eh_frame_hdr): New function.
	(_bfd_elf_write_section_eh_frame_hdr): Add Compact EH support.
	* elflink.c (_bfd_elf_section_for_symbol): New function.
	(elf_section_ignore_discarded_relocs): Add Compact EH support.
	(elf_link_input_bfd): Likewise.
	(bfd_elf_final_link): Likewise.
	(_bfd_elf_gc_mark): Likewise.
	(bfd_elf_parse_eh_frame_entries): New function.
	(bfd_elf_gc_sections): Add Compact EH support.
	(bfd_elf_discard_info): Likewise.
	* elfxx-mips.c: Include dwarf2.h.
	(_bfd_mips_elf_compact_eh_encoding): New function.
	(_bfd_mips_elf_cant_unwind_opcode): New function.
	* elfxx-mips.h (_bfd_mips_elf_compact_eh_encoding): Declare.
	(_bfd_mips_elf_cant_unwind_opcode): Declare.
	(elf_backend_compact_eh_encoding): Define.
	(elf_backend_cant_unwind_opcode): Define.
	* elfxx-target.h (elf_backend_compact_eh_encoding): Provide default.
	(elf_backend_cant_unwind_opcode): Provide default.
	(elf_backend_data elfNN_bed): Add elf_backend_compact_eh_encoding and
	elf_backend_cant_unwind_opcode.
	* section.c (SEC_INFO_TYPE_EH_FRAME_ENTRY): Add definition.

	gas/
	* config/tc-alpha.c (all_cfi_sections): Declare.
	(s_alpha_ent): Initialize all_cfi_sections.
	(alpha_elf_md_end): Invoke cfi_set_sections.
	* config/tc-mips.c (md_apply_fix):  Handle BFD_RELOC_NONE.
	(s_ehword): Use BFD_RELOC_32_PCREL.
	(mips_fix_adjustable): Handle BFD_RELOC_32_PCREL.
	(mips_cfi_reloc_for_encoding): New function.
	* tc-mips.h (DWARF2_FDE_RELOC_SIZE): Redefine.
	(DWARF2_FDE_RELOC_ENCODING): Define.
	(tc_cfi_reloc_for_encoding): Define.
	(mips_cfi_reloc_for_encoding): Define.
	(tc_compact_eh_opcode_stop): Define.
	(tc_compact_eh_opcode_pad): Define.
	* doc/as.texinfo: Document Compact EH extensions.
	* doc/internals.texi: Likewise.
	* dw2gencfi.c (EH_FRAME_LINKONCE): Redefine.
	(tc_cfi_reloc_for_encoding): Provide default.
	(compact_eh): Declare.
	(emit_expr_encoded): New function.
	(get_debugseg_name): Add Compact EH support.
	(alloc_debugseg_item): Likewise.
	(cfi_set_sections): New function.
	(dot_cfi_fde_data): New function.
	(dot_cfi_personality_id): New function.
	(dot_cfi_inline_lsda): New function.
	(cfi_pseudo_table): Add cfi_fde_data, cfi_personality_id,
	and cfi_inline_lsda.
	(dot_cfi_personality): Add Compact EH support.
	(dot_cfi_lsda): Likewise.
	(dot_cfi_sections): Likewise.
	(dot_cfi_startproc): Likewise.
	(get_cfi_seg): Likewise.
	(output_compact_unwind_data): New function.
	(output_cfi_insn): Add Compact EH support.
	(output_cie): Likewise.
	(output_fde): Likewise.
	(cfi_finish): Likewise.
	(cfi_emit_eh_header): New function.
	(output_eh_header): New function.
	* dw2gencfi.h (cfi_set_sections): Declare.
	(SUPPORT_COMPACT_EH): Define.
	(MULTIPLE_FRAME_SECTIONS): Define.
	New enumeration to describe the Compact EH header format.
	(fde_entry): Add new fields personality_id, eh_header_type, eh_data_size,
	eh_data, eh_loc and sections.
	(CFI_EMIT_eh_frame, CFI_EMIT_debug_frame, CFI_EMIT_target,
	CFI_EMIT_eh_frame_compact): Define.

2015-05-22  Catherine Moore  <clm@codesourcery.com>
	    Bernd Schmidt <bernds@codesourcery.com>

	gas/testsuite/
	* gas/mips/mips.exp: Run new tests.

	* gas/mips/compact-eh-1.s: New file.
	* gas/mips/compact-eh-2.s: New file.
	* gas/mips/compact-eh-3.s: New file.
	* gas/mips/compact-eh-4.s: New file.
	* gas/mips/compact-eh-5.s: New file.
	* gas/mips/compact-eh-6.s: New file.
	* gas/mips/compact-eh-7.s: New file.
	* gas/mips/compact-eh-eb-1.d: New file.
	* gas/mips/compact-eh-eb-2.d: New file.
	* gas/mips/compact-eh-eb-3.d: New file.
	* gas/mips/compact-eh-eb-4.d: New file.
	* gas/mips/compact-eh-eb-5.d: New file.
	* gas/mips/compact-eh-eb-6.d: New file.
	* gas/mips/compact-eh-eb-7.d: New file.
	* gas/mips/compact-eh-el-1.d: New file.
	* gas/mips/compact-eh-el-2.d: New file.
	* gas/mips/compact-eh-el-3.d: New file.
	* gas/mips/compact-eh-el-4.d: New file.
	* gas/mips/compact-eh-el-5.d: New file.
	* gas/mips/compact-eh-el-6.d: New file.
	* gas/mips/compact-eh-el-7.d: New file.
	* gas/mips/compact-eh-err1.l: New file.
	* gas/mips/compact-eh-err1.s: New file.
	* gas/mips/compact-eh-err2.l: New file.
	* gas/mips/compact-eh-err2.s: New file.

2015-05-22  Catherine Moore  <clm@codesourcery.com>

	include/
	* bfdlink.h: Rename eh_frame_hdr to eh_frame_hdr_type.

2015-05-22  Catherine Moore  <clm@codesourcery.com>
	    Paul Brook <paul@codesourcery.com>

	ld/
	* emultempl/elf32.em (gld${EMULATION_NAME}_after_open):
	Add Compact EH support.
	* scripttempl/elf.sc: Handle .eh_frame_entry and .gnu_extab
	sections.

2015-05-22  Catherine Moore  <clm@codesourcery.com>

	ld/testsuite/
	* ld-mips-elf/compact-eh.ld: New linker script.
	* ld-mips-elf/compact-eh1.d: New.
	* ld-mips-elf/compact-eh1.s: New.
	* ld-mips-elf/compact-eh1a.s: New.
	* ld-mips-elf/compact-eh1b.s: New.
	* ld-mips-elf/compact-eh2.d: New.
	* ld-mips-elf/compact-eh2.s: New.
	* ld-mips-elf/compact-eh3.d: New.
	* ld-mips-elf/compact-eh3.s: New.
	* ld-mips-elf/compact-eh3a.s: New.
	* ld-mips-elf/compact-eh4.d: New.
	* ld-mips-elf/compact-eh5.d: New.
	* ld-mips-elf/compact-eh6.d: New.
	* ld-mips-elf/mips-elf.exp: Run new tests.
2015-05-28 15:21:17 -07:00
Max Filippov 4de0562a4c xtensa: fix gas segfault with --text-section-literals
When --text-section-literals is used and code in the .init or .fini
emits literal in the absence of .literal_position, xtensa_move_literals
segfaults.

Check that search_frag is non-NULL in the xtensa_move_literals and
report error otherwise.

2015-05-26  Max Filippov  <jcmvbkbc@gmail.com>
gas/
	* config/tc-xtensa.c (xtensa_move_literals): Check that
	search_frag is non-NULL. Report error if literal frag is not
	found.
2015-05-26 10:14:17 +03:00
Nick Clifton 29798047af Fixes: "gas/read.c:5087:12: error: left shift of negative"
PR gas/18446
	* read.c (output_big_sleb128): Use U suffix to prevent compile
	time warning.
2015-05-22 14:27:36 +01:00
Jiong Wang f09c556a25 [AArch64] Sort relocation case labels alphabetically
2015-05-19  Jiong. Wang  <jiong.wang@arm.com>

gas/
  * config/tc-aarch64.c (process_movw_reloc_info): Sort relocation case labels
  alphabetically.
  (md_apply_fix): Ditto.
  (aarch64_force_relocation): Ditto.
2015-05-20 10:48:29 +01:00
H.J. Lu 5db04b0965 Support AMD64/Intel ISAs in assembler/disassembler
AMD64 spec and Intel64 spec differ in direct unconditional branches in
64-bit mode.  AMD64 supports direct unconditional branches with 16-bit
offset via the data size prefix, which truncates RIP to 16 bits, while
the data size prefix is ignored by Intel64.

This patch adds -mamd64/-mintel64 option to x86-64 assembler and
-Mamd64/-Mintel64 option to x86-64 disassembler.  The most permissive
ISA, which is AMD64, is the default.

GDB can add an option, similar to

(gdb) help set disassembly-flavor
Set the disassembly flavor.
The valid values are "att" and "intel", and the default value is "att".

to select which ISA to disassemble.

binutils/

	PR binutis/18386
	* doc/binutils.texi: Document -Mamd64 and -Mintel64.

gas/

	PR binutis/18386
	* config/tc-i386.c (OPTION_MAMD64): New.
	(OPTION_MINTEL64): Likewise.
	(md_longopts): Add -mamd64 and -mintel64.
	(md_parse_option): Handle OPTION_MAMD64 and OPTION_MINTEL64.
	(md_show_usage): Add -mamd64 and -mintel64.
	* doc/c-i386.texi: Document -mamd64 and -mintel64.

gas/testsuite/

	PR binutis/18386
	* gas/i386/i386.exp: Run x86-64-branch-2 and x86-64-branch-3.
	* gas/i386/x86-64-branch.d: Also pass -Mintel64 to objdump.
	* gas/i386/ilp32/x86-64-branch.d: Likewise.
	* gas/i386/x86-64-branch-2.d: New file.
	* gas/i386/x86-64-branch-2.s: Likewise.
	* gas/i386/x86-64-branch-3.l: Likewise.
	* gas/i386/x86-64-branch-3.s: Likewise.

ld/testsuite/

	PR binutis/18386
	* ld-x86-64/tlsgdesc.dd: Also pass -Mintel64 to objdump.
	* ld-x86-64/tlspic.dd: Likewise.
	* ld-x86-64/x86-64.exp (x86_64tests): Also pass -Mintel64 to
	objdump for tlspic.dd and tlsgdesc.dd.

opcodes/

	PR binutis/18386
	* i386-dis.c: Add comments for '@'.
	(x86_64_table): Use '@' on call/jmp for X86_64_E8/X86_64_E9.
	(enum x86_64_isa): New.
	(isa64): Likewise.
	(print_i386_disassembler_options): Add amd64 and intel64.
	(print_insn): Handle amd64 and intel64.
	(putop): Handle '@'.
	(OP_J): Don't ignore the operand size prefix for AMD64 in 64-bit.
	* i386-gen.c (cpu_flags): Add CpuAMD64 and CpuIntel64.
	* i386-opc.h (AMD64): New.
	(CpuIntel64): Likewise.
	(i386_cpu_flags): Add cpuamd64 and cpuintel64.
	* i386-opc.tbl: Add direct call/jmp with Disp16|Disp32 for AMD64.
	Mark direct call/jmp without Disp16|Disp32 as Intel64.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.
2015-05-15 09:48:10 -07:00
H.J. Lu 8dcea93252 Add -mshared option to x86 ELF assembler
This patch adds -mshared option to x86 ELF assembler.  By default,
assembler will optimize out non-PLT relocations against defined non-weak
global branch targets with default visibility.  The -mshared option tells
the assembler to generate code which may go into a shared library
where all non-weak global branch targets with default visibility can
be preempted.  The resulting code is slightly bigger.  This option
only affects the handling of branch instructions.

This Linux kernel patch is needed to create a working x86 Linux kernel if
it hasn't been applied:

diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index ae6588b..b91a00c 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -339,8 +339,8 @@ early_idt_handlers:
 	i = i + 1
 	.endr

-/* This is global to keep gas from relaxing the jumps */
-ENTRY(early_idt_handler)
+/* This is weak to keep gas from relaxing the jumps */
+WEAK(early_idt_handler)
 	cld

 	cmpl $2,(%rsp)		# X86_TRAP_NMI
--

gas/

	* config/tc-i386.c (shared): New.
	(OPTION_MSHARED): Likewise.
	(elf_symbol_resolved_in_segment_p): Add relocation argument.
	Check PLT relocations and shared.
	(md_estimate_size_before_relax): Pass fragP->fr_var to
	elf_symbol_resolved_in_segment_p.
	(md_longopts): Add -mshared.
	(md_show_usage): Likewise.
	(md_parse_option): Handle OPTION_MSHARED.
	* doc/c-i386.texi: Document -mshared.

gas/testsuite/

	* gas/i386/i386.exp: Don't run pcrel for ELF targets.  Run
	pcrel-elf, relax-4 and x86-64-relax-3 for ELF targets.
	* gas/i386/pcrel-elf.d: New file.
	* gas/i386/relax-4.d: Likewise.
	* gas/i386/x86-64-relax-3.d: Likewise.
	* gas/i386/relax-3.d: Pass -mshared to assembler.  Updated.
	* gas/i386/x86-64-relax-2.d: Likewise.
	* gas/i386/relax-3.s: Add test for PLT relocation.
2015-05-15 03:30:53 -07:00
H.J. Lu dab394de9e Don't add the zlib header to SHF_COMPRESSED section
In a SHF_COMPRESSED compressed section, the raw compressed data should
begin immediately after the compression header.  This patch removes the
extra zlib header from the SHF_COMPRESSED section.

bfd/

	* bfd.c (bfd_update_compression_header): Also write the zlib
	header if the SHF_COMPRESSED bit cleared..
	(bfd_check_compression_header): Return the uncompressed size.
	* compress.c (decompress_contents): Don't skip the zlib header.
	(bfd_compress_section_contents): Properly handle ELFCOMPRESS_ZLIB,
	which doesn't have the zlib header.
	(bfd_init_section_decompress_status): Likewise.
	(bfd_get_full_section_contents): Updated.
	(bfd_is_section_compressed): Likewise.
	(bfd_is_section_compressed_with_header): Return the uncompressed
	size.
	* elf.c (_bfd_elf_make_section_from_shdr): Updated.
	* bfd-in2.h: Regenerated.

binutils/

	* readelf.c (uncompress_section_contents): Add a parameter for
	uncompressed size.  Don't check the zlib header.
	(load_specific_debug_section): Updated.

binutils/testsuite/

	* binutils-all/compress.exp: Replace "$OBJDUMP -s -j .debug_info"
	with "$OBJDUMP -W".
	* binutils-all/libdw2-compressedgabi.out: Updated.

gas/

2015-05-14  H.J. Lu  <hongjiu.lu@intel.com>

	* write.c (compress_debug): Don't write the zlib header, which
	is handled by bfd_update_compression_header.
2015-05-14 16:02:08 -07:00
Max Filippov dc58915f3a xtensa: fix gas trampolines regression
Extra condition 'abs (addr - trampaddr) < J_RANGE / 2' for trampoline
selection results in regressions: when relaxable jump is little longer
than J_RANGE so that single trampoline makes two new jumps, one longer
than J_RANGE / 2 and one shorter, correct trampoline cannot be found.

Drop that condition.

2015-05-13  Max Filippov  <jcmvbkbc@gmail.com>
gas/
	* config/tc-xtensa.c (xtensa_relax_frag): Allow trampoline to be
	closer than J_RANGE / 2 to jump frag.

gas/testsuite/
	* gas/xtensa/trampoline.s: Add regression testcase.
2015-05-13 19:25:52 +03:00
H.J. Lu e69c76f4bf Revert "Add -mno-shared to x86 assembler"
This reverts commit 573cc2e57d.
2015-05-13 04:47:59 -07:00
H.J. Lu 5197d47436 Default e_machine to EM_IAMCU for i?86-*-elfiamcu
This patch sets the default ELF output format of assembler and linker to
EM_IAMCU when binutils is configured to i?86-*-elfiamcu target.

gas/

	* configure.tgt (arch): Set to iamcu for i386-*-elfiamcu target.
	* config/tc-i386.c (i386_mach): Support iamcu.
	(i386_target_format): Likewise.

ld/

	* configure.tgt: Support i[3-7]86-*-elfiamcu target.

ld/testsuite/

	* ld-i386/i386.exp (iamcu_tests): Run iamcu-4.
	* ld-i386/iamcu-4.d: New file.
2015-05-11 12:06:33 -07:00
H.J. Lu 814860358c Add Intel MCU support to gas
-march=iamcu must be passed to i386 assembler to generate Intel MCU object
file.

gas/

	* config/tc-i386.c (cpu_arch): Add iamcu.
	(i386_align_code): Handle PROCESSOR_IAMCU.
	(i386_arch): Likewise.
	(i386_mach): Likewise.
	(i386_target_format): Likewise.
	(valid_iamcu_cpu_flags): New function.
	(check_cpu_arch_compatible): Only allow Intel MCU instructions
	when targeting Intel MCU.
	(set_cpu_arch): Call valid_iamcu_cpu_flags to check if CPU flags
	are valid for Intel MCU.
	(md_parse_option): Likewise.
	* tc-i386.h (ELF_TARGET_IAMCU_FORMAT): New.
	(processor_type): Add PROCESSOR_IAMCU.
	* doc/c-i386.texi: Document iamcu.

gas/testsuite/

	* gas/i386/i386.exp: Run iamcu-1, iamcu-2, iamcu-3, iamcu-inval-1,
	iamcu-inval-2 and iamcu-inval-3.
	* gas/i386/iamcu-1.d: New file.
	* gas/i386/iamcu-1.s: Likewise.
	* gas/i386/iamcu-2.d: Likewise.
	* gas/i386/iamcu-2.s: Likewise.
	* gas/i386/iamcu-3.d: Likewise.
	* gas/i386/iamcu-3.s: Likewise.
	* gas/i386/iamcu-inval-1.l: Likewise.
	* gas/i386/iamcu-inval-1.s: Likewise.
	* gas/i386/iamcu-inval-2.l: Likewise.
	* gas/i386/iamcu-inval-2.s: Likewise.
	* gas/i386/iamcu-inval-3.l: Likewise.
	* gas/i386/iamcu-inval-3.s: Likewise.
2015-05-11 11:12:39 -07:00
Nick Clifton ae8714c271 Change ARM symbol name verification code so that it only triggers when the form "name = val" is used.
PR gas/18347
	* config/tc-arm.h (TC_EQUAL_IN_INSN): Define.
	* config/tc-arm.c (arm_tc_equal_in_insn): New function.  Move
	the symbol name checking code to here from...
	(md_undefined_symbo): ... here.
2015-05-08 17:28:26 +01:00
H.J. Lu 573cc2e57d Add -mno-shared to x86 assembler
On ELF target, the assembler normally generates code which can go into a
shared library where non-weak symbols can be preempted.  The -mno-shared
option tells the assembler to generate code not for a shared library,
where non-weak symbols won't be preempted.  The resulting code is slightly
smaller.  This option mainly affects the handling of branch instructions.

gas/

	* config/tc-i386.c (no_shared): New.
	(OPTION_MNO_SHARED): Likewise.
	(elf_symbol_resolved_in_segment_p): Check no_shared.
	(md_longopts): Add mno-shared.
	(md_parse_option): Handle OPTION_MNO_SHARED.
	(md_show_usage): Add -mno-shared.
	* doc/c-i386.texi: Document -mno-shared.

gas/testsuite/

	* gas/i386/i386.exp: Run relax-4 and x86-64-relax-3.
	* gas/i386/relax-4.d: New file.
	* gas/i386/x86-64-relax-3.d: Likewise.
2015-05-08 05:05:49 -07:00
H.J. Lu b084df0b8d Optimize branches to non-weak symbols with visibility
Branches to global non-weak symbols defined in the same segment with
non-default visibility can be optimized the same way as branches to
local symbols.

gas/

	* config/tc-i386.c (elf_symbol_resolved_in_segment_p): New.
	(md_estimate_size_before_relax): Use it.

gas/testsuite/

	* gas/i386/i386.exp: Run relax-3 and x86-64-relax-2.
	* gas/i386/relax-3.d: New file.
	* gas/i386/relax-3.s: Likewise.
	* gas/i386/x86-64-relax-2.d: Likewise.
2015-05-07 09:19:16 -07:00
Jose E. Marchesi 0d495746bb gas: typo in comment fixed.
gas/ChangeLog:

2015-05-06  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* config/tc-sparc.c: Typo in comment fixed.
2015-05-06 09:28:22 -07:00
Jose E. Marchesi f9911bebca gas: support for the sparc %ncc condition codes register.
gas/ChangeLog:

2015-05-06  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* config/tc-sparc.c (sparc_ip): Support the %ncc "natural"
	condition codes
	* doc/c-sparc.texi (Sparc-Regs): Document %ncc.

gas/testsuite/ChangeLog:

2015-05-06  Jose E. Marchesi  <jose.marchesi@oracle.com>

	* gas/sparc/natural.s: New file.
	* gas/sparc/natural-32.s: Likewise.
	* gas/sparc/natural.d: Likewise.
	* gas/sparc/natural-32.d: Likewise.
	* gas/sparc/sparc.exp (sparc_elf_setup): Run the tests natural and
	natural-32.
2015-05-06 09:26:23 -07:00
Nick Clifton ed1fcdd119 Update GAS documentation to note that dollar local labels are only supported on some targets.
* doc/as.texinfo (Dollar Local Labels): Note that these are only
	supported on some targets.
2015-05-06 13:13:10 +01:00
Renlin Li 448eb63d72 [AArch64] Record instruction alignment for .inst directive
2015-05-06  Renlin Li  <renlin.li@arm.com>

  gas/
    * config/tc-aarch64.c (mapping_state): Recording alignment before exit.

  gas/testsuite/
    * gas/aarch64/codealign_1.s: New.
    * gas/aarch64/codealign_1.d: New.
2015-05-06 12:18:19 +01:00
Renlin Li c7ad08e6e5 [AARCH64] Positively emit symbols for alignment
2015-05-05  Renlin Li  <renlin.li@arm.com>

  gas/
    * config/tc-aarch64.c (aarch64_init_frag): Always generate mapping symbols.

  gas/testsuite/
    * gas/aarch64/mapping_5.d: New.
    * gas/aarch64/mapping_5.s: New.
    * gas/aarch64/mapping_6.d: New.
    * gas/aarch64/mapping_6.s: New.
2015-05-05 17:48:18 +01:00
Nick Clifton 837a17b36c Add support to the MSP430 linker for the automatic placement of code and data into either low or high memory regions.
gas	* config/tc-msp430.c (MAX_OP_LEN): Increase to 4096.
	(msp430_make_init_symbols): New function.
	(msp430_section): Call it.
	(msp430_frob_section): Likewise.

ld	* emulparams/msp430elf.sh (TEMPLATE_NAME): Change to msp430.
	* scripttempl/msp430.sc (.text): Add .lower.text and .either.text.
	(.data): Add .lower.data and .either.data.
	(.bss): Add .lower.bss and .either.bss.
	(.rodata): Add .lower.rodata and .either.rodata.
	* emultempl/msp430.em: New file.  Implements a new orphan
	placement algorithm that divides sections between lower and upper
	memory regions.
	* Makefile.am (emsp430elf.c): Depend upon msp430.em.
	*emsp430X.c): Likewise.
	* Makefine.in: Regenerate.
2015-05-05 13:38:00 +01:00
Max Filippov b76f99d702 xtensa: optimize trampolines relaxation
Currently every fixup in the current segment is checked when relaxing
trampoline frag. This is very expensive. Make a searchable array of
fixups pointing at potentially oversized jumps at the beginning of every
relaxation pass and only check subset of this cache in the reach of
single jump from the trampoline frag currently being relaxed.

Original profile:

% time    self  children    called     name
-----------------------------------------
        370.16  593.38 12283048/12283048     relax_segment
  98.4  370.16  593.38 12283048         xtensa_relax_frag
         58.91  269.26 2691463834/2699602236     xtensa_insnbuf_from_chars
         68.35   68.17 811266668/813338977     S_GET_VALUE
         36.85   29.51 2684369246/2685538060     xtensa_opcode_decode
         28.34    8.84 2684369246/2685538060     xtensa_format_get_slot
         12.39    5.94 2691463834/2699775044     xtensa_format_decode
          0.03    4.60 4101109/4101109     relax_frag_for_align
          0.18    1.76  994617/994617      relax_frag_immed
          0.07    0.09 24556277/24851220     new_logical_line
          0.06    0.00 12283048/14067410     as_where
          0.04    0.00 7094588/15460506     xtensa_format_num_slots
          0.00    0.00       1/712477      xtensa_insnbuf_alloc
-----------------------------------------

Same data, after optimization:

% time    self  children    called     name
-----------------------------------------
          0.51    7.47 12283048/12283048     relax_segment
  58.0    0.51    7.47 12283048         xtensa_relax_frag
          0.02    4.08 4101109/4101109     relax_frag_for_align
          0.18    1.39  994617/994617      relax_frag_immed
          0.01    0.98     555/555         xtensa_cache_relaxable_fixups
          0.21    0.25 7094588/16693271     xtensa_insnbuf_from_chars
          0.06    0.12 24556277/24851220     new_logical_line
          0.06    0.00 7094588/15460506     xtensa_format_num_slots
          0.02    0.04 7094588/16866079     xtensa_format_decode
          0.05    0.00 12283048/14067410     as_where
          0.00    0.00       1/712477      xtensa_insnbuf_alloc
          0.00    0.00   93808/93808       xtensa_find_first_cached_fixup
-----------------------------------------

2015-05-02  Max Filippov  <jcmvbkbc@gmail.com>
gas/
	* config/tc-xtensa.c (cached_fixupS, fixup_cacheS): New typedefs.
	(struct cached_fixup, struct fixup_cache): New structures.
	(fixup_order, xtensa_make_cached_fixup),
	(xtensa_realloc_fixup_cache, xtensa_cache_relaxable_fixups),
	(xtensa_find_first_cached_fixup, xtensa_delete_cached_fixup),
	(xtensa_add_cached_fixup): New functions.
	(xtensa_relax_frag): Cache fixups pointing at potentially
	oversized jumps at the beginning of every relaxation pass. Only
	check subset of this cache in the reach of single jump from the
	trampoline frag currently being relaxed.
2015-05-05 07:57:33 +03:00
DJ Delorie d62de9aa69 Fix typos in previous patch.
* config/rl78-parse.y (MULU): Remove ISA_G14.
(MULH, DIVHU, DIVWU, MACHI, MACH): Update error strings.
2015-05-01 15:08:07 -04:00
H.J. Lu 00923338de Remove i386_elf_emit_arch_note
This x86 assembler patch:

https://sourceware.org/ml/binutils/2001-11/msg00344.html

generates a .note section for .arch directive so that GDB can tell which
architecture an i386 binary belongs:

https://sourceware.org/ml/binutils/2001-11/msg00271.html

However, x86 assembly code can have any instructions.  A .note section
doesn't help.  This patch removes it.

gas/

	* config/tc-i386.c (i386_elf_emit_arch_note): Removed.
	* config/tc-i386.h (md_end): Likewise.
	(i386_elf_emit_arch_note): Likewise.

gas/testsuite/

	* gas/i386/i386.exp: Run note.
	* gas/i386/note.d: New file.
	* gas/i386/note.s: Likewise.
2015-05-01 08:29:16 -07:00
H.J. Lu b633b7258d Support ix86-*-elf*
bfd/

	* config.bfd: Support i[3-7]86-*-elf*.

gas/

	* configure.tgt: Support i386-*-elf*.
2015-05-01 05:02:30 -07:00
DJ Delorie 0952813b0b Make RL78 disassembler and simulator respect ISA for mul/div
[gas]
	* config/rl78-defs.h (rl78_isa_g10): New.
	(rl78_isa_g13): New.
	(rl78_isa_g14): New.
	* config/rl78-parse.y (ISA_G10): New.
	(ISA_G13): New.
	(ISA_G14): New.
	(MULHU, MULH, MULU, DIVHU, DIVWU, MACHU, MACH): Use them.
	* config/tc-rl78.c (rl78_isa_g10): New.
	(rl78_isa_g13): New.
	(rl78_isa_g14): New.

[gdb]
	* rl78-tdep.c (rl78_analyze_prologue): Pass RL78_ISA_DEFAULT to
	rl78_decode_opcode

[include]
	* dis-asm.h (print_insn_rl78_g10): New.
	(print_insn_rl78_g13): New.
	(print_insn_rl78_g14): New.
	(rl78_get_disassembler): New.
	* opcode/rl78.h (RL78_Dis_Isa): New.
	(rl78_decode_opcode): Add ISA parameter.

[opcodes]
	* disassemble.c (disassembler): Choose suitable disassembler based
	on E_ABI.
	* rl78-decode.opc (rl78_decode_opcode): Take ISA parameter.  Use
	it to decode mul/div insns.
	* rl78-decode.c: Regenerate.
	* rl78-dis.c (print_insn_rl78): Rename to...
	(print_insn_rl78_common): ...this, take ISA parameter.
	(print_insn_rl78): New.
	(print_insn_rl78_g10): New.
	(print_insn_rl78_g13): New.
	(print_insn_rl78_g14): New.
	(rl78_get_disassembler): New.

[sim]
	* rl78/cpu.c (g14_multiply): New.
	* rl78/cpu.h (g14_multiply): New.
	* rl78/load.c (rl78_load): Decode ISA completely.
	* rl78/main.c (main): Expand -M to include other ISAs.
	* rl78/rl78.c (decode_opcode): Decode based on ISA.
	* rl78/trace.c (rl78_disasm_fn): New.
	(sim_disasm_init): Reset it.
	(sim_disasm_one): Get correct disassembler for ISA.
2015-04-30 15:25:49 -04:00
H.J. Lu b49f93f699 Use "else if" on cpu_arch_isa
* config/tc-i386.c (i386_target_format): Use "else if" on
	cpu_arch_isa.
2015-04-30 08:36:17 -07:00
Nick Clifton 8b2d793ce5 GAS ARM: Warn if the user creates a symbol with the same name as an instruction.
PR gas/18347
gas	* config/tc-arm.c (md_undefined_symbol): Issue a warning message
	(if enabled) when the user creates a symbol with the same name as
	an ARM instruction.
	(flag_warn_syms): New static variable.
	(arm_opts): Add mwarn-syms and mno-warn-syms.
	* doc/c-arm.texi (ARM Options): Document the -m[no-]warn-syms
	options.

tests	* gas/arm/pr18347.s: New file: Test case.
	* gas/arm/pr18347.l: New file: Expected assembler output.
	* gas/arm/pr18347.d: New file: Test driver.
2015-04-30 11:17:55 +01:00
Nick Clifton 7ce98c164e Adds documentation of GAS's .zero directive.
PR gas/18353
	* doc/as.texinfo (Zero): Add documentation of the .zero pseudo-op.
2015-04-30 10:13:53 +01:00
Nick Clifton 99b2a2dd3c Fix an internal error in GAS when assembling a bogus piece of source code.
gas	PR 18256
	* config/tc-arm.c (encode_arm_cp_address): Issue an error message
	if the operand is neither a register nor a vector.

tests	* gas/arm/pr18256.s: New file: Test case.
	* gas/arm/pr18256.l: New file: Expected assembler output.
	* gas/arm/pr18256.d: New file: Test driver.
2015-04-29 17:09:05 +01:00
Nick Clifton 5d239759c0 Updates the description of GAS's .set directive, to note that for some targets a symbolic value can only be set once.
* doc/as.texinfo (Set): Note that a symbol cannot be set multiple
	times if the expression is not constant and the target uses linker
	relaxation.
2015-04-29 11:10:45 +01:00
Renlin Li f9c1b181a7 [ARM]Positively emit symbols for alignment
2015-04-28  Renlin Li  <renlin.li@arm.com>
  gas/
    * config/tc-arm.c (arm_init_frag): Always emit mapping symbols.

  gas/testsuite/
    * gas/arm/thumb2_vpool_be.d: Adjust the desired output.
    * gas/arm/vldconst_be.d: Ditto.
2015-04-28 17:10:26 +01:00