Commit Graph

56 Commits

Author SHA1 Message Date
Gunther Nikl 7d0bd48744 [GAS] change of ELF flags initial value in rx-linux
* config/tc-rx.c (elf_flags): Initialize for non-linux targets.
	(md_parse_option): Remove initialization of elf_flags.
2020-05-05 10:19:41 +01:00
Yoshinori Sato c578f16ef1 ld: Add rx-linux emulation. gas: Change ELF flags initial value in rx-linux
ld	* emulparams/elf32rx_linux.sh: New rx-linux emulation.
	* emultempl/rxlinux.em: New.
	* configure.tgt: Add rx-linux.
	* Makefile.am: Add eelf32rx_linux.c
	* Makefile.in: Regenerate.

gas	* config/tc-rx.c (elf_flags): Reset default value.
	(md_parse_option): For rx-elf Initialize elf_flags with RX_ABI.
2020-04-30 13:35:37 +01:00
H.J. Lu a8c4d40b57 ELF: Add support for unique section ID to assembler
Clang's integrated assembler supports multiple section with the same
name:

	.section .text,"ax",@progbits,unique,1
	nop
	.section .text,"ax",@progbits,unique,2
	nop

"unique,N" assigns the number, N, as the section ID, to a section.  The
valid values of the section ID are between 0 and 4294967295.  It can be
used to distinguish different sections with the same section name.

This is useful with -fno-unique-section-names -ffunction-sections.
-ffunction-sections by default generates .text.foo, .text.bar, etc.
Using the same string can save lots of space in .strtab.

This patch adds section_id to bfd_section and reuses the linker
internal bit in BFD section flags, SEC_LINKER_CREATED, for assmebler
internal use to mark valid section_id.  It also updates objdump to
compare section pointers if 2 sections comes from the same file since
2 different sections can have the same section name.

bfd/

	PR gas/25380
	* bfd-in2.h: Regenerated.
	* ecoff.c (bfd_debug_section): Add section_id.
	* section.c (bfd_section): Add section_id.
	(SEC_ASSEMBLER_SECTION_ID): New.
	(BFD_FAKE_SECTION): Add section_id.

binutils/

	PR gas/25380
	* objdump.c (sym_ok): Return FALSE if 2 sections are in the
	same file with different section pointers.

gas/

	PR gas/25380
	* config/obj-elf.c (section_match): Removed.
	(get_section): Also match SEC_ASSEMBLER_SECTION_ID and
	section_id.
	(obj_elf_change_section): Replace info and group_name arguments
	with match_p.  Also update the section ID and flags from match_p.
	(obj_elf_section): Handle "unique,N".  Update call to
	obj_elf_change_section.
	* config/obj-elf.h (elf_section_match): New.
	(obj_elf_change_section): Updated.
	* config/tc-arm.c (start_unwind_section): Update call to
	obj_elf_change_section.
	* config/tc-ia64.c (obj_elf_vms_common): Likewise.
	* config/tc-microblaze.c (microblaze_s_data): Likewise.
	(microblaze_s_sdata): Likewise.
	(microblaze_s_rdata): Likewise.
	(microblaze_s_bss): Likewise.
	* config/tc-mips.c (s_change_section): Likewise.
	* config/tc-msp430.c (msp430_profiler): Likewise.
	* config/tc-rx.c (parse_rx_section): Likewise.
	* config/tc-tic6x.c (tic6x_start_unwind_section): Likewise.
	* doc/as.texi: Document "unique,N" in .section directive.
	* testsuite/gas/elf/elf.exp: Run "unique,N" tests.
	* testsuite/gas/elf/section15.d: New file.
	* testsuite/gas/elf/section15.s: Likewise.
	* testsuite/gas/elf/section16.s: Likewise.
	* testsuite/gas/elf/section16a.d: Likewise.
	* testsuite/gas/elf/section16b.d: Likewise.
	* testsuite/gas/elf/section17.d: Likewise.
	* testsuite/gas/elf/section17.l: Likewise.
	* testsuite/gas/elf/section17.s: Likewise.
	* testsuite/gas/i386/unique.d: Likewise.
	* testsuite/gas/i386/unique.s: Likewise.
	* testsuite/gas/i386/x86-64-unique.d: Likewise.
	* testsuite/gas/i386/i386.exp: Run unique and x86-64-unique.

ld/

	PR gas/25380
	* testsuite/ld-i386/pr22001-1c.S: Use "unique,N" in .section
	directives.
	* testsuite/ld-i386/tls-gd1.S: Likewise.
	* testsuite/ld-x86-64/pr21481b.S: Likewise.
2020-02-02 17:08:01 -08:00
Alan Modra b3adc24a07 Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
Alan Modra fd3619828e bfd_section_* macros
This large patch removes the unnecessary bfd parameter from various
bfd section macros and functions.  The bfd is hardly ever used and if
needed for the bfd_set_section_* or bfd_rename_section functions can
be found via section->owner except for the com, und, abs, and ind
std_section special sections.  Those sections shouldn't be modified
anyway.

The patch also removes various bfd_get_section_<field> macros,
replacing their use with bfd_section_<field>, and adds
bfd_set_section_lma.  I've also fixed a minor bug in gas where
compressed section renaming was done directly rather than calling
bfd_rename_section.  This would have broken bfd_get_section_by_name
and similar functions, but that hardly mattered at such a late stage
in gas processing.

bfd/
	* bfd-in.h (bfd_get_section_name, bfd_get_section_vma),
	(bfd_get_section_lma, bfd_get_section_alignment),
	(bfd_get_section_size, bfd_get_section_flags),
	(bfd_get_section_userdata): Delete.
	(bfd_section_name, bfd_section_size, bfd_section_vma),
	(bfd_section_lma, bfd_section_alignment): Lose bfd parameter.
	(bfd_section_flags, bfd_section_userdata): New.
	(bfd_is_com_section): Rename parameter.
	* section.c (bfd_set_section_userdata, bfd_set_section_vma),
	(bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section),
	(bfd_set_section_size): Delete bfd parameter, rename section parameter.
	(bfd_set_section_lma): New.
	* bfd-in2.h: Regenerate.
	* mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param,
	update callers.
	* aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c,
	* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
	* compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h,
	* elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c,
	* elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c,
	* elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c,
	* elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c,
	* elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c,
	* elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c,
	* elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c,
	* elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c,
	* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c,
	* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
	* elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c,
	* elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
	* elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
	* elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c,
	* elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
	* elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c,
	* elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
	* elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c,
	* elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c,
	* elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c,
	* mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c,
	* peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c,
	* xcofflink.c: Update throughout for bfd section macro and function
	changes.
binutils/
	* addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c,
	* objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c,
	* od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c,
	* resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update
	throughout for bfd section macro and function changes.
gas/
	* as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c,
	* read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c,
	* config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c,
	* config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c,
	* config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c,
	* config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c,
	* config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c,
	* config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c,
	* config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c,
	* config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c,
	* config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c,
	* config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c,
	* config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c,
	* config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c,
	* config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c,
	* config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c,
	* config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c,
	* config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c,
	* config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c,
	* config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c,
	* config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c,
	* config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c,
	* config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for
	bfd section macro and function changes.
	* write.c (compress_debug): Use bfd_rename_section.
gdb/
	* aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c,
	* coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c,
	* dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c,
	* exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h,
	* hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c,
	* i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c,
	* maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c,
	* mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c,
	* objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c,
	* ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c,
	* rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c,
	* s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c,
	* solib-spu.c, * solib-svr4.c, * solib-target.c,
	* spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c,
	* symmisc.c, * symtab.c, * target.c, * windows-nat.c,
	* xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c,
	* mi/mi-interp.c: Update throughout for bfd section macro and
	function changes.
	* gcore (gcore_create_callback): Use bfd_set_section_lma.
	* spu-tdep.c (spu_overlay_new_objfile): Likewise.
gprof/
	* corefile.c, * symtab.c: Update throughout for bfd section
	macro and function changes.
ld/
	* ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c,
	* emultempl/aarch64elf.em, * emultempl/aix.em,
	* emultempl/armcoff.em, * emultempl/armelf.em,
	* emultempl/cr16elf.em, * emultempl/cskyelf.em,
	* emultempl/m68hc1xelf.em, * emultempl/m68kelf.em,
	* emultempl/mipself.em, * emultempl/mmix-elfnmmo.em,
	* emultempl/mmo.em, * emultempl/msp430.em,
	* emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em,
	* emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update
	throughout for bfd section macro and function changes.
libctf/
	* ctf-open-bfd.c: Update throughout for bfd section macro changes.
opcodes/
	* arc-ext.c: Update throughout for bfd section macro changes.
sim/
	* common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c,
	* erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c,
	* m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c,
	* rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c,
	* rx/trace.c: Update throughout for bfd section macro changes.
2019-09-19 09:40:13 +09:30
Nick Clifton 5ce032bdfc RX Assembler: Ensure that the internal limit on the number of relaxation iterations is not larger that the external limit.
PR 24464
	* config/tc-rx.h (md_relax_frag): Pass the max_iterations variable
	to the relaxation function.
	* config/tc-rx.c (rx_relax_frag): Add new parameter - the maximum
	number of iterations.  Make sure that our internal iteration limit
	does not exceed this external iteration limit.
2019-04-19 10:39:47 +01:00
Alan Modra 871a6bd2d8 Make frag fr_fix unsigned
The field only stores unsigned values, so let's make it unsigned to
stop people worrying about the possibility of negative values.

	* frags.h (struct frag <fr_fix>): Use unsigned type.
	* frags.c (frag_new): Assert that current size exceeds
	old_frags_var_max_size.
	* ehopt.c (get_cie_info): Adjust for unsigned fr_fix.
	* listing.c (calc_hex): Likewise.
	* write.c (cvt_frag_to_fill, write_relocs): Likewise.
	* config/tc-arc.c (md_convert_frag): Likewise.
	* config/tc-avr.c (avr_patch_gccisr_frag): Likewise.
	* config/tc-mips.c (md_convert_frag): Likewise.
	* config/tc-rl78.c (md_convert_frag): Likewise.
	* config/tc-rx.c (md_convert_frag): Likewise.
	* config/tc-sparc.c (md_apply_fix): Likewise.
	* config/tc-xtensa.c (next_instrs_are_b_retw): Likewise.
	(unrelaxed_frag_min_insn_count, unrelaxed_frag_has_b_j): Likewise.
2019-04-16 17:12:09 +09:30
Yoshinori Sato 6a25bee8d0 RX: gas - Add RXv3 instruction support.
Instruction manual.
https://www.renesas.com/us/en/doc/products/mpumcu/doc/rx_family/r01us0316ej0100-rxv3sm.pdf

	* config/rx-defs.h (rx_cpu_types): Add type RXV3 and RXV3FPU.
	(rx_bfield): Add prototype.
	(rx_post): Likewise.
	* config/rx-parse.y: Add v3 instructions and Double FPU registers.
	(DSIZE): Define.
	(POST): Define.
	(rx_check_v3): New. check v3 type.
	(rx_check_dfpu): New. check have double support.
	(double_condition_table): New. dcmp<cond> contiditon.
	(check_condition): Multiple condition support.
	(rx_lex): RXv3 instructions support.
	Add parse dcmp<cond> instruction and Double FPU registers.
	(immediate): Disable optimize in dmov #imm case.
	(displacement): Add double displacement in dmov instraction.
	* config/tc-rx.c (rx_use_conventional_section_names):
	Invert default value in rx-*-linux target.
	(cpu_type): Add additional ELF flags.
	(cpu_type_list): Add RXv3.
	(md_parse_option): Refer elf_flags from cpu_type_list.
	(md_show_usage): Add rxv3 and rxv3-dfpu.
	(rx_bytesT): Add post byte.
	(rx_bfield): New. generate bfmov / bfmovz "imm" field.
	(rx_post): New. Set instruction post byte.
	(md_assemble): Add post byte.
	doc/c-rx.texi: Add cpu types.
	* testsuite/gas/rx/Xtod.d: New.
	* testsuite/gas/rx/Xtod.sm: New.
	* testsuite/gas/rx/bfmov.d: New.
	* testsuite/gas/rx/bfmov.sm: New.
	* testsuite/gas/rx/dabs.d: New.
	* testsuite/gas/rx/dabs.sm: New.
	* testsuite/gas/rx/dadd.d: New.
	* testsuite/gas/rx/dadd.sm: New.
	* testsuite/gas/rx/dcmp.d: New.
	* testsuite/gas/rx/dcmp.sm: New.
	* testsuite/gas/rx/ddiv.d: New.
	* testsuite/gas/rx/ddiv.sm: New.
	* testsuite/gas/rx/dmov.d: New.
	* testsuite/gas/rx/dmov.sm: New.
	* testsuite/gas/rx/dmul.d: New.
	* testsuite/gas/rx/dmul.sm: New.
	* testsuite/gas/rx/dneg.d: New.
	* testsuite/gas/rx/dneg.sm: New.
	* testsuite/gas/rx/dpopm.d: New.
	* testsuite/gas/rx/dpopm.sm: New.
	* testsuite/gas/rx/dpushm.d: New.
	* testsuite/gas/rx/dpushm.sm: New.
	* testsuite/gas/rx/dround.d: New.
	* testsuite/gas/rx/dround.sm: New.
	* testsuite/gas/rx/dsqrt.d: New.
	* testsuite/gas/rx/dsqrt.sm: New.
	* testsuite/gas/rx/dsub.d: New.
	* testsuite/gas/rx/dsub.sm: New.
	* testsuite/gas/rx/dtoX.d: New.
	* testsuite/gas/rx/dtoX.sm: New.
	* testsuite/gas/rx/macros.inc: Add double FPU registers.
	* testsuite/gas/rx/mvfdc.d: New.
	* testsuite/gas/rx/mvfdc.sm: New.
	* testsuite/gas/rx/mvfdr.d: New.
	* testsuite/gas/rx/mvfdr.sm: New.
	* testsuite/gas/rx/mvtdc.d: New.
	* testsuite/gas/rx/mvtdc.sm: New.
	* testsuite/gas/rx/rstr.d: New.
	* testsuite/gas/rx/rstr.sm: New.
	* testsuite/gas/rx/rx.exp: Use rxv3-dfpu option.
	* testsuite/gas/rx/save.d: New.
	* testsuite/gas/rx/save.sm: New.
	* testsuite/gas/rx/xor.d: New.
	* testsuite/gas/rx/xor.sm: Add pattern.
2019-01-05 22:51:41 +09:00
Alan Modra 827041555a Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
Alan Modra 8d1015a887 Move struc-symbol.h to symbols.c
This file was never supposed to be widely used.  The fact that it has
found its way into many gas files led to bugs, typically when code
expecting a symbolS* to point at a struct symbol is presented with a
struct local_symbol.  Also, commit 158184ac9e changed these structs in
2012 but didn't catch all places where symbol bsym was being used to
test for a local_symbol.

	* Makefile.am (HFILES): Delete struc-symbol.h.
	* doc/internals.texi: Delete struc-symbol.h reference and out
	of date local symbol description.
	* struc-symbol.h: Delete.  Move contents to..
	* symbols.c: ..here.
	(symbol_on_chain, symbol_symbolS): New functions.
	* symbols.h (symbol_on_chain, symbol_symbolS): Declare.
	* cgen.c: Don't #include struc-symbol.h.
	(gas_cgen_parse_operand): Don't test for local_symbol using
	bsym, instead call symbol_symbolS.  Use symbol_get_bfdsym.
	(weak_operand_overflow_check, make_right_shifted_expr): Use
	symbol accessors.
	* config/obj-coff.c: Don't #include struc-symbol.h.
	(GET_FILENAME_STRING): Delete.
	* config/obj-elf.c: Don't #include struc-symbol.h.
	(elf_file_symbol): Use symbol accessors.
	(elf_adjust_symtab): Call symbol_on_chain.
	* config/obj-evax.c: Don't #include struc-symbol.h.
	* config/tc-nds32.c: Likewise.
	* config/tc-rl78.c: Likewise.
	* config/tc-rx.c: Likewise.
	* config/tc-alpha.c: Likewise.
	(add_to_link_pool, s_alpha_comm): Use symbol accessors.
	* config/tc-arc.c: Don't #include struc-symbol.h.
	(arc_check_relocs): Use symbol accessors, testing gas symbol
	section rather than bfd symbol section.
	* config/tc-avr.c: Don't #include struc-symbol.h.
	(avr_patch_gccisr_frag): Use symbol accessors.
	* config/tc-bfin.c: Don't #include struc-symbol.h.
	(bfin_loop_beginend): Use symbol accessors.
	* config/tc-csky.c: Don't #include struc-symbol.h.
	(v2_work_movih, v2_work_ori): Use symbol accessors.  Check for
	absolute symbol as well as O_constant.
	* config/tc-riscv.c: Don't #include struc-symbol.h.
	(riscv_pre_output_hook): Use symbol accessors.
	* config/tc-s390.c: Don't #include struc-symbol.h.
	(s390_literals): Use symbol accessors.
	* config/tc-score.c (s3_build_la_pic, s3_build_lwst_pic): Use
	symbol accessors.
	(s3_relax_branch_inst16, s3_relax_cmpbranch_inst32): Don't
	test symbol bsym.
	* config/tc-score7.c: Don't #include struc-symbol.h.
	(s7_build_la_pic, s7_build_lwst_pic): Use symbol accessors.
	(s7_b32_relax_to_b16): Don't test symbol bsym.
	* config/tc-sh.c: Don't #include struc-symbol.h.
	(insert_loop_bounds): Use symbol accessors.
	(sh_frob_section): Remove bogus symbol canonicalization.
	* config/tc-tic54x.c: Don't #include struc-symbol.h.
	(tic54x_bss): Use symbol accessors.
	* config/tc-tilegx.c: Don't #include struc-symbol.h.
	(emit_tilegx_instruction, tilegx_parse_name): Use symbol accessors.
	* config/tc-tilepro.c: Don't #include struc-symbol.h.
	(emit_tilepro_instruction, tilepro_parse_name): Use accessors.
	* config/tc-xtensa.c: Don't #include struc-symbol.h.
	(xg_assemble_vliw_tokens): Use symbol accessors.
	(xg_order_trampoline_chain): Likewise.
	* ehopt.c: Don't #include struc-symbol.h.
	(check_eh_frame): Correct local symbol test.  Use symbol accessors.
	* write.c: Don't #include struc-symbol.h.
	(create_note_reloc, maybe_generate_build_notes): Use symbol accessors.
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
2018-10-29 18:20:48 +10:30
Oleg Endo 49da480ff6 Fix the RX assembler so that it can handle escaped double quote characters, ie: \"
PR 22737
	* config/tc-rx.c (rx_start_line): Handle escaped double-quote character.
	* testsuite/gas/rx/pr22737.s: New test.
	* testsuite/gas/rx/pr22737.d: Likewise.
	* testsuite/gas/rx/rx.exp: Run the new test.
2018-01-22 14:31:10 +00:00
Alan Modra 219d1afa89 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
Nick Clifton 808811a369 Improve handling of REPT pseudo op with a negative count.
PR 22324
	* read.c (s_rept): Use size_t type for count parameter.
	(do_repeat): Change type of count parameter to size_t.
	Issue an error is the count parameter is negative.
	(do_repeat_with_expression): Likewise.
	* read.h: Update prototypes for do_repeat and
	do_repeat_with_expression.
	* doc/as.texinfo (Rept): Document that a zero count is allowed but
	negative counts are not.
	* config/tc-rx.c (rx_rept): Use size_t type for count parameter.
	* config/tc-tic54x.c (tic54x_loop): Cast count parameter to size_t
	type.
	* testsuite/gas/macros/end.s: Add a test using a negative repeat
	count.
	* testsuite/gas/macros/end.l: Add expected error message.
2017-10-20 11:45:19 +01:00
H.J. Lu a91e1603af Support ELF SHF_GNU_MBIND and PT_GNU_MBIND_XXX
Mark an ALLOC section, which should be placed in special memory area,
with SHF_GNU_MBIND.  Its sh_info field indicates the special memory
type.  GNU_MBIND section names start with ".mbind" so that they are
placed as orphan sections by linker.  All input GNU_MBIND sections
with the same sh_type, sh_flags and sh_info are placed in one output
GNU_MBIND section.  In executable and shared object, create a
GNU_MBIND segment for each GNU_MBIND section and its segment type is
PT_GNU_MBIND_LO plus the sh_info value.  Each GNU_MBIND segment is
aligned at page boundary.

The assembler syntax:

    .section .mbind.foo,"adx",%progbits
                          ^             0: Special memory type.
                          |
                         'd' for SHF_GNU_MBIND.

    .section .mbind.foo,"adx",%progbits,0x1
                          ^             1: Special memory type.
                          |
                         'd' for SHF_GNU_MBIND.

    .section .mbind.bar,"adG",%progbits,.foo_group,comdat,0x2
                          ^                               2: Special memory type.
                          |
                         'd' for SHF_GNU_MBIND.

bfd/

	* elf.c (get_program_header_size): Add a GNU_MBIND segment for
	each GNU_MBIND section and align GNU_MBIND section to page size.
	(_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
	segment for each GNU_MBIND section.
	(_bfd_elf_init_private_section_data): Copy sh_info from input
	for GNU_MBIND section.

binutils/

	* NEWS: Mention support for ELF SHF_GNU_MBIND and
	PT_GNU_MBIND_XXX.
	* readelf.c (get_segment_type): Handle PT_GNU_MBIND_XXX.
	(get_elf_section_flags): Handle SHF_GNU_MBIND.
	(process_section_headers): Likewise.
	* testsuite/binutils-all/mbind1.s: New file.
	* testsuite/binutils-all/objcopy.exp: Run readelf test on
	mbind1.s.

gas/

	* NEWS: Mention support for ELF SHF_GNU_MBIND.
	* config/obj-elf.c (section_match): New.
	(get_section): Match both sh_info and group name.
	(obj_elf_change_section): Add argument for sh_info.  Pass both
	sh_info and group name to get_section. Issue an error for
	SHF_GNU_MBIND section without SHF_ALLOC.  Set sh_info.
	(obj_elf_parse_section_letters): Set SHF_GNU_MBIND for 'd'.
	(obj_elf_section): Support SHF_GNU_MBIND section info.
	* config/obj-elf.h (obj_elf_change_section): Add argument for
	sh_info.
	* config/tc-arm.c (start_unwind_section): Pass 0 as sh_info to
	obj_elf_change_section.
	* config/tc-ia64.c (obj_elf_vms_common): Likewise.
	* config/tc-microblaze.c (microblaze_s_data): Likewise.
	(microblaze_s_sdata): Likewise.
	(microblaze_s_rdata): Likewise.
	(microblaze_s_bss): Likewise.
	* config/tc-mips.c (s_change_section): Likewise.
	* config/tc-msp430.c (msp430_profiler): Likewise.
	* config/tc-rx.c (parse_rx_section): Likewise.
	* config/tc-tic6x.c (tic6x_start_unwind_section): Likewise.
	* doc/as.texinfo: Document 'd' for SHF_GNU_MBIND.
	* testsuite/gas/elf/elf.exp: Run section12a, section12b and
	section13.
	* testsuite/gas/elf/section10.d: Updated.
	* testsuite/gas/elf/section10.s: Likewise.
	* testsuite/gas/elf/section12.s: New file.
	* testsuite/gas/elf/section12a.d: Likewise.
	* testsuite/gas/elf/section12b.d: Likewise.
	* testsuite/gas/elf/section13.l: Likewise.
	* testsuite/gas/elf/section13.d: Likewise.
	* testsuite/gas/elf/section13.s: Likewise.

include/

	* elf/common.h (PT_GNU_MBIND_NUM): New.
	(PT_GNU_MBIND_LO): Likewise.
	(PT_GNU_MBIND_HI): Likewise.
	(SHF_GNU_MBIND): Likewise.

ld/

	* NEWS: Mention support for ELF SHF_GNU_MBIND and
	PT_GNU_MBIND_XXX.
	* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Place
	input GNU_MBIND sections with the same type, attributes and
	sh_info field into a single output GNU_MBIND section.
	* testsuite/ld-elf/elf.exp: Run mbind2a and mbind2b.
	* testsuite/ld-elf/mbind1.s: New file.
	* testsuite/ld-elf/mbind1a.d: Likewise.
	* testsuite/ld-elf/mbind1b.d: Likewise.
	* testsuite/ld-elf/mbind1c.d: Likewise.
	* testsuite/ld-elf/mbind2a.s: Likewise.
	* testsuite/ld-elf/mbind2b.c: Likewise.
2017-04-04 09:06:04 -07:00
Nick Clifton 33eaf5de31 Fix spelling mistakes and typos in the GAS sources.
PR gas/21072
	* asintl.h: Fix spelling mistakes and typos.
	* atof-generic.c: Likewise.
	* bit_fix.h: Likewise.
	* config/atof-ieee.c: Likewise.
	* config/bfin-defs.h: Likewise.
	* config/bfin-parse.y: Likewise.
	* config/obj-coff-seh.h: Likewise.
	* config/obj-coff.c: Likewise.
	* config/obj-evax.c: Likewise.
	* config/obj-macho.c: Likewise.
	* config/rx-parse.y: Likewise.
	* config/tc-aarch64.c: Likewise.
	* config/tc-alpha.c: Likewise.
	* config/tc-arc.c: Likewise.
	* config/tc-arm.c: Likewise.
	* config/tc-avr.c: Likewise.
	* config/tc-bfin.c: Likewise.
	* config/tc-cr16.c: Likewise.
	* config/tc-cris.c: Likewise.
	* config/tc-crx.c: Likewise.
	* config/tc-d10v.c: Likewise.
	* config/tc-d30v.c: Likewise.
	* config/tc-dlx.c: Likewise.
	* config/tc-epiphany.c: Likewise.
	* config/tc-frv.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-m32r.c: Likewise.
	* config/tc-m68hc11.c: Likewise.
	* config/tc-m68k.c: Likewise.
	* config/tc-mcore.c: Likewise.
	* config/tc-mep.c: Likewise.
	* config/tc-mep.h: Likewise.
	* config/tc-metag.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-msp430.c: Likewise.
	* config/tc-msp430.h: Likewise.
	* config/tc-nds32.c: Likewise.
	* config/tc-nds32.h: Likewise.
	* config/tc-nios2.c: Likewise.
	* config/tc-nios2.h: Likewise.
	* config/tc-ns32k.c: Likewise.
	* config/tc-pdp11.c: Likewise.
	* config/tc-ppc.c: Likewise.
	* config/tc-pru.c: Likewise.
	* config/tc-rx.c: Likewise.
	* config/tc-s390.c: Likewise.
	* config/tc-score.c: Likewise.
	* config/tc-score7.c: Likewise.
	* config/tc-sh.c: Likewise.
	* config/tc-sh64.c: Likewise.
	* config/tc-sparc.c: Likewise.
	* config/tc-tic4x.c: Likewise.
	* config/tc-tic54x.c: Likewise.
	* config/tc-v850.c: Likewise.
	* config/tc-vax.c: Likewise.
	* config/tc-visium.c: Likewise.
	* config/tc-xgate.c: Likewise.
	* config/tc-xtensa.c: Likewise.
	* config/tc-z80.c: Likewise.
	* config/tc-z8k.c: Likewise.
	* config/te-vms.c: Likewise.
	* config/xtensa-relax.c: Likewise.
	* doc/as.texinfo: Likewise.
	* doc/c-arm.texi: Likewise.
	* doc/c-hppa.texi: Likewise.
	* doc/c-i370.texi: Likewise.
	* doc/c-i386.texi: Likewise.
	* doc/c-m32r.texi: Likewise.
	* doc/c-m68k.texi: Likewise.
	* doc/c-mmix.texi: Likewise.
	* doc/c-msp430.texi: Likewise.
	* doc/c-nds32.texi: Likewise.
	* doc/c-ns32k.texi: Likewise.
	* doc/c-riscv.texi: Likewise.
	* doc/c-rx.texi: Likewise.
	* doc/c-s390.texi: Likewise.
	* doc/c-tic6x.texi: Likewise.
	* doc/c-tilegx.texi: Likewise.
	* doc/c-tilepro.texi: Likewise.
	* doc/c-v850.texi: Likewise.
	* doc/c-xgate.texi: Likewise.
	* doc/c-xtensa.texi: Likewise.
	* dwarf2dbg.c: Likewise.
	* ecoff.c: Likewise.
	* itbl-ops.c: Likewise.
	* listing.c: Likewise.
	* macro.c: Likewise.
	* po/gas.pot: Likewise.
	* read.c: Likewise.
	* struc-symbol.h: Likewise.
	* symbols.h: Likewise.
	* testsuite/gas/arc/relocs-errors.err: Likewise.
	* write.c: Likewise.
2017-01-23 15:23:07 +00:00
Alan Modra 2571583aed Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
Ambrogino Modigliani 2b0f37619f Fix spelling in comments in C source files (gas)
* as.h: Fix spelling in comments.
	* config/obj-ecoff.c: Fix spelling in comments.
	* config/obj-macho.c: Fix spelling in comments.
	* config/tc-aarch64.c: Fix spelling in comments.
	* config/tc-arc.c: Fix spelling in comments.
	* config/tc-arm.c: Fix spelling in comments.
	* config/tc-avr.c: Fix spelling in comments.
	* config/tc-cr16.c: Fix spelling in comments.
	* config/tc-epiphany.c: Fix spelling in comments.
	* config/tc-frv.c: Fix spelling in comments.
	* config/tc-hppa.c: Fix spelling in comments.
	* config/tc-hppa.h: Fix spelling in comments.
	* config/tc-i370.c: Fix spelling in comments.
	* config/tc-m68hc11.c: Fix spelling in comments.
	* config/tc-m68k.c: Fix spelling in comments.
	* config/tc-mcore.c: Fix spelling in comments.
	* config/tc-mep.c: Fix spelling in comments.
	* config/tc-metag.c: Fix spelling in comments.
	* config/tc-mips.c: Fix spelling in comments.
	* config/tc-mn10200.c: Fix spelling in comments.
	* config/tc-mn10300.c: Fix spelling in comments.
	* config/tc-nds32.c: Fix spelling in comments.
	* config/tc-nios2.c: Fix spelling in comments.
	* config/tc-ns32k.c: Fix spelling in comments.
	* config/tc-pdp11.c: Fix spelling in comments.
	* config/tc-ppc.c: Fix spelling in comments.
	* config/tc-riscv.c: Fix spelling in comments.
	* config/tc-rx.c: Fix spelling in comments.
	* config/tc-score.c: Fix spelling in comments.
	* config/tc-score7.c: Fix spelling in comments.
	* config/tc-sparc.c: Fix spelling in comments.
	* config/tc-tic54x.c: Fix spelling in comments.
	* config/tc-vax.c: Fix spelling in comments.
	* config/tc-xgate.h: Fix spelling in comments.
	* config/tc-xtensa.c: Fix spelling in comments.
	* config/tc-z80.c: Fix spelling in comments.
	* dwarf2dbg.c: Fix spelling in comments.
	* input-file.h: Fix spelling in comments.
	* itbl-ops.c: Fix spelling in comments.
	* read.c: Fix spelling in comments.
	* stabs.c: Fix spelling in comments.
	* symbols.c: Fix spelling in comments.
	* write.c: Fix spelling in comments.
	* testsuite/gas/all/itbl-test.c: Fix spelling in comments.
	* testsuite/gas/tic4x/opclasses.h: Fix spelling in comments.
2016-11-27 15:02:09 +10:30
Alan Modra 1a0670f374 -Wimplicit-fallthrough warning fixes
Comment changes.

bfd/
	* coff-h8300.c: Spell fall through comments consistently.
	* coffgen.c: Likewise.
	* elf32-hppa.c: Likewise.
	* elf32-ppc.c: Likewise.
	* elf32-score.c: Likewise.
	* elf32-score7.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elfxx-aarch64.c: Likewise.
	* elfxx-mips.c: Likewise.
	* cpu-ns32k.c: Add missing fall through comments.
	* elf-m10300.c: Likewise.
	* elf32-arm.c: Likewise.
	* elf32-avr.c: Likewise.
	* elf32-bfin.c: Likewise.
	* elf32-frv.c: Likewise.
	* elf32-i386.c: Likewise.
	* elf32-microblaze.c: Likewise.
	* elf32-nds32.c: Likewise.
	* elf32-ppc.c: Likewise.
	* elf32-rl78.c: Likewise.
	* elf32-rx.c: Likewise.
	* elf32-s390.c: Likewise.
	* elf32-sh.c: Likewise.
	* elf32-tic6x.c: Likewise.
	* elf64-ia64-vms.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elf64-s390.c: Likewise.
	* elf64-x86-64.c: Likewise.
	* elflink.c: Likewise.
	* elfnn-aarch64.c: Likewise.
	* elfnn-ia64.c: Likewise.
	* ieee.c: Likewise.
	* oasys.c: Likewise.
	* pdp11.c: Likewise.
	* srec.c: Likewise.
	* versados.c: Likewise.
opcodes/
	* aarch64-opc.c: Spell fall through comments consistently.
	* i386-dis.c: Likewise.
	* aarch64-dis.c: Add missing fall through comments.
	* aarch64-opc.c: Likewise.
	* arc-dis.c: Likewise.
	* arm-dis.c: Likewise.
	* i386-dis.c: Likewise.
	* m68k-dis.c: Likewise.
	* mep-asm.c: Likewise.
	* ns32k-dis.c: Likewise.
	* sh-dis.c: Likewise.
	* tic4x-dis.c: Likewise.
	* tic6x-dis.c: Likewise.
	* vax-dis.c: Likewise.
binutils/
	* dlltool.c: Spell fall through comments consistently.
	* objcopy.c: Likewise.
	* readelf.c: Likewise.
	* dwarf.c: Add missing fall through comments.
	* elfcomm.c: Likewise.
	* sysinfo.y: Likewise.
	* readelf.c: Likewise.  Also remove extraneous comments.
gas/
	* app.c: Add missing fall through comments.
	* dw2gencfi.c: Likewise.
	* expr.c: Likewise.
	* config/tc-alpha.c: Likewise.
	* config/tc-arc.c: Likewise.
	* config/tc-arm.c: Likewise.
	* config/tc-cr16.c: Likewise.
	* config/tc-crx.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.c: Likewise.
	* config/tc-i960.c: Likewise.
	* config/tc-ia64.c: Likewise.
	* config/tc-m68hc11.c: Likewise.
	* config/tc-m68k.c: Likewise.
	* config/tc-mep.c: Likewise.
	* config/tc-metag.c: Likewise.
	* config/tc-microblaze.c: Likewise.
	* config/tc-mips.c: Likewise.
	* config/tc-ns32k.c: Likewise.
	* config/tc-rx.c: Likewise.
	* config/tc-score.c: Likewise.
	* config/tc-score7.c: Likewise.
	* config/tc-sh.c: Likewise.
	* config/tc-tic4x.c: Likewise.
	* config/tc-vax.c: Likewise.
	* config/tc-xstormy16.c: Likewise.
	* config/tc-z80.c: Likewise.
	* config/tc-z8k.c: Likewise.
	* config/obj-elf.c: Likewise.
	* config/tc-i386.c: Likewise.
	* depend.c: Spell fall through comments consistently.
	* config/tc-arm.c: Likewise.
	* config/tc-d10v.c: Likewise.
	* config/tc-i960.c: Likewise.
	* config/tc-ia64.c: Likewise.
	* config/tc-m68k.c: Likewise.
	* config/tc-mcore.c: Likewise.
	* config/tc-mep.c: Likewise.
	* config/tc-ns32k.c: Likewise.
	* config/tc-visium.c: Likewise.
	* config/tc-xstormy16.c: Likewise.
	* config/tc-z8k.c: Likewise.
gprof/
	* gprof.c: Add missing fall through comments.
ld/
	* lexsup.c: Spell fall through comments consistently and add
	missing fall through comments.
2016-10-06 10:13:15 +10:30
Alan Modra 76e7a75123 Don't include libbfd.h outside of bfd, part 1
Make BFD_ALIGN available to objcopy.  Fix assertions.  Don't use
bfd_log2 in ppc32elf.em or bfd_malloc in xtensaelf.em and bucomm.c.

bfd/
	* libbfd-in.h (BFD_ALIGN): Move to..
	* bfd-in.h: ..here.
	* elf32-ppc.h (struct ppc_elf_params): Add pagesize.
	* elf32-ppc.c (default_params): Adjust init.
	(ppc_elf_link_params): Set pagesize_p2.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.
binutils/
	* ar.c: Don't include libbfd.h.
	* objcopy.c: Likewise.
	* bucomm.c (bfd_get_archive_filename): Use xmalloc rather than
	bfd_malloc.
gas/
	* config/bfin-parse.y: Don't include libbfd.h.
	* config/tc-bfin.c: Likewise.
	* config/tc-rl78.c: Likewise.
	* config/tc-rx.c: Likewise.
	* config/tc-metag.c: Likewise.
	(create_dspreg_htabs, create_scond_htab): Use gas_assert not BFD_ASSERT.
	* Makefile.am: Update dependencies.
	* Makefile.in: Regenerate.
ld/
	* ldlang.c: Don't include libbfd.h.
	* emultempl/nds32elf.em: Likewise.
	* emultempl/ppc64elf.em: Likewise.
	* emultempl/ppc32elf.em: Likewise.
	(pagesize): Delete.
	(params): Update init.
	(ppc_after_open_output): Use params.pagesize.  Don't call bfd_log2.
	(PARSE_AND_LIST_ARGS_CASES): Use params.pagesize.
	* emultempl/sh64elf.em: Don't include libbfd.h.
	(after_allocation): Use ASSERT, not BFD_ASSERT.
	* emultempl/xtensaelf.em: Don't include libbfd.h.
	(replace_insn_sec_with_prop_sec): Use xmalloc, not bfd_malloc.
	* Makefile.am: Update dependencies.
	* Makefile.in: Regenerate.
2016-07-16 13:25:11 +09:30
Trevor Saunders 79052aaec9 rx: make the type of a variable bfd_reloc_code_real_type
gas/ChangeLog:

2016-05-26  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-rx.c (md_convert_frag): Make the type of reloc_type
	bfd_reloc_code_real_type.
2016-05-26 08:45:03 -04:00
Trevor Saunders 42e58860e2 rx: make field type enum
gas/ChangeLog:

2016-05-18  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-rx.c (struct cpu_type): Change the type of a field from
	int to enum rx_cpu_types.
2016-05-18 06:26:27 -04:00
Trevor Saunders add39d2344 use XNEW and related macros more
Its a bit shorter and simpler than raw xmalloc.

gas/ChangeLog:

2016-05-13  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* app.c (app_push): Use XNEW and related macros.
	* as.c (parse_args): Likewise.
	* cgen.c (make_right_shifted_expr): Likewise.
	(gas_cgen_tc_gen_reloc): Likewise.
	* config/bfin-defs.h: Likewise.
	* config/bfin-parse.y: Likewise.
	* config/obj-coff.c (stack_init): Likewise.
	(stack_push): Likewise.
	(coff_obj_symbol_new_hook): Likewise.
	(coff_obj_symbol_clone_hook): Likewise.
	(add_lineno): Likewise.
	(coff_frob_symbol): Likewise.
	* config/obj-elf.c (obj_elf_section_name): Likewise.
	(build_group_lists): Likewise.
	* config/obj-evax.c (evax_symbol_new_hook): Likewise.
	* config/obj-macho.c (obj_mach_o_indirect_symbol): Likewise.
	* config/tc-aarch64.c (insert_reg_alias): Likewise.
	(find_or_make_literal_pool): Likewise.
	(add_to_lit_pool): Likewise.
	(fill_instruction_hash_table): Likewise.
	* config/tc-alpha.c (load_expression): Likewise.
	(emit_jsrjmp): Likewise.
	(s_alpha_ent): Likewise.
	(s_alpha_end): Likewise.
	(s_alpha_linkage): Likewise.
	(md_begin): Likewise.
	(tc_gen_reloc): Likewise.
	* config/tc-arc.c (arc_insert_opcode): Likewise.
	(arc_extcorereg): Likewise.
	* config/tc-bfin.c: Likewise.
	* config/tc-cr16.c: Likewise.
	* config/tc-cris.c: Likewise.
	* config/tc-crx.c (preprocess_reglist): Likewise.
	* config/tc-d10v.c: Likewise.
	* config/tc-frv.c (frv_insert_vliw_insn): Likewise.
	(frv_tomcat_shuffle): Likewise.
	* config/tc-h8300.c: Likewise.
	* config/tc-i370.c (i370_macro): Likewise.
	* config/tc-i386.c (lex_got): Likewise.
	(md_parse_option): Likewise.
	* config/tc-ia64.c (alloc_record): Likewise.
	(set_imask): Likewise.
	(save_prologue_count): Likewise.
	(dot_proc): Likewise.
	(dot_endp): Likewise.
	(ia64_frob_label): Likewise.
	(add_qp_imply): Likewise.
	(add_qp_mutex): Likewise.
	(mark_resource): Likewise.
	(dot_alias): Likewise.
	* config/tc-m68hc11.c: Likewise.
	* config/tc-m68k.c (m68k_frob_label): Likewise.
	(s_save): Likewise.
	(mri_control_label): Likewise.
	(push_mri_control): Likewise.
	(build_mri_control_operand): Likewise.
	(s_mri_else): Likewise.
	(s_mri_break): Likewise.
	(s_mri_next): Likewise.
	(s_mri_for): Likewise.
	(s_mri_endw): Likewise.
	* config/tc-metag.c (create_mnemonic_htab): Likewise.
	* config/tc-microblaze.c: Likewise.
	* config/tc-mmix.c (s_loc): Likewise.
	* config/tc-nds32.c (nds32_relax_hint): Likewise.
	* config/tc-nios2.c (nios2_insn_reloc_new): Likewise.
	* config/tc-rl78.c: Likewise.
	* config/tc-rx.c (rx_include): Likewise.
	* config/tc-sh.c: Likewise.
	* config/tc-sh64.c (shmedia_frob_section_type): Likewise.
	* config/tc-sparc.c: Likewise.
	* config/tc-spu.c: Likewise.
	* config/tc-tic6x.c (static tic6x_unwind_info *tic6x_get_unwind): Likewise.
	(tic6x_start_unwind_section): Likewise.
	* config/tc-tilegx.c: Likewise.
	* config/tc-tilepro.c: Likewise.
	* config/tc-v850.c: Likewise.
	* config/tc-visium.c: Likewise.
	* config/tc-xgate.c: Likewise.
	* config/tc-xtensa.c (xtensa_translate_old_userreg_ops): Likewise.
	(new_resource_table): Likewise.
	(resize_resource_table): Likewise.
	(xtensa_create_trampoline_frag): Likewise.
	(xtensa_maybe_create_literal_pool_frag): Likewise.
	(cache_literal_section): Likewise.
	* config/xtensa-relax.c (append_transition): Likewise.
	(append_condition): Likewise.
	(append_value_condition): Likewise.
	(append_constant_value_condition): Likewise.
	(append_literal_op): Likewise.
	(append_label_op): Likewise.
	(append_constant_op): Likewise.
	(append_field_op): Likewise.
	(append_user_fn_field_op): Likewise.
	(enter_opname_n): Likewise.
	(enter_opname): Likewise.
	(split_string): Likewise.
	(parse_insn_templ): Likewise.
	(clone_req_or_option_list): Likewise.
	(clone_req_option_list): Likewise.
	(parse_option_cond): Likewise.
	(parse_insn_pattern): Likewise.
	(parse_insn_repl): Likewise.
	(build_transition): Likewise.
	(build_transition_table): Likewise.
	* dw2gencfi.c (alloc_fde_entry): Likewise.
	(alloc_cfi_insn_data): Likewise.
	(cfi_add_CFA_remember_state): Likewise.
	(dot_cfi_escape): Likewise.
	(dot_cfi_fde_data): Likewise.
	(select_cie_for_fde): Likewise.
	* dwarf2dbg.c (dwarf2_directive_loc): Likewise.
	* ecoff.c (ecoff_add_bytes): Likewise.
	(ecoff_build_debug): Likewise.
	* input-scrub.c (input_scrub_push): Likewise.
	(input_scrub_begin): Likewise.
	(input_scrub_next_buffer): Likewise.
	* itbl-ops.c (append_insns_as_macros): Likewise.
	(alloc_entry): Likewise.
	(alloc_field): Likewise.
	* listing.c (listing_newline): Likewise.
	(listing_listing): Likewise.
	* macro.c (get_any_string): Likewise.
	(delete_macro): Likewise.
	* stabs.c (generate_asm_file): Likewise.
	(stabs_generate_asm_lineno): Likewise.
	* subsegs.c (subseg_change): Likewise.
	(subseg_get): Likewise.
	* symbols.c (define_dollar_label): Likewise.
	(symbol_relc_make_sym): Likewise.
	* write.c (write_relocs): Likewise.
2016-05-13 00:35:51 -04:00
Trevor Saunders 29a2809e42 use xstrdup, xmemdup0 and concat more
gas/ChangeLog:

2016-05-13  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/obj-coff.c (obj_coff_def): Simplify string copying.
	(weak_name2altname): Likewise.
	(weak_uniquify): Likewise.
	(obj_coff_section): Likewise.
	(obj_coff_init_stab_section): Likewise.
	* config/obj-elf.c (obj_elf_section_name): Likewise.
	(obj_elf_init_stab_section): Likewise.
	* config/obj-evax.c (evax_shorten_name): Likewise.
	* config/obj-macho.c (obj_mach_o_make_or_get_sect): Likewise.
	* config/tc-aarch64.c (create_register_alias): Likewise.
	* config/tc-alpha.c (load_expression): Likewise.
	(s_alpha_file): Likewise.
	(s_alpha_section_name): Likewise.
	(tc_gen_reloc): Likewise.
	* config/tc-arc.c (md_assemble): Likewise.
	* config/tc-arm.c (create_neon_reg_alias): Likewise.
	(start_unwind_section): Likewise.
	* config/tc-hppa.c (pa_build_unwind_subspace): Likewise.
	(hppa_elf_mark_end_of_function): Likewise.
	* config/tc-nios2.c (nios2_modify_arg): Likewise.
	(nios2_negate_arg): Likewise.
	* config/tc-rx.c (rx_section): Likewise.
	* config/tc-sh64.c (sh64_consume_datalabel): Likewise.
	* config/tc-tic30.c (tic30_find_parallel_insn): Likewise.
	* config/tc-tic54x.c (tic54x_include): Likewise.
	(tic54x_macro_info): Likewise.
	(subsym_get_arg): Likewise.
	(subsym_substitute): Likewise.
	(tic54x_start_line_hook): Likewise.
	* config/tc-xtensa.c (xtensa_literal_prefix): Likewise.
	(xg_reverse_shift_count): Likewise.
	* config/xtensa-relax.c (enter_opname_n): Likewise.
	(split_string): Likewise.
	* dwarf2dbg.c (get_filenum): Likewise.
	(process_entries): Likewise.
	* expr.c (operand): Likewise.
	* itbl-ops.c (alloc_entry): Likewise.
	* listing.c (listing_message): Likewise.
	(listing_title): Likewise.
	* macro.c (check_macro): Likewise.
	* stabs.c (s_xstab): Likewise.
	* symbols.c (symbol_relc_make_expr): Likewise.
	* write.c (compress_debug): Likewise.
2016-05-13 00:35:51 -04:00
Trevor Saunders 325801bda4 use XNEW and related macros more
gas/ChangeLog:

2016-04-03  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* app.c (app_push): use XNEW macro.
	* as.c: Likewise.
	* config/obj-elf.c (obj_elf_change_section): Likewise.
	(elf_copy_symbol_attributes): Likewise.
	(obj_elf_size): Likewise.
	(build_group_lists): Likewise.
	* config/tc-aarch64.c (add_operand_error_record): Likewise.
	(md_assemble): Likewise.
	(tc_gen_reloc): Likewise.
	(get_upper_str): Likewise.
	(aarch64_parse_features): Likewise.
	* config/tc-arm.c (insert_reg_alias): Likewise.
	(insert_neon_reg_alias): Likewise.
	(find_or_make_literal_pool): Likewise.
	(s_arm_elf_cons): Likewise.
	(add_unwind_opcode): Likewise.
	(arm_parse_extension): Likewise.
	* config/tc-avr.c (create_record_for_frag): Likewise.
	* config/tc-crx.c: Likewise.
	* config/tc-d30v.c: Likewise.
	* config/tc-dlx.c (s_proc): Likewise.
	* config/tc-ft32.c: Likewise.
	* config/tc-h8300.c: Likewise.
	* config/tc-hppa.c (pa_proc): Likewise.
	(create_new_space): Likewise.
	(create_new_subspace): Likewise.
	* config/tc-i860.c: Likewise.
	* config/tc-i960.c: Likewise.
	* config/tc-ia64.c: Likewise.
	* config/tc-iq2000.c (iq2000_add_macro): Likewise.
	(iq2000_record_hi16): Likewise.
	* config/tc-m32c.c (m32c_indirect_operand): Likewise.
	* config/tc-m32r.c (debug_sym): Likewise.
	(m32r_record_hi16): Likewise.
	* config/tc-m68k.c (m68k_ip): Likewise.
	(md_begin): Likewise.
	* config/tc-mcore.c: Likewise.
	* config/tc-microblaze.c (check_got): Likewise.
	* config/tc-mips.c (append_insn): Likewise.
	(s_mipsset): Likewise.
	(mips_record_label): Likewise.
	(s_mips_end): Likewise.
	* config/tc-mmix.c (mmix_frob_file): Likewise.
	* config/tc-mn10200.c: Likewise.
	* config/tc-mn10300.c: Likewise.
	* config/tc-moxie.c: Likewise.
	* config/tc-msp430.c: Likewise.
	* config/tc-nds32.c (nds32_elf_save_pseudo_pattern): Likewise.
	* config/tc-ns32k.c: Likewise.
	* config/tc-or1k.c: Likewise.
	* config/tc-pdp11.c: Likewise.
	* config/tc-pj.c (fake_opcode): Likewise.
	* config/tc-ppc.c (ppc_apuinfo_section_add): Likewise.
	(ppc_macro): Likewise.
	(ppc_dwsect): Likewise.
	(ppc_machine): Likewise.
	* config/tc-rl78.c (rl78_frag_init): Likewise.
	* config/tc-rx.c (rx_frag_init): Likewise.
	* config/tc-s390.c (s390_lit_suffix): Likewise.
	(s390_machine): Likewise.
	(s390_machinemode): Likewise.
	* config/tc-score.c (s3_insert_reg): Likewise.
	(s3_gen_reloc): Likewise.
	* config/tc-score7.c (s7_insert_reg): Likewise.
	(s7_gen_reloc): Likewise.
	* config/tc-tic30.c (tic30_operand): Likewise.
	* config/tc-tic4x.c (tic4x_inst_make): Likewise.
	* config/tc-tic54x.c (stag_add_field): Likewise.
	(tic54x_struct): Likewise.
	(tic54x_space): Likewise.
	(tic54x_field): Likewise.
	(tic54x_mlib): Likewise.
	(subsym_substitute): Likewise.
	* config/tc-tic6x.c (tic6x_frob_label): Likewise.
	* config/tc-vax.c: Likewise.
	* config/tc-xc16x.c: Likewise.
	* config/tc-xtensa.c (xtensa_add_insn_label): Likewise.
	(directive_push): Likewise.
	(xtensa_begin_directive): Likewise.
	(tokenize_arguments): Likewise.
	(xtensa_add_literal_sym): Likewise.
	(new_resource_table): Likewise.
	(resize_resource_table): Likewise.
	(emit_single_op): Likewise.
	(xtensa_create_trampoline_frag): Likewise.
	(xtensa_maybe_create_literal_pool_frag): Likewise.
	(xtensa_add_config_info): Likewise.
	(xtensa_realloc_fixup_cache): Likewise.
	(add_subseg_info): Likewise.
	(cache_literal_section): Likewise.
	(add_xt_block_frags): Likewise.
	(add_xt_prop_frags): Likewise.
	(init_op_placement_info_table): Likewise.
	(build_section_rename): Likewise.
	* config/tc-z80.c: Likewise.
	* config/tc-z8k.c: Likewise.
	* depend.c (register_dependency): Likewise.
	* dwarf2dbg.c (get_line_subseg): Likewise.
	(dwarf2_gen_line_info_1): Likewise.
	(get_filenum): Likewise.
	* ecoff.c (allocate_scope): Likewise.
	(allocate_vlinks): Likewise.
	(allocate_shash): Likewise.
	(allocate_thash): Likewise.
	(allocate_tag): Likewise.
	(allocate_forward): Likewise.
	(allocate_thead): Likewise.
	(allocate_lineno_list): Likewise.
	* expr.c (make_expr_symbol): Likewise.
	* hash.c (hash_new_sized): Likewise.
	* input-file.c (input_file_push): Likewise.
	* listing.c (file_info): Likewise.
	(listing_newline): Likewise.
	* macro.c (new_formal): Likewise.
	(define_macro): Likewise.
	* remap.c (add_debug_prefix_map): Likewise.
	* symbols.c (symbol_find_noref): Likewise.
	(define_dollar_label): Likewise.
	(fb_label_instance_inc): Likewise.
	(symbol_relc_make_value): Likewise.
2016-04-03 20:43:23 -04:00
Alan Modra 6d4af3c269 Constify more
* cgen.c (weak_operand_overflow_check): Return const char*.
	* messages.c (as_internal_value_out_of_range): Formatting.
	(as_warn_value_out_of_range): Consify prefix param.
	(as_bad_value_out_of_range): Likewise.
	* read.c (s_errwarn): Constify msg..
	(s_float_space, float_cons): ..and err.
	* as.h (as_warn_value_out_of_range, as_bad_value_out_of_range,
	ieee_md_atof, vax_md_atof): Update prototypes.
	* tc.h (md_atof): Update prototype.
	* config/atof-ieee.c (ieee_md_atof): Return const char*.
	* config/atof-vax.c (vax_md_atof): Likewise.
	* config/obj-elf.c (obj_elf_parse_section_letters): Constify bad_msg.
	* config/tc-aarch64.c (md_atof): Return const char*.
	* config/tc-alpha.c (s_alpha_section_name): Likewise.
	(s_alpha_comm): Constify sec_name.
	(section_name): Constify.
	(s_alpha_section): Consify name..
	(alpha_elf_section_letter): ..and ptr_msg param..
	(md_atof): ..and return.
	* config/tc-alpha.h (alpha_elf_section_letter): Update prototype.
	* config/tc-arc.c (md_atof): Return const char*.
	* config/tc-arm.c (md_atof): Likewise.
	* config/tc-avr.c (md_atof): Likewise.
	* config/tc-bfin.c (md_atof): Likewise.
	* config/tc-cr16.c (md_atof): Likewise.
	* config/tc-cris.c (md_atof): Likewise.
	* config/tc-crx.c (md_atof): Likewise.
	* config/tc-d10v.c (md_atof): Likewise.
	* config/tc-d30v.c (md_atof): Likewise.
	* config/tc-dlx.c (md_atof): Likewise.
	* config/tc-epiphany.c (md_atof): Likewise.
	* config/tc-fr30.c (md_atof): Likewise.
	* config/tc-frv.c (md_atof): Likewise.
	* config/tc-ft32.c (md_atof): Likewise.
	* config/tc-h8300.c (md_atof): Likewise.
	* config/tc-hppa.c (struct default_subspace_dict): Constify name.
	(struct default_space_dict): Likewise.
	(create_new_space): Constify name param.
	(create_new_subspace): Likewise.
	(is_defined_space, is_defined_subspace): Likewise.
	(pa_parse_space_stmt): Constify space_name param.
	(md_atof): Return const char*.
	(pa_spaces_begin): Constify name.
	* config/tc-i370.c (md_atof): Return const char*.
	* config/tc-i386.c (md_atof): Likewise.
	(x86_64_section_letter): Constify ptr_msg param.
	* config/tc-i386.h (x86_64_section_letter): Update prototype.
	* config/tc-i860.c (struct i860_it): Constify error.
	(md_atof): Return const char*.
	* config/tc-i960.c (md_atof): Likewise.
	* config/tc-ia64.c (md_atof): Likewise.
	(ia64_elf_section_letter): Constify ptr_msg param.
	* config/tc-ia64.h (ia64_elf_section_letter): Update prototype.
	* config/tc-ip2k.c (md_atof): Return const char*.
	* config/tc-iq2000.c (md_atof): Likewise.
	* config/tc-lm32.c (md_atof): Likewise.
	* config/tc-m32c.c (md_atof): Likewise.
	* config/tc-m32r.c (md_atof): Likewise.
	* config/tc-m68hc11.c (md_atof): Likewise.
	* config/tc-m68k.c (md_atof): Likewise.
	* config/tc-mcore.c (md_atof): Likewise.
	* config/tc-mep.c (md_atof): Likewise.
	(mep_elf_section_letter): Constify ptr_msg param.
	* config/tc-mep.h (mep_elf_section_letter): Update prototype.
	* config/tc-metag.c (md_atof): Return const char*.
	* config/tc-microblaze.c (md_atof): Likewise.
	* config/tc-microblaze.h (md_atof): Delete prototype.
	* config/tc-mips.c (mips_parse_argument_token): Constify err.
	(md_atof): Return const char*.
	* config/tc-mmix.c (md_atof): Likewise.
	* config/tc-mn10200.c (md_atof): Likewise.
	* config/tc-mn10300.c (md_atof): Likewise.
	* config/tc-moxie.c (md_atof): Likewise.
	* config/tc-msp430.c (md_atof): Likewise.
	* config/tc-mt.c (md_atof): Likewise.
	* config/tc-nds32.c (md_atof): Likewise.
	* config/tc-nios2.c (md_atof): Likewise.
	(nios2_elf_section_letter): Constify ptr_msg param.
	* config/tc-nios2.h (nios2_elf_section_letter): Update prototype.
	* config/tc-ns32k.c (md_atof): Return const char*.
	* config/tc-or1k.c (md_atof): Likewise.
	* config/tc-pdp11.c (struct pdp11_code): Constify error.
	(md_atof): Return const char*.
	* config/tc-pj.c (md_atof): Likewise.
	* config/tc-ppc.c (md_atof): Likewise.
	* config/tc-rl78.c (md_atof): Likewise.
	* config/tc-rx.c (md_atof): Likewise.
	* config/tc-s390.c (md_atof): Likewise.
	* config/tc-score.c (s3_atof, md_atof): Likewise.
	* config/tc-sh.c (md_atof): Likewise.
	* config/tc-sparc.c (struct sparc_it): Constify error.
	(md_atof): Return const char*.
	* config/tc-spu.c (md_atof): Likewise.
	* config/tc-tic30.c (md_atof): Likewise.
	* config/tc-tic4x.c (md_atof): Likewise.
	* config/tc-tic54x.c (md_atof): Likewise.
	* config/tc-tic6x.c (md_atof): Likewise.
	* config/tc-tilegx.c (md_atof): Likewise.
	* config/tc-tilepro.c (md_atof): Likewise.
	* config/tc-v850.c (parse_register_list, md_atof): Likewise.
	* config/tc-vax.c (md_atof): Likewise.
	* config/tc-visium.c (md_atof): Likewise.
	* config/tc-xc16x.c (md_atof): Likewise.
	* config/tc-xgate.c (md_atof): Likewise.
	* config/tc-xstormy16.c (md_atof): Likewise.
	* config/tc-xtensa.c (md_atof): Likewise.
	* config/tc-z80.c (md_atof): Likewise.
	* config/tc-z8k.c (md_atof): Likewise.
2016-04-01 23:10:50 +10:30
Trevor Saunders 17b9d67d4e make md_parse_option () take a const char *
This is mostly just adding const in many places, however there are a couple
interesting things.  We need to add casts in tc-s390.c and tc-cris.c because
they have functions that assign to input_line_pointer an argument that
sometimes comes from md_parse_option.  Presumably this is safe because those
targets never pass literals to md_parse_option (), but this code should
probably be improved in the future.  Also xtensa passes the argument to strtoll
which is a rather odd function, it takes a const char * as argument and returns
a pointer into that string as a char * through an out argument, but we can work
around that by adding more variables.

gas/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-aarch64.c (struct aarch64_long_option_table): Ad const
	qualifier.
	* config/tc-alpha.c (md_parse_option): Likewise.
	* config/tc-arc.c (md_parse_option): Likewise.
	* config/tc-arm.c (struct arm_long_option_table): Likewise.
	(md_parse_option): Likewise.
	* config/tc-avr.c (md_parse_option): Likewise.
	* config/tc-bfin.c (md_parse_option): Likewise.
	* config/tc-cr16.c (md_parse_option): Likewise.
	* config/tc-cris.c (s_cris_arch): Likewise.
	(md_parse_option): Likewise.
	* config/tc-crx.c (md_parse_option): Likewise.
	* config/tc-d10v.c (md_parse_option): Likewise.
	* config/tc-d30v.c (md_parse_option): Likewise.
	* config/tc-dlx.c (md_parse_option): Likewise.
	* config/tc-epiphany.c (md_parse_option): Likewise.
	* config/tc-fr30.c (md_parse_option): Likewise.
	* config/tc-frv.c (md_parse_option): Likewise.
	* config/tc-ft32.c (md_parse_option): Likewise.
	* config/tc-h8300.c (md_parse_option): Likewise.
	* config/tc-hppa.c (md_parse_option): Likewise.
	* config/tc-i370.c (md_parse_option): Likewise.
	* config/tc-i386.c (md_parse_option): Likewise.
	* config/tc-i860.c (md_parse_option): Likewise.
	* config/tc-i960.c (md_parse_option): Likewise.
	* config/tc-ia64.c (md_parse_option): Likewise.
	* config/tc-ip2k.c (md_parse_option): Likewise.
	* config/tc-iq2000.c (md_parse_option): Likewise.
	* config/tc-lm32.c (md_parse_option): Likewise.
	* config/tc-m32c.c (md_parse_option): Likewise.
	* config/tc-m32r.c (md_parse_option): Likewise.
	* config/tc-m68hc11.c (md_parse_option): Likewise.
	* config/tc-m68k.c (md_parse_option): Likewise.
	* config/tc-mcore.c (md_parse_option): Likewise.
	* config/tc-mep.c (md_parse_option): Likewise.
	* config/tc-metag.c (struct metag_long_option): Likewise.
	(md_parse_option): Likewise.
	* config/tc-microblaze.c (md_parse_option): Likewise.
	* config/tc-microblaze.h (md_parse_option): Remove prototype.
	* config/tc-mips.c (md_parse_option): Adjust.
	* config/tc-mmix.c (md_parse_option): Likewise.
	* config/tc-mn10200.c (md_parse_option): Likewise.
	* config/tc-mn10300.c (md_parse_option): Likewise.
	* config/tc-moxie.c (md_parse_option): Likewise.
	* config/tc-msp430.c (md_parse_option): Likewise.
	* config/tc-mt.c (md_parse_option): Likewise.
		* config/tc-nds32.c (md_parse_option): Likewise.
		* config/tc-nds32.h (nds32_parse_option): Likewise.
	* config/tc-nios2.c (md_parse_option): Likewise.
	* config/tc-ns32k.c (md_parse_option): Likewise.
	* config/tc-or1k.c (md_parse_option): Likewise.
	* config/tc-pdp11.c (md_parse_option): Likewise.
	* config/tc-pj.c (md_parse_option): Likewise.
	* config/tc-ppc.c (md_parse_option): Likewise.
	* config/tc-rl78.c (md_parse_option): Likewise.
	* config/tc-rx.c (md_parse_option): Likewise.
	* config/tc-s390.c (s390_parse_cpu): Likewise.
	* config/tc-score.c (md_parse_option): Likewise.
	* config/tc-sh.c (md_parse_option): Likewise.
	* config/tc-sparc.c (md_parse_option): Likewise.
	* config/tc-spu.c (md_parse_option): Likewise.
	* config/tc-tic30.c (md_parse_option): Likewise.
	* config/tc-tic4x.c (md_parse_option): Likewise.
	* config/tc-tic54x.c (md_parse_option): Likewise.
	* config/tc-tic6x.c (md_parse_option): Likewise.
	* config/tc-tilegx.c (md_parse_option): Likewise.
	* config/tc-tilepro.c (md_parse_option): Likewise.
	* config/tc-v850.c (md_parse_option): Likewise.
	* config/tc-vax.c (md_parse_option): Likewise.
	* config/tc-visium.c (struct visium_long_option_table): Likewise.
	* config/tc-xc16x.c (md_parse_option): Likewise.
	* config/tc-xgate.c (md_parse_option): Likewise.
	* config/tc-xstormy16.c (md_parse_option): Likewise.
	* config/tc-xtensa.c (md_parse_option): Likewise.
	* config/tc-z80.c (md_parse_option): Likewise.
	* config/tc-z8k.c (md_parse_option): Likewise.
	* tc.h (md_parse_option): Likewise.
2016-03-29 07:43:25 -04:00
Trevor Saunders e0471c16c5 Convert more variables to a constant form.
* as.c (select_emulation_mode): Add const qualifiers.
	* as.h: Likewise.
	* config/bfin-defs.h: Likewise.
	* config/bfin-parse.y: Likewise.
	* config/rx-parse.y: Likewise.
	* config/tc-aarch64.c (struct aarch64_option_table): Likewise.
	(struct aarch64_cpu_option_table): Likewise.
	(struct aarch64_arch_option_table): Likewise.
	(struct aarch64_option_cpu_value_table): Likewise.
	(struct aarch64_long_option_table): Likewise.
	(struct aarch64_option_abi_value_table): Likewise.
	* config/tc-arm.c (struct reloc_entry): Likewise.
	(tc_gen_reloc): Likewise.
	(struct arm_option_table): Likewise.
	(struct arm_legacy_option_table): Likewise.
	(struct arm_cpu_option_table): Likewise.
	(struct arm_arch_option_table): Likewise.
	(struct arm_option_extension_value_table): Likewise.
	(struct arm_option_fpu_value_table): Likewise.
	(struct arm_option_value_table): Likewise.
	(struct arm_long_option_table): Likewise.
	* config/tc-avr.c (struct avr_opcodes_s): Likewise.
	(struct mcu_type_s): Likewise.
	(struct exp_mod_s): Likewise.
	(avr_operand): Likewise.
	(avr_operands): Likewise.
	* config/tc-d10v.c (md_begin): Likewise.
	* config/tc-dlx.c: Likewise.
	* config/tc-fr30.c (fr30_is_colon_insn): Likewise.
	* config/tc-ft32.c (parse_condition): Likewise.
	* config/tc-h8300.c (do_a_fix_imm): Likewise.
	* config/tc-hppa.c (pa_ip): Likewise.
	(hppa_regname_to_dw2regnum): Likewise.
	* config/tc-i370.c (i370_elf_suffix): Likewise.
	* config/tc-i960.c (struct tabentry): Likewise.
	* config/tc-m32r.c: Likewise.
	* config/tc-m68k.c: Likewise.
	* config/tc-m68k.h: Likewise.
	* config/tc-mcore.c (parse_psrmod): Likewise.
	* config/tc-metag.c (struct metag_core_option): Likewise.
	(struct metag_long_option): Likewise.
	* config/tc-microblaze.c: Likewise.
	* config/tc-mips.c (macro): Likewise.
	* config/tc-mn10200.c: Likewise.
	* config/tc-mn10300.c: Likewise.
	* config/tc-msp430.c (struct rcodes_s): Likewise.
	(struct hcodes_s): Likewise.
	(md_parse_option): Likewise.
	* config/tc-ns32k.c (struct ns32k_option): Likewise.
	(optlist): Likewise.
	* config/tc-ppc.c (ppc_elf_suffix): Likewise.
	(tc_ppc_regname_to_dw2regnum): Likewise.
	* config/tc-ppc.h: Likewise.
	* config/tc-rl78.c: Likewise.
	* config/tc-rx.c (struct cpu_type): Likewise.
	* config/tc-sh.c (sh_regname_to_dw2regnum): Likewise.
	* config/tc-sparc.c (struct priv_reg_entry): Likewise.
	(sparc_ip): Likewise.
	* config/tc-spu.c (insn_fmt_string): Likewise.
	* config/tc-tic54x.c (tic54x_set_default_include): Likewise.
	* config/tc-v850.c: Likewise.
	* config/tc-visium.c (struct visium_arch_option_table): Likewise.
	(struct visium_long_option_table): Likewise.
	* config/tc-xgate.c: Likewise.
	* config/tc-z8k.c: Likewise.
	* read.c (add_include_dir): Likewise.
	* read.h: Likewise.
2016-02-25 16:55:21 +00:00
Trevor Saunders 3b4dbbbf59 Add more const type qualifiers to GAS sources.
* output-file.c (output_file_create): Make file name argument const.
	(output_file_close): Likewise.
	* output-file.h (output_file_create): Adjust.
	(output_file_close): Likewise.
	* depend.c (quote_string_for_make): Make src argument const char *.
	(register_dependency): Likewise.
	(wrap_output): Likewise.
	* as.h (register_dependency): Adjust.
	* config/tc-xtensa.c (finish_vinsn): Remove unnecessary calls to
	as_where ();
	* symbols.c (S_SET_EXTERNAL): Likewise.
	* input-scrub.c (as_where): Return the file name.
	* as.h (as_where): Adjust prototype.
	* app.c (do_scrub_chars): Adjust.
	* cond.c (s_elseif): Likewise.
	(s_else): Likewise.
	(initialize_cframe): Likewise.
	* config/obj-coff.c (obj_coff_init_stab_section): Likewise.
	* config/obj-elf.c (obj_elf_init_stab_section): Likewise.
	* config/obj-som.c (obj_som_init_stab_section): Likewise.
	* config/tc-aarch64.c (output_info): Likewise.
	* config/tc-ia64.c (md_assemble): Likewise.
	(dot_alias): Likewise.
	* config/tc-m68k.c (m68k_frob_label): Likewise.
	* config/tc-mmix.c (s_bspec): Likewise.
	(mmix_handle_mmixal): Likewise.
	* config/tc-rx.c (rx_include): Likewise.
	* config/tc-tic54x.c (tic54x_set_default_include): Likewise.
	(tic54x_adjust_symtab): Likewise.
	* config/tc-xtensa.c (directive_push): Likewise.
	(xtensa_sanity_check): Likewise.
	(xtensa_relax_frag): Likewise.
	(md_convert_frag): Likewise.
	(tinsn_to_slotbuf): Likewise.
	* dwarf2dbg.c (dwarf2_where): Likewise.
	* ecoff.c (add_file): Likewise.
	(ecoff_generate_asm_lineno): Likewise.
	* expr.c (make_expr_symbol): Likewise.
	* frags.c (frag_new): Likewise.
	(frag_var_init): Likewise.
	* listing.c (listing_newline): Likewise.
	* messages.c (identify): Likewise.
	(as_show_where): Likewise.
	(as_warn_internal): Likewise.
	(as_bad_internal): Likewise.
	* read.c (s_irp): Likewise.
	(s_macro): Likewise.
	(s_reloc): Likewise.
	* stabs.c (stabs_generate_asm_file): Likewise.
	(stabs_generate_asm_lineno): Likewise.
	(stabs_generate_asm_func): Likewise.
	* write.c (fix_new_internal): Likewise.
	* as.h (PRINTF_WHERE_LIKE): Make file name argument const.
	(as_warn_value_out_of_range): Adjust prototype.
	(as_bad_value_out_of_range): Adjust prototype.
	* messages.c (identify): Make file name argument const char *.
	(as_warn_internal): Likewise.
	(as_warn_where): Likewise.
	(as_bad_internal): Likewise.
	(as_bad_where): Likewise.
	(as_internal_value_out_of_range): Likewise.
	(as_warn_value_out_of_range): Likewise.
	(as_bad_value_out_of_range): Likewise.
	* as.h (found_comment_file): Change type to const char *.
	* cond.c (file_line::file): Likewise.
	* config/obj-coff.c (obj_coff_init_stab_section): Make variable const.
	* config/obj-elf.c (obj_elf_init_stab_section): Likewise.
	* config/obj-som.c (obj_som_init_stab_section): Likewise.
	* config/tc-aarch64.c (output_info): Likewise.
	* config/tc-alpha.c (insert_operand): Likewise.
	* config/tc-arc.c (insert_operand): Likewise.
	* config/tc-d30v.c (check_size): Likewise.
	* config/tc-ia64.c (struct alias): Likewise.
	* config/tc-m68k.c (struct label_line): Likewise.
	* config/tc-mcore.c (md_apply_fix): Likewise.
	* config/tc-microblaze.c (md_estimate_size_before_relax): Likewise.
	* config/tc-mips.c (mips16_immed): Likewise.
	* config/tc-mmix.c (mmix_handle_mmixal): Likewise.
	* config/tc-ppc.c (ppc_insert_operand): Likewise.
	* config/tc-rx.c (rx_include): Likewise.
	* config/tc-s390.c (s390_insert_operand): Likewise.
	* config/tc-tic54x.c (tic54x_set_default_include): Likewise.
	(tic54x_adjust_symtab): Likewise.
	* config/tc-tilegx.c (insert_operand): Likewise.
	(apply_special_operator): Likewise.
	* config/tc-tilepro.c (insert_operand): Likewise.
	* config/tc-xtensa.c (directive_push): Likewise.
	* ecoff.c (add_file): Likewise.
	(ecoff_generate_asm_lineno): Likewise.
	* listing.c (listing_newline): Likewise.
	* read.c (s_irp): Likewise.
	* write.c (install_reloc): Likewise.
	* write.h (struct fix): Likewise.
	* input-file.c (file_name): Change type to const char *.
	(saved_file::file_name): Likewise.
	(input_file_open): Change type of argument to const char *.
	* input-file.h (input_file_open): Adjust.
	* input-scrub.c (logical_input_file): change type to const char *.
	(physical_input_file): Likewise.
       	(struct input_save): Adjust.
	(input_scrub_push): Adjust.
	(input_scrub_begin): Adjust.
	(as_where): Adjust.
	* input-scrub.c (input_scrub_new_file): Make file name argument const.
	(input_scrub_include_file): Likewise.
	(new_logical_line_flags): Likewise.
	(new_logical_line): Likewise.
	* as.h: Adjust.
	* frags.h (struct frag): Change type of fr_file to const char *.
	* expr.c (expr_symbol_where): Change type of file argument to
	const char **.
	* expr.h (expr_symbol_where): Likewise.
	* config/tc-i370.c (md_apply_fix): adjust.
	* config/tc-mmix.c (mmix_md_end): Likewise.
	* config/tc-ppc.c (md_apply_fix): Likewise.
	* config/tc-s390.c (md_apply_fix): Likewise.
	* symbols.c (report_op_error): Likewise.
	(resolve_symbol_value): Likewise.
	* config/tc-ia64.c (slot::src_file): Change type to const char *.
	(rsrc::file): Likewise.
	* config/tc-xtensa.c (xtensa_sanity_check): Change type of variable to
	const char *.
	(xtensa_relax_frag): Likewise.
	(md_convert_frag): Likewise.
	(tinsn_to_slotbuf): Likewise.
	* expr.c (expr_symbol_line): Likewise.
	* macro.c (define_macro): Likewise.
	* macro.h (macro_struct): Likewise.
	* messages.c (as_show_where): Likewise.
	* read.c (s_macro): Likewise.
	* stabs.c (stabs_generate_asm_file): Likewise.
	(generate_asm_file): Likewise.
	(stabs_generate_asm_lineno): Likewise.
	* write.h (struct reloc_list): Likewise.
	* input-scrub.c (as_where): Change return type to const char *.
	* as.h (as_wheree): Adjust.
2016-02-22 14:11:27 +00:00
Alan Modra 6f2750feaf Copyright update for binutils 2016-01-01 23:00:01 +10:30
Yoshinori Sato a117b0a51c Add support for RX V2 Instruction Set
binutils
	* readelf.c(get_machine_flags): Add v2 flag.

gas
	* config/rx-defs.h(rx_cpu_type): Add RXV2 type.
	* config/tc-rx.c(cpu_type_list): New type lookup table.
	(md_parse_option): Use lookup table for choose cpu.
	(md_show_usage): Add rxv2 for mcpu option.
	* doc/c-rx.texi: Likewise.
	* config/rx-parse.y: Add v2 instructions and ACC register.
	(rx_check_v2): check v2 type.

include/elf
	* rx.h(E_FLAG_RX_V2): New RXv2 type.

include/opcode
	* rx.h: Add new instructions.

opcoes
	* rx-deocde.opc(rx_decode_opcode): Add new instructions pattern.
	* rx-dis.c(register_name): Add new register.

gas/testsuite
	* gas/rx/emaca.d: New.
	* gas/rx/emaca.sm: New.
	* gas/rx/emsba.d: New.
	* gas/rx/emsba.sm: New.
	* gas/rx/emula.d: New.
	* gas/rx/emula.sm: New.
	* gas/rx/fadd.d: Add new pattern.
	* gas/rx/fadd.sm: Add new pattern.
	* gas/rx/fmul.d: Add new pattern.
	* gas/rx/fmul.sm: Add new pattern.
	* gas/rx/fsqrt.d: New.
	* gas/rx/fsqrt.sm: New.
	* gas/rx/fsub.d: Add new pattern.
 	* gas/rx/fsub.sm: Add new pattern.
	* gas/rx/ftou.d: New.
	* gas/rx/ftou.sm: New.
	* gas/rx/maclh.d: New.
	* gas/rx/maclh.sm: New.
	* gas/rx/maclo.d: Add new pattern.
	* gas/rx/maclo.sm: Add new pattern.
	* gas/rx/macros.inc: Add new register.
	* gas/rx/movco.d: New.
	* gas/rx/movco.sm: New.
	* gas/rx/movli.d: New.
	* gas/rx/movli.sm: New.
	* gas/rx/msbhi.d: New.
	* gas/rx/msbhi.sm: New.
	* gas/rx/msblh.d: New.
	* gas/rx/msblh.sm: New.
	* gas/rx/msblo.d: New.
	* gas/rx/msblo.sm: New.
	* gas/rx/mullh.d: New.
	* gas/rx/mullh.sm: New.
	* gas/rx/mvfacgu.d: New.
	* gas/rx/mvfacgu.sm: New.
	* gas/rx/mvfachi.d: Add new pattern.
	* gas/rx/mvfachi.sm: Add new pattern.
	* gas/rx/mvfaclo.d: Add new pattern.
	* gas/rx/mvfaclo.sm: Add new pattern.
	* gas/rx/mvfacmi.d: Add new pattern.
	* gas/rx/mvfacmi.sm: Add new pattern.
	* gas/rx/mvfc.d: Add new pattern.
	* gas/rx/mvtacgu.d: New.
	* gas/rx/mvtacgu.sm: New.
	* gas/rx/mvtc.d: Add new pattern.
	* gas/rx/popc.d: Add new pattern.
	* gas/rx/pushc.d: Add new pattern.
	* gas/rx/racl.d: New.
	* gas/rx/racl.sm: New.
	* gas/rx/racw.d: Add new pattern.
	* gas/rx/racw.sm: Add new pattern.
	* gas/rx/rdacl.d: New.
	* gas/rx/rdacl.sm: New.
	* gas/rx/rdacw.d: New.
	* gas/rx/rdacw.sm: New.
	* gas/rx/rx.exp: Add option.
	* gas/rx/stnz.d: Add new pattern.
	* gas/rx/stnz.sm: Add new pattern.
	* gas/rx/stz.d: Add new pattern.
	* gas/rx/stz.sm: Add new pattern.
	* gas/rx/utof.d: New.
	* gas/rx/utof.sm: New.
2015-12-15 09:26:56 +00:00
Nick Clifton c192dad243 Fix compile time warning building RX target. 2015-12-09 12:01:19 +00:00
Dominik Vogt 8d3842cd15 gas: Fix left shift of negative value.
This patch fixes all occurences of left-shifting negative constants in C cod
which is undefined by the C standard.

gas/ChangeLog:

        * read.c (parse_bitfield_cons): Fix left shift of negative value.
        * config/tc-xstormy16.c (md_section_align): Likewise.
        * config/tc-xgate.c (md_section_align): Likewise.
        * config/tc-visium.c (md_section_align): Likewise.
        * config/tc-v850.c (md_section_align): Likewise.
        * config/tc-tic6x.c (md_section_align): Likewise.
        * config/tc-sh.c (SH64PCREL32_M, SH64PCREL48_M, SH64PCREL32_M)
        (MOVI_32_M, MOVI_48_M, MOVI_32_M, md_section_align): Likewise.
        * config/tc-sh64.c (shmedia_md_estimate_size_before_relax): Likewise.
        * config/tc-score.c (s3_section_align): Likewise.
        * config/tc-score7.c (s7_section_align): Likewise.
        * config/tc-s390.c (md_section_align): Likewise.
        * config/tc-rx.c (md_section_align): Likewise.
        * config/tc-rl78.c (md_section_align): Likewise.
        * config/tc-ppc.c (md_section_align): Likewise.
        * config/tc-or1k.c (md_section_align): Likewise.
        * config/tc-nds32.c (md_section_align): Likewise.
        * config/tc-mt.c (md_section_align): Likewise.
        * config/tc-msp430.c (md_section_align): Likewise.
        * config/tc-mn10300.c (md_section_align): Likewise.
        * config/tc-mn10200.c (md_section_align): Likewise.
        * config/tc-mips.c (md_section_align): Likewise.
        * config/tc-microblaze.c (parse_imm): Likewise.
        * config/tc-mep.c (md_section_align): Likewise.
        * config/tc-m68k.c (md_section_align): Likewise.
        * config/tc-m68hc11.c (md_section_align): Likewise.
        * config/tc-m32r.c (md_section_align): Likewise.
        * config/tc-m32c.c (md_section_align): Likewise.
        * config/tc-lm32.c (md_section_align): Likewise.
        * config/tc-iq2000.c (md_section_align): Likewise.
        * config/tc-ip2k.c (md_section_align): Likewise.
        * config/tc-ia64.c (dot_save, dot_vframe): Likewise.
        * config/tc-i960.c (md_number_to_field, md_section_align): Likewise.
        * config/tc-i386.c (md_section_align): Likewise.
        * config/tc-i370.c (md_section_align): Likewise.
        * config/tc-frv.c (md_section_align): Likewise.
        * config/tc-fr30.c (md_section_align): Likewise.
        * config/tc-epiphany.c (md_section_align): Likewise.
        * config/tc-d30v.c (md_section_align): Likewise.
        * config/tc-d10v.c (md_section_align): Likewise.
        * config/tc-cr16.c (l_cons): Likewise.
        * config/tc-bfin.c (md_section_align): Likewise.
        * config/tc-arm.c (md_section_align): Likewise.
        * config/tc-arc.c (md_section_align): Likewise.
        * config/bfin-parse.y (expr_1): Likewise.

gas/testsuite/ChangeLog:

        * gas/all/test-gen.c (random_order_16s, random_order_24s)
        (random_order_32s): Fix left shift of negative value.
2015-11-09 17:12:57 +01:00
Nick Clifton a62e598977 Fix the RX assembler's section alignment parameter to use multiples of N rather than powers of N
* config/tc-rx.c (parse_rx_section): Align parameter provides a
	multiple of n argument, not a power of n argument.
2015-11-02 13:46:13 +00:00
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
H.J. Lu 3739860c11 Remove trailing spaces in gas 2015-08-12 04:40:42 -07: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 3525236c57 Add support to the RX toolchain to restrict the use of string instructions.
bfd	* elf32-rx.c (describe_flags): Report the settings of the string
	insn using bits.
	(rx_elf_merge_private_bfd_data): Handle merging of the string insn
	using bits.

bin	* readelf.c (get_machine_flags): Report the setting of the string
	insn using bits.

gas	* config/tc-rx.c (enum options): Add OPTION_DISALLOW_STRING_INSNS.
	(md_longopts): Add -mno-allow-string-insns.
	(md_parse_option): Handle -mno-allow-string-insns.
	(md_show_usage): Mention -mno-allow-string-insns.
	(rx_note_string_insn_use): New function.  Produces an error
	message if a string insn is used when it is not allowed.
	* config/rx-parse.y (SCMPU): Call rx_note_string_insn_use.
	(SMOVU, SMOVB, SMOVF, SUNTIL, SWHILE, RMPA): Likewise.
	* config/rx-defs.h (rx_note_string_insn_use): Prototype.
	* doc/c-rx.texi: Document -mno-allow-string-insns.

elf	* rx.h (E_FLAG_RX_SINSNS_SET): New bit in e_flags field.
	(E_FLAG_RX_SINSNS_YES): Likewise.
	(E_FLAG_RX_SINSNS_MASK): New define.
2015-04-09 12:48:37 +01:00
Alan Modra b90efa5b79 ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
Alan Modra e57e6ddc2e Prepare gas for 64-bit obstacks
Use size_t in a few places involved with obstacks, and don't include
obstack.h in files that don't use obstacks.

gas/
	* config/bfin-parse.y: Don't include obstack.h.
	* config/obj-aout.c: Likewise.
	* config/obj-coff.c: Likewise.
	* config/obj-som.c: Likewise.
	* config/tc-bfin.c: Likewise.
	* config/tc-i960.c: Likewise.
	* config/tc-rl78.c: Likewise.
	* config/tc-rx.c: Likewise.
	* config/tc-tic4x.c: Likewise.
	* expr.c: Likewise.
	* listing.c: Likewise.
	* config/obj-elf.c (elf_file_symbol): Make name_length a size_t.
	* config/tc-aarch64.c (symbol_locate): Likewise.
	* config/tc-arm.c (symbol_locate): Likewise.
	* config/tc-mmix.c (mmix_handle_mmixal): Make len_0 a size_t.
	* config/tc-score.c (s3_build_score_ops_hsh): Make len a size_t.
	(s3_build_dependency_insn_hsh): Likewise.
	* config/tc-score7.c (s7_build_score_ops_hsh): Likewise.
	(s7_build_dependency_insn_hsh): Likewise.
	* frags.c (frag_grow): Make parameter a size_t, and use size_t locals.
	(frag_new): Make parameter a size_t.
	(frag_var_init): Make max_chars and var parameters size_t.
	(frag_var, frag_variant): Likewise.
	(frag_room): Return a size_t.
	(frag_align_pattern): Make n_fill parameter a size_t.
	* frags.h: Update function prototypes.
	* symbols.c (save_symbol_name): Make name_length a size_t.
2014-07-26 21:00:50 +09:30
Alan Modra 62ebcb5cbe gas TC_PARSE_CONS_EXPRESSION communication with TC_CONS_FIX_NEW
A number of targets pass extra information from TC_PARSE_CONS_EXPRESSION
to TC_CONS_FIX_NEW via static variables.  That's OK, but not best
practice.  tc-ppc.c goes further in implementing its own replacement
for cons(), because the generic one doesn't allow relocation modifiers
on constants.  This patch fixes both of these warts.

	* gas/config/tc-alpha.h (TC_CONS_FIX_NEW): Add RELOC parameter.
	* gas/config/tc-arc.c (arc_cons_fix_new): Add reloc parameter.
	* gas/config/tc-arc.h (arc_cons_fix_new): Update prototype.
	(TC_CONS_FIX_NEW): Add RELOC parameter.
	* gas/config/tc-arm.c (cons_fix_new_arm): Similarly
	* gas/config/tc-arm.h (cons_fix_new_arm, TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-cr16.c (cr16_cons_fix_new): Similarly.
	* gas/config/tc-cr16.h (cr16_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-crx.h (TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-m32c.c (m32c_cons_fix_new): Similarly.
	* gas/config/tc-m32c.h (m32c_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-mn10300.c (mn10300_cons_fix_new): Similarly.
	* gas/config/tc-mn10300.h (mn10300_cons_fix_new, TC_CONS_FIX_NEW):
	Similarly.
	* gas/config/tc-ns32k.c (cons_fix_new_ns32k): Similarly.
	* gas/config/tc-ns32k.h (cons_fix_new_ns32k): Similarly.
	* gas/config/tc-pj.c (pj_cons_fix_new_pj): Similarly.
	* gas/config/tc-pj.h (pj_cons_fix_new_pj, TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-rx.c (rx_cons_fix_new): Similarly.
	* gas/config/tc-rx.h (rx_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-sh.c (sh_cons_fix_new): Similarly.
	* gas/config/tc-sh.h (sh_cons_fix_new, TC_CONS_FIX_NEW): Similarly.
	* gas/config/tc-tic54x.c (tic54x_cons_fix_new): Similarly.
	* gas/config/tc-tic54x.h (tic54x_cons_fix_new, TC_CONS_FIX_NEW):
	Similarly.
	* gas/config/tc-tic6x.c (tic6x_cons_fix_new): Similarly.
	* gas/config/tc-tic6x.h (tic6x_cons_fix_new, TC_CONS_FIX_NEW):
	Similarly.
	* gas/config/tc-arc.c (arc_parse_cons_expression): Return reloc.
	* gas/config/tc-arc.h (arc_parse_cons_expression): Update proto.
	* gas/config/tc-avr.c (exp_mod_data): Make global.
	(pexp_mod_data): Delete.
	(avr_parse_cons_expression): Return exp_mod_data pointer.
	(avr_cons_fix_new): Add exp_mod_data_t pointer param.
	(exp_mod_data_t): Move typedef..
	* gas/config/tc-avr.h: ..to here.
	(exp_mod_data): Declare.
	(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
	(avr_parse_cons_expression, avr_cons_fix_new): Update prototype.
	(TC_CONS_FIX_NEW): Update.
	* gas/config/tc-hppa.c (hppa_field_selector): Delete static var.
	(cons_fix_new_hppa): Add hppa_field_selector param.
	(fix_new_hppa): Adjust.
	(parse_cons_expression_hppa): Return field selector.
	* gas/config/tc-hppa.h (parse_cons_expression_hppa): Update proto.
	(cons_fix_new_hppa): Likewise.
	(TC_PARSE_CONS_RETURN_TYPE, TC_PARSE_CONS_RETURN_NONE): Define.
	* gas/config/tc-i386.c (got_reloc): Delete static var.
	(x86_cons_fix_new): Add reloc param.
	(x86_cons): Return got reloc.
	* gas/config/tc-i386.h (x86_cons, x86_cons_fix_new): Update proto.
	(TC_CONS_FIX_NEW): Add RELOC param.
	* gas/config/tc-ia64.c (ia64_cons_fix_new): Add reloc param.  Adjust
	calls.
	* gas/config/tc-ia64.h (ia64_cons_fix_new): Update prototype.
	(TC_CONS_FIX_NEW): Add reloc param.
	* gas/config/tc-microblaze.c (parse_cons_expression_microblaze):
	Return reloc.
	(cons_fix_new_microblaze): Add reloc param.
	* gas/config/tc-microblaze.h: Formatting.
	(parse_cons_expression_microblaze): Update proto.
	(cons_fix_new_microblaze): Likewise.
	* gas/config/tc-nios2.c (nios2_tls_ldo_reloc): Delete static var.
	(nios2_cons): Return ldo reloc.
	(nios2_cons_fix_new): Delete.
	* gas/config/tc-nios2.h (nios2_cons): Update prototype.
	(nios2_cons_fix_new, TC_CONS_FIX_NEW): Delete.
	* gas/config/tc-ppc.c (md_pseudo_table): Remove quad, long, word,
	short.  Make llong use cons.
	(ppc_elf_suffix): Return BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
	(ppc_elf_cons): Delete.
	(ppc_elf_parse_cons): New function.
	(ppc_elf_validate_fix): Don't check for BFD_RELOC_UNUSED.
	(md_assemble): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
	* gas/config/tc-ppc.h (TC_PARSE_CONS_EXPRESSION): Define
	(ppc_elf_parse_cons): Declare.
	* gas/config/tc-sparc.c (sparc_cons_special_reloc): Delete static var.
	(sparc_cons): Return reloc specifier.
	(cons_fix_new_sparc): Add reloc specifier param.
	(sparc_cfi_emit_pcrel_expr): Use emit_expr_with_reloc.
	* gas/config/tc-sparc.h (TC_PARSE_CONS_RETURN_TYPE): Define.
	(TC_PARSE_CONS_RETURN_NONE): Define.
	(sparc_cons, cons_fix_new_sparc): Update prototype.
	* gas/config/tc-v850.c (hold_cons_reloc): Delete static var.
	(v850_reloc_prefix): Use BFD_RELOC_NONE rather than BFD_RELOC_UNUSED.
	(md_assemble): Likewise.
	(parse_cons_expression_v850): Return reloc.
	(cons_fix_new_v850): Add reloc parameter.
	* gas/config/tc-v850.h (parse_cons_expression_v850): Update proto.
	(cons_fix_new_v850): Likewise.
	* gas/config/tc-vax.c (vax_cons_special_reloc): Delete static var.
	(vax_cons): Return reloc.
	(vax_cons_fix_new): Add reloc parameter.
	* gas/config/tc-vax.h (vax_cons, vax_cons_fix_new): Update proto.
	* gas/config/tc-xstormy16.c (xstormy16_cons_fix_new): Add reloc param.
	* gas/config/tc-xstormy16.h (xstormy16_cons_fix_new): Update proto.
	* gas/dwarf2dbg.c (TC_PARSE_CONS_RETURN_NONE): Provide default.
	(emit_fixed_inc_line_addr): Adjust exmit_expr_fix calls.
	* gas/read.c (TC_PARSE_CONS_EXPRESSION): Return value.
	(do_parse_cons_expression): Adjust.
	(cons_worker): Pass return value from TC_PARSE_CONS_EXPRESSION
	to emit_expr_with_reloc.
	(emit_expr_with_reloc): New function handling reloc, mostly
	extracted from..
	(emit_expr): ..here.
	(emit_expr_fix): Add reloc param.  Adjust TC_CONS_FIX_NEW invocation.
	Handle reloc.
	(parse_mri_cons): Convert to ISO.
	* gas/read.h (TC_PARSE_CONS_RETURN_TYPE): Define.
	(TC_PARSE_CONS_RETURN_NONE): Define.
	(emit_expr_with_reloc): Declare.
	(emit_expr_fix): Update prototype.
	* gas/write.c (write_object_file): Update TC_CONS_FIX_NEW invocation.
2014-04-09 14:29:05 +09:30
Alan Modra 4b95cf5c0c Update copyright years 2014-03-05 22:16:15 +10:30
Nick Clifton 720fbed62e * config/tc-rx.c (rx_include): Rename 'eof' to 'last_char' in
order to avoid conflict with same named variable in MinGW system
	header file.
2013-12-18 11:51:25 +00:00
Nick Clifton f0c0028234 * config/rx-defs.h: Add macros for RX100, RX200, RX600, and
RX610.
        * config/rx-parse.y: (rx_check_float_support): Add function to
	check floating point operation support for target RX100 and
	RX200.
        * config/tc-rx.c: Add CPU options RX100, RX200, RX600, and RX610.
        * doc/c-rx.texi: Add -mcpu option to recognize macros for RX100,
        RX200, RX600, and RX610
2013-07-18 12:15:15 +00:00
Nick Clifton 708e2187a3 2012-11-09 Nick Clifton <nickc@redhat.com>
* elf32-rx.c (describe_flags): New function.  Returns a buffer
	containing a description of the E_FLAG_RX_... values set.
	(rx_elf_merge_private_bfd_data): Use it.
	(rx_elf_print_private_bfd_data): Likewise.
	(elf32_rx_machine): Skip EF_RX_CPU_RX check.
	(elf32_rx_special_sections): Define.
	(elf_backend_special_sections): Define.

2012-11-09  Nick Clifton  <nickc@redhat.com>

	* readelf.c (get_machine_flags): Add support for E_FLAG_RX_ABI.

2012-11-09  Nick Clifton  <nickc@redhat.com>

	* config/obj-elf.c (obj_elf_change_section): Allow init array
	sections to have the SHF_EXECINSTR attribute for the RX target.
	* config/tc-rx.c (elf_flags): Initialise with E_FLAG_RX_ABI.
	(enum options): Add OPTION_USES_GCC_ABI and OPTION_USES_RX_ABI.
	(md_longopts): Add -mgcc-abi and -mrx-abi.
	(md_parse_option): Add support for OPTION_USES_GCC_ABI and
	OPTION_USES_RX_ABI.
	* doc/as.texinfo (RX Options): Add mention of remaining RX
	options.
	* doc/c-rx.texi: Document -mgcc-abi and -mrx-abi.

2012-11-09  Nick Clifton  <nickc@redhat.com>

	* rx.h (EF_RX_CPU_RX): Add comment.
	(E_FLAG_RX_ABI): Define.

2012-11-09  Nick Clifton  <nickc@redhat.com>

	* emultempl/rxelf.em (no_flag_mismatch_warnings): Initialise to
	true.
	(PARSE_AND_LIST_LONGOPTS): Add flag-mismatch-warnings.
	(PARSE_AND_LIST_ARG_CASES): Add support for
	--flag-mismatch-warnings.
2012-11-09 17:00:44 +00:00
DJ Delorie 0e25bcb440 * config/tc-rx.c (rx_fetchalign): Declare.
(md_pseudo_table): Add .fetchalign.
(RX_NBASE_FETCHALIGN): New.
(fetchalign_bytes): New.
(rx_fetchalign): New.
(rx_frag_init): If a "magic" value is found, also init the
machine-specific data.
(md_assemble): Note following opcode size if called for.
(rx_next_opcode): New.
(rx_relax_frag): Support .fetchalign.
(md_convert_frag): Likewise.
* doc/c-rx.texi (RX-Directives): Add .fetchalign.
2012-05-15 03:04:47 +00:00
Nick Clifton d4cb0ea0ca * readelf.c (get_machine_dlags): Add support for RX's PID mode.
* ld-scripts/phdrs.exp: Expect to fail for the RX.

	* elf32-rx.c: Add support for PID mode.
	(rx_elf_relocate_section): Add checks for unsafe PID relocations.
	Include addend in R_RX_SYM relocations.

	* config/rx-defs.h (rx_pid_register): New.
	(rx_gp_register): New.
	* config/rx-parse.y (rx_lex): Add support for %gpreg and %pidreg.
	(displacement): Add PID support.
	* config/tc-rx.c (rx_pid_mode): New.
	(rx_num_int_regs): New.
	(rx_pid_register): New.
	(rx_gp_register): New.
	(options): Add -mpid and -mint-register= options.
	(md_longopts): Likewise.
	(md_parse_option): Likewise.
	(md_show_usage): Likewise.
	(rx_pid_symbol): New.
	(rx_pidreg_symbol): New.
	(rx_gpreg_symbol): New.
	(md_begin): Support PID.
	(rx_validate_fix_sub): Support PID.
	(tc_gen_reloc): Support PID.
	* doc/c-rx.texi: Document PID support.

	* rx.h (E_FLAG_RX_PID): New.
2011-10-05 14:13:31 +00:00
Nick Clifton 53d780c93d * config/tc-rx.c (md_convert_frag): Fix encoding of beq.a
synthetic instruction.

	* gas/rx/r-bcc.d: Update expected disassembly of synthetic beq.a
	instruction.
2011-07-26 14:09:36 +00:00
Nick Clifton a22429b98e * write.c (write_contents): Include output file name and bfd error
value when reporting the inability to write to the output file.
	* config/tc-rx.c (rx_handle_align): Do not insert NOPs into align
	frag that has a non-zero fill value.

	* gas/all/align.d: Skip for the RX.
	* gas/elf/group1a.d: Likewise.
	* gas/elf/groupautoa.d: Likewise.
	* gas/elf/elf.exp: Do not run section5 test for the RX port.
	* gas/elf/section4.d: Likewise.
	* gas/elf/section7.d: Likewise.
	* gas/macros/semi.s: Fill with a non-zero pattern.
	* gas/macros/semi.d: Expect non-zero fill value.
	* gas/rx/bcnd.d: Update expected disassembly.
	* gas/rx/bra.d: Likewise.
	* gas/rx/macros.inc: Add reg1 macro.
	* gas/rx/max.sm: Use reg1 macro to avoid generating illegal NOP
	instruction.
	* gas/rx/mov.sm: Likewise.
	* gas/rx/max.d: Update expected disassembly.
	* gas/rx/mov.d: Likewise.
	* gas/rx/rx-asm-good.s: Use Renesas section names.
	* gas/rx/rx-asm-good.d: Update expected disassembly.
2011-01-31 16:43:15 +00:00
DJ Delorie eb6fae196b * config/tc-rx.c (md_convert_frag): If we can't compute the target
address, zero out the values stored in the object file to make
objdump's output consistent.
2011-01-27 22:38:32 +00:00
DJ Delorie 9689e3a3a7 * reloc.c: Add BFD_RELOC_RX_OP_NEG.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
* elf32-rx.c: Add it to the list, corresponding to R_RX_OPneg.

* config/tc-rx.c (tc_gen_reloc): Emit an RX_OP_NEG expression
instead of an RH_NEG32 one.
2011-01-05 22:04:09 +00:00