Commit Graph

2519 Commits

Author SHA1 Message Date
Peter Bergner 4bc0608a8b Fix some PPC assembler errors.
Remove the wait instructions for server processors, since they were never
implemented.  Also add the extra operands added to the tlbie and slbia
instructions with ISA 2.06 and ISA 2.05 respectively.

binutils/
	* MAINTAINERS: Add myself as PPC maintainer.

opcodes/
        * ppc-opc.c (IH) New define.
        (powerpc_opcodes) <wait>: Do not enable for POWER7.
        <tlbie>: Add RS operand for POWER7.
        <slbia>: Add IH operand for POWER6.

gas/testsuite/
        * gas/ppc/power4.d: Add a slbia test.
        * gas/ppc/power4.s: Likewise.
        * gas/ppc/power6.d: Add slbia and tlbie tests.
        * gas/ppc/power6.s: Likewise.
        * gas/ppc/power7.d: Remove wait tests. Add a tlbie test.
        * gas/ppc/power7.s: Likewise.
2015-05-14 21:02:50 -05: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 31955f993d Add missing ChangeLog entries for PR binutis/18386 2015-05-13 04:33:45 -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 9e85c798e3 gas: added tests for the sparc natural instructions.
gas/ChangeLog:

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

	* gas/sparc/natural-32.d: Test ldn, ldna, stn, stna, slln, srln,
	sran, casn, casna and clrn.
	* gas/sparc/natural-32.s: Likewise.
	* gas/sparc/natural.s: Likewise.
	* gas/sparc/natural.d: Likewise.
2015-05-06 09:27:52 -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
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
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
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 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
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
Peter Bergner 4fff86c517 opcodes/
* ppc-opc.c (DCBT_EO): New define.
	(powerpc_opcodes) <lbarx>: Enable for POWER8 and later.
	<lharx>: Likewise.
	<stbcx.>: Likewise.
	<sthcx.>: Likewise.
	<waitrsv>: Do not enable for POWER7 and later.
	<waitimpl>: Likewise.
	<dcbt>: Default to the two operand form of the instruction for all
	"old" cpus.  For "new" cpus, use the operand ordering that matches
	whether the cpu is server or embedded.
	<dcbtst>: Likewise.

gas/testsuite/

	* gas/ppc/a2.s: Fixup test case due to dcbt/dcbtst embedded operand
	ordering change.
	* gas/ppc/a2.d: Likewise.
	* gas/ppc/476.d: Likewise.
	* gas/ppc/booke.s: Remove invalid 3 operand dcbt tests.
	* gas/ppc/booke.d: Likewise.
	* gas/ppc/power7.s: Remove lbarx, lharx, stbcx., sthcx., waitrsv
	and waitimpl tests.
	* gas/ppc/power7.d: Likewise.
2015-04-27 11:06:54 -05:00
Andreas Krebbel 643f7afb0d S/390: z13 use GNU attribute to indicate vector ABI
bfd/
	* elf-s390-common.c (elf_s390_merge_obj_attributes): New function.
	* elf32-s390.c (elf32_s390_merge_private_bfd_data): Call
	elf_s390_merge_obj_attributes.
	* elf64-s390.c (elf64_s390_merge_private_bfd_data): New function.

binutils/
	* readelf.c (display_s390_gnu_attribute): New function.
	(process_s390_specific): New function.
	(process_arch_specific): Call process_s390_specific.

gas/
	* doc/as.texinfo: Document Tag_GNU_S390_ABI_Vector.

include/elf/
	* s390.h: Define Tag_GNU_S390_ABI_Vector.
2015-04-27 10:32:23 +02:00
Andreas Krebbel 3b78cfe103 S/390: Fixes for z13 instructions.
opcodes/
	* s390-opc.c: New instruction type VV0UU2.
	* s390-opc.txt: Fix instruction types for VFCE, VLDE, VFSQ, WFK,
	and WFC.

gas/testsuite/
	* gas/s390/zarch-z13.d: Fix tests for VFCE, VLDE, VFSQ, WFK, and
	WFC.
  	* gas/s390/zarch-z13.s: Likewise.
2015-04-27 10:29:16 +02:00
Richard Earnshaw 7a5c933c7c [ARM]: Don't tail-pad over-aligned functions to the alignment boundary.
2015-04/24  Richard Earnshaw  <rearnsha@arm.com>

	gas/
	* config/tc-arm.h (arm_min): New function.
	(SUB_SEGMENT_ALIGN): Define.

	gas/testsuite/
	* gas/arm/align64.d: Delete trailing padding NOPs.

	ld/testsuite/
	* ld-arm/armthumb-lib.d: Regenerate expected output.
	* ld-arm/armthumb-lib.d: Likewise.
	* ld-arm/armthumb-lib.sym: Likewise.
	* ld-arm/cortex-a8-fix-b-rel-arm.d: Likewise.
	* ld-arm/cortex-a8-fix-b-rel-thumb.d: Likewise.
	* ld-arm/cortex-a8-fix-b.d: Likewise.
	* ld-arm/cortex-a8-fix-bcc-rel-thumb.d: Likewise.
	* ld-arm/cortex-a8-fix-bcc.d: Likewise.
	* ld-arm/cortex-a8-fix-bl-rel-arm.d: Likewise.
	* ld-arm/cortex-a8-fix-bl-rel-plt.d: Likewise.
	* ld-arm/cortex-a8-fix-bl-rel-thumb.d: Likewise.
	* ld-arm/cortex-a8-fix-bl.d: Likewise.
	* ld-arm/cortex-a8-fix-blx-bcond.d: Likewise.
	* ld-arm/cortex-a8-fix-blx-rel-arm.d: Likewise.
	* ld-arm/cortex-a8-fix-blx-rel-thumb.d: Likewise.
	* ld-arm/cortex-a8-fix-blx.d: Likewise.
	* ld-arm/cortex-a8-fix-hdr.d: Likewise.
	* ld-arm/farcall-mixed-app-v5.d: Likewise.
	* ld-arm/farcall-mixed-app.d: Likewise.
	* ld-arm/farcall-mixed-lib-v4t.d: Likewise.
	* ld-arm/farcall-mixed-lib.d: Likewise.
	* ld-arm/mixed-app-v5.d: Likewise.
	* ld-arm/mixed-app.d: Likewise.
	* ld-arm/mixed-lib.d: Likewise.
2015-04-24 15:54:39 +01:00
Matthew Fortune ece794d9c4 Improve warning messages for la/dla
gas/

	* config/tc-mips.c (macro): State the recommended way of creating
	32-bit or 64-bit addresses.

gas/testsuite/

	* gas/mips/dla-warn.l: New file.
	* gas/mips/dla-warn.s: New file.
	* gas/mips/la-warn.l: New file.
	* gas/mips/la-warn.s: New file.
	* gas/mips/mips.exp: Run new tests.
2015-04-23 22:23:17 +01:00
Matthew Fortune 2ca4ff6d5b Fix r6-branch-constraints test when run with n64 as default ABI
gas/testsuite/

	* gas/mips/mips.exp: Require o32 for r6-branch-constraints.
2015-04-23 21:03:32 +01:00
Jan Beulich 04d824a468 x86: disambiguate disassembly of certain AVX512 insns
Certain conversion operations as well as vfpclassp{d,s} are ambiguous
when the input operand is in memory and no broadcast is being used.
While in Intel mode this gets resolved by printing suitable operand
size modifiers, AT&T mode need mnemonic suffixes to be added.

gas/testsuite/
2015-04-23  Jan Beulich  <jbeulich@suse.com>

	* gas/i386/avx512dq.d: Add 'z' suffix to vfpclassp{d,s} non-
	register, non-broadcast cases.
	* gas/i386/x86-64-avx512dq.d: Likewise.
	* gas/i386/avx512dq_vl.d: Add 'x' and 'y' suffixes to
	vcvt{,u}qq2ps and vfpclassp{d,s} non-register, non-broadcast
	cases.
	* gas/i386/x86-64-avx512dq_vl.d: Likewise.
	* gas/i386/avx512f_vl.d: Add 'x' and 'y' suffixes to
	vcvt{,t}pd2{,u}dq and vcvtpd2ps non-register, non-broadcast
	cases.
	* gas/i386/x86-64-avx512f_vl.d: Likewise.

opcodes/
2015-04-23  Jan Beulich  <jbeulich@suse.com>

	* i386-dis.c (putop): Extend "XY" handling to AVX512. Handle "XZ".
	* i386-dis-evex.h.c (vcvtpd2ps, vcvtqq2ps, vcvttpd2udq,
	vcvtpd2udq, vcvtuqq2ps, vcvttpd2dq, vcvtpd2dq): Add %XY.
	(vfpclasspd, vfpclassps): Add %XZ.
2015-04-23 16:42:40 +02:00
Jan Beulich af508cb92f x86: don't require operand size specification for AVX512 broadcasts
Certain conversion operations as well as vfpclassp{d,s} are ambiguous
when the input operand is in memory. That ambiguity, however, doesn't
apply when using broadcasts (the destination operand size can be
induced from the broadcast specifier).

gas/
2015-04-23  Jan Beulich  <jbeulich@suse.com>

	* config/tc-i386.c (match_mem_size): Also allow no size
	specification when broadcasting.

gas/testsuite/
2015-04-23  Jan Beulich  <jbeulich@suse.com>

	* gas/i386/avx512dq.s: Drop 'z' suffix from vfpclassp{d,s} in
	some AT&T and all Intel cases.
	* gas/i386/x86-64-avx512dq.s: Likewise.
	* gas/i386/avx512dq_vl.s: Drop 'x' and 'y' suffixes from
	vcvt{,u}qq2ps and vfpclassp{d,s} in some AT&T and all Intel
	cases.
	* gas/i386/x86-64-avx512dq_vl.s: Likewise.
	* gas/i386/avx512f_vl.s: Drop 'x' and 'y' suffixes from
	vcvt{,t}pd2{,u}dq and vcvtpd2ps in some AT&T and all Intel
	cases.
	* gas/i386/x86-64-avx512f_vl.s: Likewise.
2015-04-23 16:41:21 +02:00
H.J. Lu be59ad3d96 Don't hardcode offset of .shstrtab section
There is no requirement on placement of section name section, .shstrtab.
This patch removes hardcoded offsets of .shstrtab sections.

binutils/testsuite/

	* binutils-all/i386/compressed-1b.d: Don't hardcode offset of
	.shstrtab section.
	* binutils-all/i386/compressed-1c.d: Likewise.
	* binutils-all/readelf.s-64: Likewise.
	* binutils-all/x86-64/compressed-1b.d: Likewise.
	* binutils-all/x86-64/compressed-1c.d: Likewise.

gas/testsuite/

	* gas/i386/ilp32/x86-64-unwind.d: Don't hardcode offset of
	.shstrtab section.
	* gas/i386/x86-64-unwind.d: Likewise.
	* gas/ia64/alias-ilp32.d: Likewise.
	* gas/ia64/alias.d: Likewise.
	* gas/ia64/group-1.d: Likewise.
	* gas/ia64/group-2.d: Likewise.
	* gas/ia64/secname-ilp32.d: Likewise.
	* gas/ia64/secname.d: Likewise.
	* gas/ia64/unwind-ilp32.d: Likewise.
	* gas/ia64/unwind.d: Likewise.
	* gas/mmix/bspec-1.d: Likewise.
	* gas/mmix/byte-1.d: Likewise.
	* gas/mmix/loc-1.d: Likewise.
	* gas/mmix/loc-2.d: Likewise.
	* gas/mmix/loc-3.d: Likewise.
	* gas/mmix/loc-4.d: Likewise.
	* gas/mmix/loc-5.d: Likewise.
	* gas/tic6x/scomm-directive-4.d: Likewise.

ld/testsuite/

	* ld-mmix/bspec1.d: Don't hardcode offset of .shstrtab section.
	* ld-mmix/bspec2.d: Likewise.
	* ld-mmix/local1.d: Likewise.
	* ld-mmix/local3.d: Likewise.
	* ld-mmix/local5.d: Likewise.
	* ld-mmix/local7.d: Likewise.
	* ld-mmix/undef-3.d: Likewise.
	* ld-sh/sh64/crangerel1.rd: Likewise.
	* ld-sh/sh64/crangerel2.rd: Likewise.
	* ld-tic6x/common.d: Likewise.
	* ld-tic6x/shlib-1.rd: Likewise.
	* ld-tic6x/shlib-1b.rd: Likewise.
	* ld-tic6x/shlib-1r.rd: Likewise.
	* ld-tic6x/shlib-1rb.rd: Likewise.
	* ld-tic6x/shlib-app-1.rd: Likewise.
	* ld-tic6x/shlib-app-1b.rd: Likewise.
	* ld-tic6x/shlib-app-1r.rd: Likewise.
	* ld-tic6x/shlib-app-1rb.rd: Likewise.
	* ld-tic6x/shlib-noindex.rd: Likewise.
	* ld-tic6x/static-app-1.rd: Likewise.
	* ld-tic6x/static-app-1b.rd: Likewise.
	* ld-tic6x/static-app-1r.rd: Likewise.
	* ld-tic6x/static-app-1rb.rd: Likewise.
	* ld-x86-64/ilp32-4.d: Likewise.
	* ld-x86-64/split-by-file-nacl.rd: Likewise.
	* ld-x86-64/split-by-file.rd: Likewise.
2015-04-20 09:55:47 -07:00
H.J. Lu f24bcbaa5a Handle invalid prefixes for rdrand and rdseed
This patch puts rdrand and rdseed in prefix_table so that invalid
prefixes for rdrand and rdseed are handled properly.

gas/testsuite/

	PR binutils/17898
	* gas/i386/prefix.s: Add rdrand/rdseed prefix tests.
	* gas/i386/prefix.d: Updated.

opcodes/

	PR binutils/17898
	* i386-dis.c (PREFIX_0FC7_REG_6): Renamed to ...
	(PREFIX_MOD_0_0FC7_REG_6): This.
	(PREFIX_MOD_3_0FC7_REG_6): New.
	(PREFIX_MOD_3_0FC7_REG_7): Likewise.
	(prefix_table): Replace PREFIX_0FC7_REG_6 with
	PREFIX_MOD_0_0FC7_REG_6.  Add PREFIX_MOD_3_0FC7_REG_6 and
	PREFIX_MOD_3_0FC7_REG_7.
	(mod_table): Replace PREFIX_0FC7_REG_6 with
	PREFIX_MOD_0_0FC7_REG_6.  Use PREFIX_MOD_3_0FC7_REG_6 and
	PREFIX_MOD_3_0FC7_REG_7.
2015-04-15 09:57:55 -07:00
Renlin Li f0fba320ab [ARM] Disassembles SSAT and SSAT16 instructions incorrectly for Thumb-2
2015-04-15  Renlin Li  <renlin.li@arm.com>
opcodes/:
    * arm-dis.c (thumb32_opcodes): Define 'D' format control code,
    use it for ssat and ssat16.
    (print_insn_thumb32): Add handle case for 'D' control code.

gas/testsuite/:
    * gas/arm/arch7em.d: Adjust required ssat and ssat16 immediate field.
    * gas/arm/thumb32.d: Likewise.
2015-04-15 17:44:03 +01:00
Nick Clifton 6ff71e7681 Adds support to the RL78 port for linker relaxation affecting .debug sections.
gas	* config/tc-rl78.h (TC_LINKRELAX_FIXUP): Define.
	(TC_FORCE_RELOCATION_SUB_SAME): Define.
	(DWARF2_USE_FIXED_ADVANCE_PC): Define.

	* gas/lns/lns.exp: Add RL78 to list of targets using
	DW_LNS_fixed_advance_pc.

bfd	* elf32-rl78.c (RL78_OP_REL): New macro.
	(rl78_elf_howto_table): Use it for complex relocs.
	(get_symbol_value): Handle the cases when the info or status
	arguments are NULL.
	(get_romstart): Cache the status returned by get_symbol_value.
	(get_ramstart): Likewise.
	(RL78_STACK_PUSH): Generate an error message if the stack
	overflows.
	(RL78_STACK_POP): Likewise for underflows.
	(rl78_compute_complex_reloc): New function.  Contains the basic
	processing code for all RL78 complex relocs.
	(rl78_special_reloc): New function.  Provides special reloc
	handling for complex relocs.
	(rl78_elf_relocate_section): Use rl78_compute_complex_reloc.
	(rl78_offset_for_reloc): Likewise.

binutils* readelf.c (target_specific_reloc_handling): Add code to handle
	RL78 complex relocs.
2015-04-14 16:23:33 +01:00
H.J. Lu 151411f8af Add SHF_COMPRESSED support to gas and objcopy
This patch adds --compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}
options to gas and objcopy for ELF files. They control how DWARF debug
sections are compressed.  --compress-debug-sections=none is equivalent to
--nocompress-debug-sections.  --compress-debug-sections=zlib and
--compress-debug-sections=zlib-gnu are equivalent to
--compress-debug-sections.  --compress-debug-sections=zlib-gabi compresses
DWARF debug sections with SHF_COMPRESSED from the ELF ABI.  No linker
changes are required to support SHF_COMPRESSED.

bfd/

	* archive.c (_bfd_get_elt_at_filepos): Also copy BFD_COMPRESS_GABI
	bit.
	* bfd.c (bfd::flags): Increase size to 18 bits.
	(BFD_COMPRESS_GABI): New.
	(BFD_FLAGS_SAVED): Add BFD_COMPRESS_GABI.
	(BFD_FLAGS_FOR_BFD_USE_MASK): Likewise.
	(bfd_update_compression_header): New fuction.
	(bfd_check_compression_header): Likewise.
	(bfd_get_compression_header_size): Likewise.
	(bfd_is_section_compressed_with_header): Likewise.
	* compress.c (MAX_COMPRESSION_HEADER_SIZE): New.
	(bfd_compress_section_contents): Return the uncompressed size if
	the full section contents is compressed successfully.  Support
	converting from/to .zdebug* sections.
	(bfd_get_full_section_contents): Call
	bfd_get_compression_header_size to get compression header size.
	(bfd_is_section_compressed): Renamed to ...
	(bfd_is_section_compressed_with_header): This.  Add a pointer
	argument to return compression header size.
	(bfd_is_section_compressed): Use it.
	(bfd_init_section_decompress_status): Call
	bfd_get_compression_header_size to get compression header size.
	Return FALSE if uncompressed section size is 0.
	* elf.c (_bfd_elf_make_section_from_shdr): Support converting
	from/to .zdebug* sections.
	* bfd-in2.h: Regenerated.

binutils/

	* objcopy.c (do_debug_sections): Add compress_zlib,
	compress_gnu_zlib and compress_gabi_zlib.
	(copy_options): Use optional_argument on compress-debug-sections.
	(copy_usage): Update --compress-debug-sections.
	(copy_file): Handle compress_zlib, compress_gnu_zlib and
	compress_gabi_zlib.
	(copy_main): Handle
	--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
	* doc/binutils.texi: Document
	--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.

binutils/testsuite/

	* compress.exp: Add tests for
	--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
	* binutils-all/dw2-3.rS: New file.
	* binutils-all/dw2-3.rt: Likewise.
	* binutils-all/libdw2-compressedgabi.out: Likewise.

gas/

	* as.c (show_usage): Update --compress-debug-sections.
	(std_longopts): Use optional_argument on compress-debug-sections.
	(parse_args): Handle
	--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
	* as.h (compressed_debug_section_type): New.
	(flag_compress_debug): Change type to compressed_debug_section_type.
	--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.
	* write.c (compress_debug): Set BFD_COMPRESS_GABI for
	--compress-debug-sections=zlib-gabi.  Call
	bfd_get_compression_header_size to get compression header size.
	Don't rename section name for --compress-debug-sections=zlib-gabi.
	* config/tc-i386.c (compressed_debug_section_type): Set to
	COMPRESS_DEBUG_ZLIB.
	* doc/as.texinfo: Document
	--compress-debug-sections={none|zlib|zlib-gnu|zlib-gabi}.

gas/testsuite/

	* gas/i386/dw2-compressed-1.d: New file.
	* gas/i386/dw2-compressed-2.d: Likewise.
	* gas/i386/dw2-compressed-3.d: Likewise.
	* gas/i386/x86-64-dw2-compressed-2.d: Likewise.
	* gas/i386/i386.exp: Run dw2-compressed-2, dw2-compressed-1,
	dw2-compressed-3 and x86-64-dw2-compressed-2.

ld/testsuite/

	* ld-elf/compress.exp: Add a test for
	--compress-debug-sections=zlib-gabi.
	(build_tests): Add 2 tests for --compress-debug-sections=zlib-gabi.
	(run_tests): Likewise.
	Verify linker output with zlib-gabi compressed debug input.
	* ld-elf/compressed1a.d: New file.
	* ld-elf/compressed1b.d: Likewise.
	* ld-elf/compressed1c.d: Likewise.
2015-04-08 07:54:09 -07:00
H.J. Lu dae148f3b9 Remove is_zlib_supported
Since zlib is always supported, there is no need for is_zlib_supported.

binutils/testsuite/

	* binutils-all/compress.exp: Remove is_zlib_supported check.
	* binutils-all/objdump.exp: Likewise.
	* binutils-all/readelf.exp (readelf_compressed_wa_test): Likewise.
	* lib/utils-lib.exp (run_dump_test): Likewise.
	* lib/binutils-common.exp (is_zlib_supported): Removed.

gas/testsuite/

	* lib/gas-defs.exp (run_dump_test): Remove is_zlib_supported check.

ld/testsuite/

	* ld-elf/compress.exp: Remove is_zlib_supported check.
	Fail if --compress-debug-sections doesn't work.
	* lib/ld-lib.exp (run_dump_test): Remove is_zlib_supported check.
2015-04-06 12:19:13 -07:00
H.J. Lu 518a69099c Remove the last change on dw2-compress-1.d
The compressed .debug_info section is bigger than the original in 32-bit.
2015-03-31 08:20:55 -07:00
H.J. Lu 0138187e9f Add --with-system-zlib in gas
This patch adds --with-system-zlib and remove --with-zlib in gas.

gas/

	* Makefile.am (ZLIBINC): New.
	(AM_CFLAGS): Add $(ZLIBINC).
	* as.c: (show_usage): Don't check HAVE_ZLIB_H.
	(parse_args): Likewise.
	* compress-debug.c: Don't check HAVE_ZLIB_H to include <zlib.h>.
	(compress_init): Don't check HAVE_ZLIB_H.
	(compress_data): Likewise.
	(compress_finish): Likewise.
	* configure.ac (AM_ZLIB): Removed.
	(zlibinc): New.  AC_SUBST.
	Add --with-system-zlib.
	* Makefile.in: Regenerated.
	* config.in: Likewise.
	* configure: Likewise.
	* doc/Makefile.in: Likewise.

gas/testsuite/

	* gas/i386/dw2-compress-1.d: Expect .zdebug_info.
2015-03-31 03:56:12 -07: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 e2575e05e7 Fix building and testing dwarf debug section compression feature when zlib is not available.
PR gas/18087
gas/test	* gas/i386/dw2-compress-1.d: Allow the test to pass regardless of
	whether the .debug_info section was compressed on not.

bfd	* compress.c (bfd_compress_section_contents): Do not define this
	function if it is not used.
2015-03-19 12:14:56 +00:00
H.J. Lu d94077e27d Add a testcase for PR gas/18087
PR gas/18087
	* gas/i386/dw2-compress-1.d: Revert the last change.
	* gas/i386/dw2-compress-3.d: New.
	* gas/i386/dw2-compress-3.s: Likewise.
	* gas/i386/i386.exp: Run dw2-compress-3 for ELF targets.
2015-03-18 09:39:02 -07: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
Andrew Bennett 6914869aa7 MIPS: Fix constraint issues with the R6 beqc and bnec instructions
opcodes/
	* mips-opc.c (decode_mips_operand): Fix constraint issues
	with u and y operands.

gas/testsuite/
	* gas/mips/mips.exp: Added branch constraints testcase.
	* gas/mips/r6-branch-constraints.s: New test.
	* gas/mips/r6-branch-constraints.l: New test.
2015-03-13 23:01:34 +00:00
Andrew Bennett 21e20815a2 Add support for MIPS R6 evp and dvp instructions.
opcodes/
	* mips-opc.c (mips_builtin_opcodes): Add evp and dvp instructions.

gas/testsuite/
	* gas/mips/r6.s: Add evp and dvp instructions.
	* gas/mips/r6.d: Likewise.
	* gas/mips/r6-n32.d: Likewise.
	* gas/mips/r6-n64.d: Likewise.
2015-03-13 22:02:16 +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
Andreas Krebbel 6b1d7593a5 S/390: Add more IBM z13 instructions
opcodes/
2015-03-10  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* s390-opc.c: Add new IBM z13 instructions.
	* s390-opc.txt: Likewise.

gas/testsuite/
2015-03-10  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gas/s390/zarch-z13.d: Add more z13 instructions.
	* gas/s390/zarch-z13.s: Likewise.
2015-03-10 12:49:34 +01: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 c8f89a3423 [AARCH64] Remove Load/Store register (unscaled immediate) alias.
opcodes/ChangeLog:

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

	* aarch64-tbl.h (aarch64_opcode_table): Remove strub, ldurb, ldursb,
         stur, ldur, sturh, ldurh, ldursh, ldursw, prfum F_HAS_ALIAS flag and
         related alias.
	* aarch64-asm-2.c: Regenerate.
	* aarch64-dis-2.c: Likewise.
	* aarch64-opc-2.c: Likewise.

gas/testsuite/ChangeLog:

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

	* gas/aarch64/ldst-reg-uns-imm.d: Adjust expected output.
	* gas/aarch64/ldst-reg-unscaled-imm.d: Likewise.
	* gas/aarch64/reloc-insn.d: Likewise.
2015-03-10 11:27:56 +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
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 27228ca23e Adding test case for abuse of :got: in offset load
The :got: modifier is not meaningful in a register offset load store
instruction and should result in a diagnostic.
2015-02-26 22:23:09 +00:00
Marcus Shawcroft 3e29ed9f07 Add test case for ADR :got:foo
The modifier :got: does not make sense on an ADR instruction.  Add a
test case to ensure we gripe.
2015-02-26 22:23:09 +00:00
Andrew Burgess 137c83d69f avr/objdump: Support dumping .avr.prop section.
Add support to objdump for dumping the .avr.prop section in a structured
way.

binutils/ChangeLog:

	* od-elf32_avr.c: Add elf32-avr.h include.
	(OPT_AVRPROP): Define.
	(options[]): Add 'avr-prop' entry.
	(elf32_avr_help): Add avr-prop help text.
	(elf32_avr_dump_avr_prop): New function.
	(elf32_avr_dump): Add check for avr-prop.

bfd/ChangeLog:

	* elf32-avr.h (struct avr_property_header): New strucure.
	(avr_elf32_load_property_records): Declare.
	(avr_elf32_property_record_name): Declare.
	* elf32-avr.c: Add bfd_stdint.h include.
	(retrieve_local_syms): New function.
	(get_elf_r_symndx_section): New function.
	(get_elf_r_symndx_offset): New function.
	(internal_reloc_compare): New function.
	(struct avr_find_section_data): New structure.
	(avr_is_section_for_address): New function.
	(avr_find_section_for_address): New function.
	(avr_elf32_load_records_from_section): New function.
	(avr_elf32_load_property_records): New function.
	(avr_elf32_property_record_name): New function.

gas/testsuite/ChangeLog:

	* gas/avr/avr-prop-1.d: New file.
	* gas/avr/avr-prop-1.s: New file.
2015-02-25 23:17:27 +00:00