Commit Graph

46 Commits

Author SHA1 Message Date
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 3076e59490 A series of fixes to addres problems detected by compiling the assembler with address sanitization enabled.
PR 24538
gas	* macro.c (get_any_string): Increase size of buffer used to hold
	decimal value of expression result.
	* dw2gencfi.c (get_debugseg_name): Handle an empty name.
	* dwarf2dbg.c (get_filenum): Catch integer wraparound when
	extending allocate file array.
	(dwarf2_directive_filename): Add extra checks of the computed file
	number.
	* config/tc-arm.c (arm_tc_equal_in_insn): Insert copy of name into
	warning hash table.
	(s_arm_eabi_attribute): Check for obj_elf_vendor_attribute
	returning -1.
	* config/tc-i386.c (i386_output_nops): Catch an attempt to
	generate nops of negative lengths.
	* as.h (MAX_LITTLENUMS): Move definition to here from...
	* config/atof-ieee.c: ...here.
	* config/tc-aarch64.c: ...here.
	* config/tc-arc.c: ...here.
	* config/tc-arm.c: ...here.
	* config/tc-epiphany.c: ...here.
	* config/tc-i386.c: ...here.
	* config/tc-ia64.c: ...here.  (And correct the value).
	* config/tc-m32c.c: ...here.
	* config/tc-m32r.c: ...here.
	* config/tc-metag.c: ...here.
	* config/tc-microblaze.c: ...here.
	* config/tc-nds32.c: ...here.
	* config/tc-or1k.c: ...here.
	* config/tc-score.c: ...here.
	* config/tc-score7.c: ...here.
	* config/tc-tic4x.c: ...here.
	* config/tc-tilegx.c: ...here.
	* config/tc-tilepro.c: ...here.
	* config/tc-visium.c: ...here.
	* config/tc-sh.c (md_assemble): Add check for an instruction with
	no opcodes.
	* config/tc-mips.c (mips_lookup_insn): Add check for very short
	instruction name.
	* config/tc-tic54x.c: Use unsigned chars to access is_end_of_line
	array.
	(tic54x_start_line_hook): Check for an empty line.
	(next_line_shows_parallel): Do not walk off the end of the string.
	(tic54x_macro_start): Check for too much macro nesting.
	(tic54x_start_label): Add label_start parameter.  Use this
	parameter to check the first character of the label.
	* config/tc-tic54x.h (TC_START_LABEL_WITHOUT_COLON): Pass
	line_start variable to tic54x_start_label.

	PR 24538
opcodes	* ia64-opc.c (ia64_find_matching_opcode): Check for reaching the
	end of the table prematurely.
2019-05-14 10:42:25 +01:00
Alan Modra 27cdfa03b5 m32c padding with nops
m32c_md_end attempted to pad out a code section with nops, but this
was just plain wrong in many ways:
- The padding didn't happen at all if the last section emitted wasn't
  a code section.
- The padding went to the wrong place if subsections were used, and
  the last subseg used wasn't the highest numbered subseg.
- Padding wasn't added to all code sections.
- If the last section was empty, it was padded to 4 bytes.
- The padding didn't go to a 4-byte alignment boundary, instead it
  effectively made the last instruction 4 bytes in size.
- The padding didn't take into account that code sections may have
  contents other than machine instructions.

So, rip it out and handle nop padding properly, also fixing .align
.balign/.p2align in the middle of code.

gas/
	* config/tc-m32c.c (insn_size): Delete static var.
	(md_begin): Don't set it.
	(m32c_md_end): Delete.
	(md_assemble): Add insn_size auto var.
	* config/tc-m32c.h (md_end): Don't define.
	(m32c_md_end): Delete.
	(NOP_OPCODE, HANDLE_ALIGN, MAX_MEM_FOR_RS_ALIGN_CODE): Define.
	* testsuite/gas/all/align.d: Remove m32c from notarget list.
	* testsuite/gas/all/incbin.d: Likewise.
	* testsuite/gas/elf/dwarf2-11.d: Likewise.
	* testsuite/gas/macros/semi.d: Likewise.
	* testsuite/gas/all/gas.exp (do_comment): Similarly.
ld/
	* testsuite/ld-scripts/fill.d: Don't xfail m32c
	* testsuite/ld-scripts/fill16.d: Likewise.
2019-05-04 17:23:18 +09:30
Alan Modra 827041555a Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
Alan Modra 219d1afa89 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
Nick Clifton 863f7a5f48 Update the address of the FSF in the copyright notice of files which were using the old address.
top	* COPYING.LIBGLOSS: Update address of FSF in copyright notice.

bfd	* cpu-mt.c: Update address of FSF in copyright notice.
	* elf32-m32c.c: Likewise.
	* elf32-mt.c: Likewise.
	* elf32-rl78.c: Likewise.
	* elf32-rx.c: Likewise.
	* elf32-rx.h: Likewise.
	* elf32-spu.h: Likewise.
	* hosts/x86-64linux.h: Likewise.

etc	* add-log.el: Update address of FSF in copyright notice.

gas	* config/tc-m32c.c: Update address of FSF in copyright notice.
	* config/tc-m32c.h: Likewise.
	* config/tc-mt.c: Likewise.
	* config/tc-mt.h: Likewise.
	* config/tc-visium.c: Likewise.
	* config/tc-visium.h: Likewise.
	* testsuite/gas/rx/explode: Likewise.

ld	* testsuite/ld-mn10300/mn10300.exp: Update address of FSF in
	copyright notice.
2017-12-14 12:48:55 +00:00
Alan Modra 2571583aed Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
Alan Modra 00dad9a491 Don't include libbfd.h outside of bfd, part 2
Make bfd_default_set_arch_mach available to a bunch of gas backend
files.

bfd/
	* archures.c (bfd_default_set_arch_mach): Make available in bfd.h.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.
gas/
	* config/tc-epiphany.c: Don't include libbfd.h.
	* config/tc-frv.c: Likewise.
	* config/tc-ip2k.c: Likewise.
	* config/tc-iq2000.c: Likewise.
	* config/tc-m32c.c: Likewise.
	* config/tc-mep.c: Likewise.
	* config/tc-mt.c: Likewise.
	* config/tc-nios2.c: Likewise.
2016-07-16 13:27:30 +09:30
Trevor Saunders 85e53f6272 remove some unused globals
gas/ChangeLog:

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

	* config/tc-m32c.c (M32C_Macros): Remove.
	* config/tc-msp430.c (option_numbers): Likewise.
2016-04-14 16:58:01 -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 f854977c23 cast the arg to md_assemble () to char *
For these targets its not clear how md_assemble can usefully be split up so
that part can take const char *.  There is also a fair number of targets that
need md_assemble () to take a char *, so we can't easily make the argument
const.  So since there isn't many callers it seems easiest to just add a couple
of casts.

gas/ChangeLog:

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

	* config/tc-m32c.c (m32c_md_end): cast the argument to md_assemble to
	char *.
	(m32c_indirect_operand): Likewise.
	* config/tc-nds32.c (do_pseudo_b): Likewise.
	(do_pseudo_bal): Likewise.
	(do_pseudo_ls_bhw): Likewise.
2016-03-31 07:29:00 -04:00
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
Alan Modra 6f2750feaf Copyright update for binutils 2016-01-01 23:00:01 +10:30
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
Alan Modra 2e57ce7b14 More fallout from "Allow symbol and label names to be enclosed in double quotes"
Some of the TC_START_LABEL implementations need to adjust the end of
the symbol, when a colon doesn't mean a label definition.  That means
they need access to nul_char both the restore the NUL location (it may
be a quote rather than a colon) and to store the new nul_char.  Others
need adjusting to step over a potential trailing quote.

	PR gas/18581
	* config/tc-aarch64.h (TC_START_LABEL): Redefine.
	* config/tc-arm.c (tc_start_label_without_colon): Delete params.
	Use input_line_pointer directly.
	* config/tc-arm.h (TC_START_LABEL): Redefine.
	(TC_START_LABEL_WITHOUT_COLON): Redefine.
	(tc_start_label_without_colon): Update prototype.
	* config/tc-bfin.c (bfin_start_label): Delete ptr param.  Check
	for NUL instead.
	* config/tc-bfin.h (bfin_start_label): Update prototype.
	(TC_START_LABEL): Redefine.
	* config/tc-d30v.h (TC_START_LABEL): Redefine.
	* config/tc-fr30.c (restore_colon): Rewrite.
	(fr30_is_colon_insn): Add nul_char param.  Return int.  Bump
	i_l_p over quote.  Update restore_colon calls.
	* config/tc-fr30.h (TC_START_LABEL): Redefine.
	(fr30_is_colon_insn): Update prototype.
	* config/tc-m32c.c (restore_colon, m32c_is_colon_insn): As above.
	* config/tc-m32c.h (TC_START_LABEL): Redefine.
	(m32c_is_colon_insn): Update prototype.
	* config/tc-m32r.h (TC_START_LABEL): Redefine.
	* config/tc-mep.h (TC_START_LABEL): Redefine.
	* config/tc-nds32.h (TC_START_LABEL): Redefine.
	* config/tc-tic54x.c (tic54x_start_label): Replace params with
	nul_char and next_char.  Step over trailing quote.
	* config/tc-tic54x.h (TC_START_LABEL_WITHOUT_COLON): Redefine.
	(tic54x_start_label): Update prototype.
	* read.c (TC_START_LABEL): Redefine.  Update invocation.
	(TC_START_LABEL_WITHOUT_COLON): Update invocation.
	* config/tc-nios2.c (s_nios2_set): Save initial input_line_pointer
	and restore if calling s_set.  Don't restore delim again.
2015-08-27 23:19:59 +09:30
H.J. Lu 3739860c11 Remove trailing spaces in gas 2015-08-12 04:40:42 -07:00
Alan Modra b90efa5b79 ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10: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
Alan Modra b96282be2d * configure.tgt (m32c): Set endian=little.
* config/tc-m32c.h (TARGET_BYTES_BIG_ENDIAN): Define as 0.
	* config/tc-m32c.c (md_number_to_chars): Revert last change.
2010-08-04 04:21:06 +00:00
Alan Modra e4d9f07834 * config/tc-d10v.h (TARGET_BYTES_BIG_ENDIAN): Define as 1.
* config/tc-m32c.c (md_number_to_chars): Call bigendian
	form of number_to_chars, not littleendian.
2010-08-03 10:53:10 +00:00
Alan Modra 87975d2a60 * config/obj-evax.h (S_SET_OTHER, S_SET_TYPE, S_SET_DESC): Don't define.
* config/tc-crx.c (gettrap): Constify arg.
	(handle_LoadStor, get_cinv_parameters): Likewise.
	(getreg_image): Fix enum warning
	(md_assemble): Restore input line char.
	* config/tc-hppa.c (tc_gen_reloc): Fix enum warning.
	* config/tc-i960.c (mem_fmt): Rename var to fix shadow warning.
	* config/tc-sh.c (sh_fdpic): Only define when OBJ_ELF.
	(build_Mytes): Fix build failure for non-elf targets.
	* config/tc-tic4x.c (tic4x_eval): Restore terminator char.
	* config/tc-xtensa.c (xtensa_end_directive): Fix switch enum warning.

	* cgen.c (gas_cgen_md_apply_fix): Avoid set but unused warning.
	* ecoff.c (add_ecoff_symbol): Likewise.
	* itbl-ops.c (append_insns_as_macros): Likewise.
	* listing.c (debugging_pseudo): Likewise.
	* read.c (s_mri_common, stringer): Likewise.
	* config/obj-coff.c (coff_frob_section): Likewise.
	* config/tc-alpha.c (emit_ldgp, s_alpha_proc): Likewise.
	* config/tc-arm.c (my_get_expression): Likewise.
	* config/tc-hppa.c (process_exit, pa_type_args): Likewise.
	* config/tc-m32c.c (md_assemble): Likewise.
	* config/tc-microblaze.c (md_convert_frag): Likewise.
	* config/tc-mips.c (s_change_section): Likewise.
	* config/tc-mt.c (mt_fix_adjustable): Likewise.
	* config/tc-xtensa.c (xtensa_literal_pseudo): Likewise.

	* config/obj-aout.c (obj_aout_frob_symbol): Delete set but otherwise
	unused vars.
	* config/tc-alpha.c (load_expression): Likewise.
	(s_alpha_rdata, s_alpha_section, s_alpha_prologue): Likewise.
	* config/tc-arm.c (parse_neon_el_struct_list): Likewise.
	* config/tc-avr.c (extract_word): Likewise.
	* config/tc-cris.c (cris_get_expression): Likewise.
	* config/tc-d30v.c (build_insn, find_format): Likewise.
	* config/tc-dlx.c (machine_ip): Likewise.
	* config/tc-hppa.c (pa_get_absolute_expression): Likewise.
	* config/tc-i370.c (md_assemble): Likewise.
	* config/tc-i960.c (brtab_emit): Likewise.
	* config/tc-iq2000.c (s_iq2000_ent): Likewise.
	* config/tc-m32c.c (md_convert_frag): Likewise.
	* config/tc-m68hc11.c (fixup24, build_jump_insn): Likewise.
	(md_estimate_size_before_relax, md_apply_fix): Likewise.
	* config/tc-m68k.c (md_show_usage): Likewise.
	* config/tc-microblaze.c (microblaze_s_lcomm): Likewise.
	* config/tc-mips.c (s_mips_end): Likewise.
	* config/tc-mmix.c (mmix_byte, mmix_cons): Likewise.
	* config/tc-mn10300.c (md_assemble): Likewise.
	* config/tc-msp430.c (extract_word): Likewise.
	* config/tc-mt.c (md_assemble): Likewise.
	* config/tc-or32.c (machine_ip): Likewise.
	* config/tc-pj.c (md_apply_fix): Likewise.
	* config/tc-s390.c (md_gather_operands): Likewise.
	* config/tc-sh.c (sh_cons_align): Likewise.
	* config/tc-sparc.c (sparc_cons_align): Likewise.
	* config/tc-tic4x.c (tic4x_sect): Likewise.
	* config/tc-tic54x.c (tic54x_stringer): Likewise.
	* config/tc-vax.c (vip_op): Likewise.
	* config/tc-xstormy16.c (xstormy16_cons_fix_new): Likewise.
	* config/tc-xtensa.c (md_assemble): Likewise.
	(xtensa_fix_short_loop_frags, convert_frag_immed): Likewise.
	(xtensa_move_literals): Likewise.
2010-06-28 14:06:57 +00:00
Tristan Gingold 1b31b9e34a 2009-10-29 Tristan Gingold <gingold@adacore.com>
* config/tc-mep.c (md_pseudo_table): Remove dwarf2 pseudo
	as they are already defined in obj-elf.c
	* config/tc-m32c.c (md_pseudo_table): Ditto.
	* config/tc-spu.c (md_pseudo_table): Ditto.
	* config/tc-avr.c (md_pseudo_table): Ditto.
2009-10-29 09:43:18 +00:00
Alan Modra aa820537ea update copyright dates 2009-09-02 07:25:43 +00:00
Nick Clifton 9c2799c243 * gas/app, gas/as.c, gas/as.h, gas/atof-generic.c, gas/cgen.c,
gas/config/atof-ieee.c, gas/config/obj-aout.c,
        gas/config/obj-coff.c, gas/config/obj-ecoff.c,
        gas/config/obj-elf.c, gas/config/obj-som.c, gas/config/tc-alpha.c,
        gas/config/tc-arc.c, gas/config/tc-arm.c, gas/config/tc-cr16.c,
        gas/config/tc-cris.c, gas/config/tc-crx.c, gas/config/tc-d30v.c,
        gas/config/tc-dlx.c, gas/config/tc-hppa.c, gas/config/tc-i370.c,
        gas/config/tc-i386-intel.c, gas/config/tc-i386.c,
        gas/config/tc-i860.c, gas/config/tc-i960.c, gas/config/tc-ia64.c,
        gas/config/tc-iq2000.c, gas/config/tc-m32c.c,
        gas/config/tc-m32r.c, gas/config/tc-m68hc11.c,
        gas/config/tc-m68k.c, gas/config/tc-maxq.c, gas/config/tc-mcore.c,
        gas/config/tc-mep.c, gas/config/tc-mips.c, gas/config/tc-mmix.c,
        gas/config/tc-mn10300.c, gas/config/tc-moxie.c,
        gas/config/tc-ns32k.c, gas/config/tc-pj.c, gas/config/tc-ppc.c,
        gas/config/tc-s390.c, gas/config/tc-score.c,
        gas/config/tc-score7.c, gas/config/tc-sh.c, gas/config/tc-sparc.c,
        gas/config/tc-spu.c, gas/config/tc-tic30.c, gas/config/tc-vax.c,
        gas/config/tc-xtensa.c, gas/config/xtensa-relax.c,
        gas/dw2gencfi.c, gas/dwarf2dbg.c, gas/ehopt.c, gas/expr.c,
        gas/frags.c, gas/input-file.c, gas/read.c, gas/sb.c,
        gas/subsegs.c, gas/symbols.c, gas/write.c: Change the name of the
        gas macro `assert' to `gas_assert'.
2009-06-22 17:56:02 +00:00
DJ Delorie 801fb795a4 * config/tc-m32c.c (md_pseudo_table): Add support for .loc et al. 2008-11-26 18:44:14 +00:00
DJ Delorie 911c9c13f8 * config/tc-m32c.c (md_convert_frag): Fix ADJNZ reloc math. 2008-11-25 23:02:02 +00:00
Alan Modra 5a49b8acf4 Banish PARAMS and PTR. Convert to ISO C.
Delete unnecessary forward declarations.
2008-08-12 23:39:31 +00:00
DJ Delorie c54b5932c5 * config/tc-m32c.h (H_TICK_HEX): Define.
* config/tc-m32c.c (OPTION_H_TICK_HEX): Define.
(md_longopts): Add support for it.
(md_parse_option): Likewise.
* doc/as.texinfo (Overview): Add new m32c options.
* doc/c-m32c.texi (M32C-Modifiers): Likewise

* as.h: (enable_h_tick_hex): New.
* app.c (enable_h_tick_hex): New.
(LEX_IS_H): New.
(do_scrub_begin): Mark 'H' and 'h' as special if enable_h_tick_hex.
(do_scrub_chars): If enable_h_tick_hex and 'h', check for H'00
style hex constants and convert the input stream to 0x00 style.
(do_scrub_chars): If a 'X style character constant is found after
a symbol character (like you're or X'00), warn the user.
2008-07-18 22:25:07 +00:00
Nick Clifton 499ac35361 Remove duplicate definitions of the md_atof() function 2007-10-17 16:45:56 +00:00
Nick Clifton ec2655a6a7 Switch to GPLv3 2007-07-03 11:01:12 +00:00
DJ Delorie 144f4bc66d * m32c.cpu (Imm-8-s4n): Fix print hook.
(Lab-24-8, Lab-32-8, Lab-40-8): Fix.
(arith-jnz-imm4-dst-defn): Make relaxable.
(arith-jnz16-imm4-dst-defn): Fix encodings.

* m32c-desc.c: Regenerate.
* m32c-dis.c: Regenerate.
* m32c-opc.c: Regenerate.

* config/tc-m32c.c (rl_for, relaxable): Protect argument.
(md_relax_table): Add entries for ADJNZ macros.
(M32C_Macros): Add ADJNZ macros.
(subtype_mappings): Add entries for ADJNZ macros.
(insn_to_subtype): Check for adjnz and sbjnz insns.
(md_estimate_size_before_relax): Pass insn to insn_to_subtype.
(md_convert_frag): Convert adjnz and sbjnz.
2007-03-29 23:56:39 +00:00
DJ Delorie e110eeb74e * config/tc-m32c.c (m32c_cons_fix_new): New. Added to support 3
byte relocs.
* config/tc-m32c.h (TC_CONS_FIX_NEW): Define.
(m32c_cons_fix_new): Prototype.
2007-02-04 04:45:36 +00:00
DJ Delorie 7bc4c13c61 * config/tc-m32c.c (md_pseudo_table): Add .3byte. 2007-01-24 21:53:09 +00:00
Alan Modra ebd1c8757c remove some duplicate #include's. 2006-06-07 11:27:58 +00:00
DJ Delorie 6772dd07c4 [include/elf]
* m32c.h: Add relax relocs.

[cpu]
	* m32c.cpu (RL_TYPE): New attribute, with macros.
	(Lab-8-24): Add RELAX.
	(unary-insn-defn-g, binary-arith-imm-dst-defn,
	binary-arith-imm4-dst-defn): Add 1ADDR attribute.
	(binary-arith-src-dst-defn): Add 2ADDR attribute.
	(jcnd16-5, jcnd16, jcnd32, jmp16.s, jmp16.b, jmp16.w, jmp16.a,
	jmp32.s, jmp32.b, jmp32.w, jmp32.a, jsr16.w, jsr16.a): Add JUMP
	attribute.
	(jsri16, jsri32): Add 1ADDR attribute.
	(jsr32.w, jsr32.a): Add JUMP attribute.

[opcodes]
	* m32c-desc.c: Regenerate with linker relaxation attributes.
	* m32c-desc.h: Likewise.
	* m32c-dis.c: Likewise.
	* m32c-opc.c: Likewise.

[gas]
	* config/tc-m32c.h (md_apply_fix): Define to m32c_apply_fix.
	(tc_gen_reloc): Don't define.
	* config/tc-m32c.c (rl_for, relaxable): New convenience macros.
	(OPTION_LINKRELAX): New.
	(md_longopts): Add it.
	(m32c_relax): New.
	(md_parse_options): Set it.
	(md_assemble): Emit relaxation relocs as needed.
	(md_convert_frag): Emit relaxation relocs as needed.
	(md_cgen_lookup_reloc): Add LAB_8_8 and LAB_8_16.
	(m32c_apply_fix): New.
	(tc_gen_reloc): New.
	(m32c_force_relocation): Force out jump relocs when relaxing.
	(m32c_fix_adjustable): Return false if relaxing.

[bfd]
	* elf32-m32c.c (m32c_elf_howto_table): Add relaxation relocs.
	(m32c_elf_relocate_section): Don't relocate them.
	(compare_reloc): New.
	(relax_reloc): Remove.
	(m32c_offset_for_reloc): New.
	(m16c_addr_encodings): New.
	(m16c_jmpaddr_encodings): New.
	(m32c_addr_encodings): New.
	(m32c_elf_relax_section): Relax jumps and address displacements.
	(m32c_elf_relax_delete_bytes): Adjust for internal syms.  Fix up
	short jumps.

	* reloc.c: Add m32c relax relocs.
	* libbfd.h: Regenerate.
2006-02-24 22:10:36 +00:00
DJ Delorie bbc434cbc9 * config/tc-m32c.c (m32c_md_end): Only pad code sections. 2005-12-14 02:27:34 +00:00
Dave Brolley 4fb1e3d3e1 2005-10-28 Dave Brolley <brolley@redhat.com>
Contribute the following change:
        2005-09-19  Dave Brolley  <brolley@redhat.com>

        * config/tc-m32c.c (default_isa): New static variable.
        (m32c_isa): Now of type CGEN_BITSET.
        (md_begin): Pass &m32c_isa to m32c_cgen_cpu_open.
2005-10-28 19:37:14 +00:00
DJ Delorie d14c4fad02 * config/tc-m32c.c (md_relax_table, subtype_mappings,
md_convert_frag): Add jsr.w support.
2005-10-26 20:42:00 +00:00
DJ Delorie 6b73c529e0 * config/tc-m32c.c (md_assemble): Don't use errmsg as the format
itself.
(md_cgen_lookup_reloc): Add m32c bitbase operands.  Add 8-s24
and imm-8-HI operands.
2005-10-26 19:24:20 +00:00
DJ Delorie cab0a0db16 * config/tc-m32c.c (md_cgen_lookup_reloc): Add more relocs. Print
names unstead of numbers.
2005-10-22 00:04:26 +00:00
DJ Delorie fd54057a29 [bfd]
* reloc.c: Remove unused M32C relocs, add BFD_RELOC_M32C_HI8.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.

	* elf32-m32c.c (m32c_elf_howto_table): Add R_M32C_8, R_M32C_LO16,
	R_M32C_HI8, R_M32C_HI16.
	(m32c_reloc_map): Likewise.
	(m32c_elf_relocate_section): Add R_M32C_HI8 and R_M32C_HI16.

[cpu]
	* m32c.opc (parse_unsigned8): Add %dsp8().
	(parse_signed8): Add %hi8().
	(parse_unsigned16): Add %dsp16().
	(parse_signed16): Add %lo16() and %hi16().
	(parse_lab_5_3): Make valuep a bfd_vma *.

[gas]
	* config/tc-m32c.c (md_cgen_lookup_reloc): Add 8 bit operands.
	Support %mod() modifiers from opcodes.
	* doc/c-m32c.texi (M32C-Modifiers): New section.

[include/elf]

	* m32c.h: Add R_M32C_8, R_M32C_LO16, R_M32C_HI8, and R_M32C_HI16.

[opcodes]
	* m32c-asm.c Regenerate.
	* m32c-dis.c Regenerate.
2005-07-26 03:21:53 +00:00
Nick Clifton e729279b04 Fix building for MS1 and M32C.
Restore alpha- sorting to the architecture tables.
2005-07-18 14:13:36 +00:00
Jim Blandy 49f58d10f8 ChangeLog:
2005-07-14  Jim Blandy  <jimb@redhat.com>

	* configure.in: Add cases for Renesas m32c.
	* configure: Regenerated.

bfd/ChangeLog:
2005-07-14  Jim Blandy  <jimb@redhat.com>

	Add support for m32c-*-elf (Renesas m32c and m16c).
	* Makefile.am (ALL_MACHINES): Add cpu-m32c.lo.
	(ALL_MACHINES_CFILES): Add cpu-m32c.c.
	(BFD32_BACKENDS): Add elf32-m32c.lo.
	(BFD32_BACKENDS_CFILES): Add elf32-m32c.c.
	(cpu-m32c.lo, elf32-m32c.lo): New rules, generated by 'make dep-am'.
	* Makefile.in: Regenerated.
	* archures.c (bfd_arch_m32c, bfd_mach_m16c, bfd_mach_m32c): New
	arch and mach codes.
	(bfd_m32c_arch): New arch info object.
	(bfd_archures_list): List bfd_m32c_arch.
	* bfd-in2.h: Regenerated.
	* config.bfd: Add case for the m32c.
	* configure.in: Add case for the m32c.
	* configure: Regenerated.
	* cpu-m32c.c, elf32-m32c.c: New files.
	* libbfd.h: Regenerated.
	* targets.c (bfd_elf32_m32c_vec): Declare.
	(_bfd_target_vector): List bfd_elf32_m32c_vec.

binutils/ChangeLog:
2005-07-14  Jim Blandy  <jimb@redhat.com>

	* readelf.c: #include "elf/m32c.h"
	(guess_is_rela, dump_relocations, get_machine_name): Add cases for
	EM_M32C.
	* Makefile.am (readelf.o): Update dependencies.
	* Makefile.in: Regenerated.

cpu/ChangeLog:
2005-07-14  Jim Blandy  <jimb@redhat.com>

	* m32c.cpu, m32c.opc: Machine description for the Renesas M32C.

gas/ChangeLog:
2005-07-14  Jim Blandy  <jimb@redhat.com>

	Add support for the Renesas M32C.
	* Makefile.am (CPU_TYPES): List m32c.
	(TARGET_CPU_CFILES): List config/tc-m32c.c.
	(TARGET_CPU_HFILES): List config/tc-m32c.h.
	* configure.in: Add case for m32c.
	* configure.tgt: Add cases for m32c and m32c-*-elf.
	* configure: Regenerated.
	* config/tc-m32c.c, config/tc-m32c.h: New files.
	* doc/Makefile.am (CPU_DOCS): Add c-m32c.texi.
	* doc/Makefile.in: Regenerated.
	* doc/all.texi: Set M32C.
	* doc/as.texinfo: Add text for the M32C-specific options and line
	comment characters, and refer to c-m32c.texi.
	* doc/c-m32c.texi: New file.

include/ChangeLog:
2005-07-14  Jim Blandy  <jimb@redhat.com>

	* dis-asm.h (print_insn_m32c): New declaration.

include/elf/ChangeLog:
2005-07-14  Jim Blandy  <jimb@redhat.com>

	Add support for Renesas M32C and M16C.
	* common.h (EM_M32C): New machine number.
	* m32c.h: New file.

ld/ChangeLog:
2005-07-14  Jim Blandy  <jimb@redhat.com>

	Add support for the Renesas M32C and M16C.
	* Makefile.am (ALL_EMULATIONS): Add eelf32m32c.o.
	(eelf32m32c.c): New target.
	* Makefile.in: Regenerated.
	* configure.tgt: Add case for m32c-*-elf.
	* emulparams/elf32m32c.sh: New file.

opcodes/ChangeLog:
2005-07-14  Jim Blandy  <jimb@redhat.com>

	Add support for the Renesas M32C and M16C.
	* m32c-asm.c, m32c-desc.c, m32c-dis.c, m32c-ibld.c, m32c-opc.c: New.
	* m32c-desc.h, m32c-opc.h: New.
	* Makefile.am (HFILES): List m32c-desc.h and m32c-opc.h.
	(CFILES): List m32c-asm.c, m32c-desc.c, m32c-dis.c, m32c-ibld.c,
	m32c-opc.c.
	(ALL_MACHINES): List m32c-asm.lo, m32c-desc.lo, m32c-dis.lo,
	m32c-ibld.lo, m32c-opc.lo.
	(CLEANFILES): List stamp-m32c.
	(M32C_DEPS): List stamp-m32c, if CGEN_MAINT.
	(CGEN_CPUS): Add m32c.
	(m32c-asm.c, m32c-desc.c, m32c-dis.c, m32c-ibld.c, m32c-opc.c)
	(m32c-desc.h, m32c-opc.h): Depend on M32C_DEPS.
	(m32c_opc_h): New variable.
	(stamp-m32c, m32c-asm.lo, m32c-desc.lo, m32c-dis.lo, m32c-ibld.lo)
	(m32c-opc.lo): New rules.
	* Makefile.in: Regenerated.
	* configure.in: Add case for bfd_m32c_arch.
	* configure: Regenerated.
	* disassemble.c (ARCH_m32c): New.
	[ARCH_m32c]: #include "m32c-desc.h".
	(disassembler) [ARCH_m32c]: Add case for bfd_arch_m32c.
	(disassemble_init_for_target) [ARCH_m32c]: Same.

	* cgen-ops.h, cgen-types.h: New files.
	* Makefile.am (HFILES): List them.
	* Makefile.in: Regenerated.
2005-07-14 22:52:28 +00:00