Commit Graph

6034 Commits

Author SHA1 Message Date
Alan Modra 1d2b8df224 Regenerate 2012-02-14 01:25:47 +00:00
Alan Modra 516e75beac * gas/elf/bad-group.s: Add section attributes.
* gas/elf/elf.exp (groupautoa, groupautob): Don't run for hppa64-hpux.
	(ifunc-1, type): Don't run for hpux.
	* gas/elf/type-noifunc.e: Accept ANSI_COM.
	* gas/elf/section7.s: Always have whitespace before directives.
	* gas/elf/warn-2.s: Likewise.
	* gas/i386/ifunc-3.s: Move .size directive.
2012-02-14 01:01:30 +00:00
Alan Modra cec7aa6aca revert premature delta 2012-02-13 04:10:56 +00:00
Alan Modra 017761eafe * gas/all/gas.exp (redef2): xfail m6811 and m6812.
* gas/elf/elf.exp: Use is_elf_format.
	* gas/symver/symver.exp: Likewise.
	* gas/m68hc11/m68hc11.exp: Simplify target test.
	Add -m68hc11 to error tests that pass for hc12.
2012-02-13 02:31:18 +00:00
Iain Sandoe 8e43fc024d gas:
* config/obj-macho.c (obj_mach_o_indirect_symbol): Force promotion of
	any local symbol used as an indirect.
2012-02-12 15:47:17 +00:00
Kai Tietz fd08dafa65 * gas/i386/disp32.d: Adjust lable-pattern. 2012-02-11 15:12:56 +00:00
Iain Sandoe fb4914b0e6 gas:
* config/obj-macho.c (obj_mach_o_make_or_get_sect): Always fill in
	stub size when provided.  (obj_mach_o_section): Flag that stub-size
	has been provided.
2012-02-10 13:12:55 +00:00
Kai Tietz 97298d2971 * gas/i386/x86-64-disp32.d: Fix lable-pattern. 2012-02-08 18:46:11 +00:00
H.J. Lu 42164a7195 Implement Intel Transactional Synchronization Extensions
gas/

2012-02-08  H.J. Lu  <hongjiu.lu@intel.com>

	* config/tc-i386.c (HLE_PREFIX): New.
	(check_hle): Likewise.
	(_i386_insn): Add have_hle.
	(cpu_arch): Add .hle and .rtm.
	(md_assemble): Call check_hle if i.have_hle isn't zero.
	(parse_insn): Set i.have_hle to 1 for HLE prefix.
	(output_jump): Support up to 2 byte opcode.

	* doc/c-i386.texi: Document hle/.hle and rtm/.rtm.

gas/testsuite/

2012-02-08  H.J. Lu  <hongjiu.lu@intel.com>

	* gas/i386/hle-intel.d: New.
	* gas/i386/hle.d: Likewise.
	* gas/i386/hle.s: Likewise.
	* gas/i386/hlebad.l: Likewise.
	* gas/i386/hlebad.s: Likewise.
	* gas/i386/rtm-intel.d: Likewise.
	* gas/i386/rtm.d: Likewise.
	* gas/i386/rtm.s: Likewise.
	* gas/i386/x86-64-hle-intel.d: Likewise.
	* gas/i386/x86-64-hle.d: Likewise.
	* gas/i386/x86-64-hle.s: Likewise.
	* gas/i386/x86-64-hlebad.l: Likewise.
	* gas/i386/x86-64-hlebad.s: Likewise.
	* gas/i386/x86-64-rtm-intel.d: Likewise.
	* gas/i386/x86-64-rtm.d: Likewise.
	* gas/i386/x86-64-rtm.s: Likewise.

	* gas/i386/i386.exp: Run hle, hle-intel, hlebad x86-64-hle, rtm,
	rtm-intel, x86-64-hle-intel, x86-64-hlebad, x86-64-rtm and
	x86-64-rtm-intel.

include/opcode/

2012-02-08  H.J. Lu  <hongjiu.lu@intel.com>

	* i386.h (XACQUIRE_PREFIX_OPCODE): New.
	(XRELEASE_PREFIX_OPCODE): Likewise.

opcodes/

2012-02-08  H.J. Lu  <hongjiu.lu@intel.com>

	* i386-dis.c (HLE_Fixup1): New.
	(HLE_Fixup2): Likewise.
	(HLE_Fixup3): Likewise.
	(Ebh1): Likewise.
	(Evh1): Likewise.
	(Ebh2): Likewise.
	(Evh2): Likewise.
	(Ebh3): Likewise.
	(Evh3): Likewise.
	(MOD_C6_REG_7): Likewise.
	(MOD_C7_REG_7): Likewise.
	(RM_C6_REG_7): Likewise.
	(RM_C7_REG_7): Likewise.
	(XACQUIRE_PREFIX): Likewise.
	(XRELEASE_PREFIX): Likewise.
	(dis386): Use Ebh1/Evh1 on add, adc, and, btc, btr, bts,
	cmpxchg, dec, inc, neg, not, or, sbb, sub, xor and xadd. Use
	Ebh2/Evh2 on xchg.  Use Ebh3/Evh3 on mov.
	(reg_table): Use Ebh1/Evh1 on add, adc, and, dec, inc, neg,
	not, or, sbb, sub and xor.  Use Ebh3/Evh3 on mov.  Use
	MOD_C6_REG_7 and MOD_C7_REG_7.
	(mod_table): Add MOD_C6_REG_7 and MOD_C7_REG_7.
	(rm_table): Add RM_C6_REG_7 and RM_C7_REG_7.  Add xend and
	xtest.
	(prefix_name): Handle XACQUIRE_PREFIX and XRELEASE_PREFIX.
	(CMPXCHG8B_Fixup): Handle HLE prefix on cmpxchg8b.

	* i386-gen.c (cpu_flag_init): Add CPU_HLE_FLAGS and
	CPU_RTM_FLAGS.
	(cpu_flags): Add CpuHLE and CpuRTM.
	(opcode_modifiers): Add HLEPrefixOk.

	* i386-opc.h (CpuHLE): New.
	(CpuRTM): Likewise.
	(HLEPrefixOk): Likewise.
	(i386_cpu_flags): Add cpuhle and cpurtm.
	(i386_opcode_modifier): Add hleprefixok.

	* i386-opc.tbl: Add HLEPrefixOk=3 to mov.  Add HLEPrefixOk to
	add, adc, and, btc, btr, bts, cmpxchg, dec, inc, neg, not, or,
	sbb, sub, xor and xadd.  Add HLEPrefixOk=2 to xchg with memory
	operand.  Add xacquire, xrelease, xabort, xbegin, xend and
	xtest.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.
2012-02-08 18:20:41 +00:00
Tristan Gingold facf03f2c3 bfd/
2012-02-02  Tristan Gingold  <gingold@adacore.com>

	* mach-o.c (bfd_mach_o_read_header): Silent uninitialized
	variable warning.

gas/
2012-02-02  Tristan Gingold  <gingold@adacore.com>

	* config/obj-macho.c (obj_mach_o_zerofill): Silent
	uninitialized variable warning.
2012-02-02 11:55:43 +00:00
Nick Clifton f6616a063c PR gas/13224
* config/obj-elf.c (obj_elf_parse_section_letters): Rename 'clone'
	to 'is_clone' to avoid shadowing a gloabl.
	(obj_elf_section): Likewise.
2012-02-02 09:26:04 +00:00
Paul Brook bac0326303 2012-01-31 Paul Brook <paul@codesourcery.com>
gas/
	* doc/c-tic6x.c: Fix typo.
2012-01-31 15:01:56 +00:00
Nick Clifton f8819316e7 PR gas/13624
* app.c (app_push): Set 'add_newlines' to zero after saving.
2012-01-26 14:56:49 +00:00
DJ Delorie 21abe33a9b * rl78-decode.opc (rl78_decode_opcode): Add NOT1.
* rl78-decode.c: Regenerate.

* config/rl78-parse.y (NOT1): Add.
2012-01-25 01:40:11 +00:00
Roland McGrath 8d63c93e6d * configure.tgt (i386-*-nacl*): Match it.
* config/te-nacl.h: New file.
* config/tc-i386.h [TE_NACL] (ELF_TARGET_FORMAT): Define for this case.
* config/tc-i386.c [TE_NACL] (i386_comment_chars, PREFIX_SEPARATOR):
Use TE_GNU et al case for TE_NACL too.
2012-01-23 21:42:04 +00:00
H.J. Lu a501d77eeb Add .d8 suffix support to x86 assembler
gas/

2012-01-20  H.J. Lu  <hongjiu.lu@intel.com>

	* config/tc-i386.c (_i386_insn): Replace disp32_encoding with
	disp_encoding.
	(md_assemble): Updated.
	(output_branch): Likewise.
	(parse_insn): Support .d8 suffix.
	(build_modrm_byte): Fake zero displacement for .d8 and .d32
	suffixes.

	* doc/c-i386.texi: Document .d8 suffix.

gas/testsuite/

2012-01-20  H.J. Lu  <hongjiu.lu@intel.com>

	* gas/i386/disp32.s: Add tests for .d8 suffix.
	* gas/i386/x86-64-disp32.s: Likewise.

	* gas/i386/disp32.d: Updated.
	* gas/i386/x86-64-disp32.d: Likewise.
2012-01-20 20:53:50 +00:00
Alan Modra 032fbb7a3a * write.c (fix_new_internal): Don't mark used parameter as unused. 2012-01-17 00:20:30 +00:00
Alan Modra 576477a6ee Update copyright message year. 2012-01-17 00:07:04 +00:00
Andreas Schwab e143d25c73 * gas/testsuite/gas/m68k/pmove.s, gas/testsuite/gas/m68k/pmove.d: New test.
* gas/testsuite/gas/m68k/all.exp: Run it.

* opcodes/m68k-opc.c (m68k_opcodes): Fix entries for pmove with BADx/BACx
register and move them after pmove with PSR/PCSR register.
2012-01-16 23:19:20 +00:00
H.J. Lu 8729a6f6a5 Add vmfunc
gas/

2012-01-13  H.J. Lu  <hongjiu.lu@intel.com>

	* config/tc-i386.c (cpu_arch): Add ".vmfunc".

	* doc/c-i386.texi: Document vmfunc.

gas/testsuite/

2012-01-13  H.J. Lu  <hongjiu.lu@intel.com>

	* gas/i386/i386.exp: Run vmfunc and x86-64-vmfunc.

	* gas/i386/vmfunc.d: New.
	* gas/i386/vmfunc.s: Likewise.
	* gas/i386/x86-64-vmfunc.d: Likewise.

opcodes/

2012-01-13  H.J. Lu  <hongjiu.lu@intel.com>

	* i386-dis.c (mod_table): Add vmfunc.

	* i386-gen.c (cpu_flag_init): Add CPU_VMFUNC_FLAGS.
	(cpu_flags): CpuVMFUNC.

	* i386-opc.h (CpuVMFUNC): New.
	(i386_cpu_flags): Add cpuvmfunc.

	* i386-opc.tbl: Add vmfunc.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.
2012-01-13 22:19:32 +00:00
Iain Sandoe 34dd18bca5 reverse the order of relocs in mach-o gas output.
gas:

	* config/obj-macho.c (obj_mach_o_reorder_section_relocs): New.
	* config/obj-macho.h (SET_SECTION_RELOCS): Define.
	(obj_mach_o_reorder_section_relocs): Declare.

gas/testsuite:

	* gas/all/redef2.d: Skip for Darwin.
	* gas/all/redef3.d: Likewise.
	* gas/all/weakref1.d: Likewise.
	* gas/macros/irp.d: Likewise.
	* gas/macros/repeat.d: Likewise.
	* gas/macros/rept.d: Likewise.
	* gas/macros/test2.d: Likewise.
	* gas/macros/vararg.d: Likewise.
	* gas/mach-o/macro-irp.d: New.
	* gas/mach-o/macro-repeat.d: New.
	* gas/mach-o/macro-rept.d: New.
	* gas/mach-o/macro-test2.d: New.
	* gas/mach-o/macro-vararg.d: New.
	* gas/mach-o/redef2.d: New.
	* gas/mach-o/redef3.d: New.
2012-01-13 15:19:13 +00:00
Iain Sandoe 687be931eb handle absolute indirect syms in mach-o
bfd:

	* mach-o.c (bfd_mach_o_build_dysymtab_command): Handle absolute
	indirect symbols.
gas:

	* config/obj-macho.c (obj_mach_o_set_indirect_symbols): Handle
	absolute indirect symbols.

gas/testsuite:

	* gas/mach-o/dysymtab-3.d: New.
	* gas/mach-o/symbols-7.s: New.
2012-01-13 12:59:30 +00:00
Iain Sandoe c3402d2056 set vma on mach-o sections.
gas:

	* config/obj-macho.c (obj_mach_o_set_vma_data): New type.
	(obj_mach_o_set_section_vma): New.
	(obj_mach_o_post_relax_hook): New.
	* config/obj-macho.h (md_post_relax_hook): Define.
	(obj_mach_o_post_relax_hook): Declare.

gas/testsuite:

	* gas/mach-o/dysymtab-2.d: Update to include the set VMA.
	* gas/mach-o/symbols-1-64.d: Likewise.
	* gas/mach-o/symbols-1.d: Likewise.
	* gas/mach-o/symbols-6.d: Likewise.
	* gas/mach-o/zerofill-1.d: Likewise.
	* gas/mach-o/zerofill-2.d: Likewise.
2012-01-13 11:55:02 +00:00
Iain Sandoe 50d10658ee add indirect_symbol to mach-o port.
bfd:

	* mach-o.c (bfd_mach_o_count_indirect_symbols): New.
	(bfd_mach_o_build_dysymtab_command): Populate indirect symbol table.
	* mach-o.h (bfd_mach_o_asymbol): Move declaration to start of the
	file. (bfd_mach_o_section): Add indirect_syms field.

gas:

	* config/obj-macho.c (obj_mach_o_set_symbol_qualifier): Switch off
	lazy when the symbol is private_extern.
	(obj_mach_o_indirect_sym): New type.
	(obj_mach_o_indirect_symbol): New.
	(mach_o_pseudo_table): Use obj_mach_o_indirect_symbol.
	(obj_macho_frob_label): Adjust to avoid adding bsyms for locals.
	(obj_macho_frob_label): Likewise.  Adjust external and comm
	symbol tests.
	(obj_mach_o_set_indirect_symbols): New.
	(obj_mach_o_frob_file_after_relocs): New.
	*config/obj-macho.h (obj_frob_file_after_relocs): Define.
	(obj_mach_o_frob_file_after_relocs): Declare.

include/mach-o:

	* loader.h (BFD_MACH_O_INDIRECT_SYM_LOCAL): New.
	(BFD_MACH_O_INDIRECT_SYM_ABS): New

gas/testsuite:

	* gas/mach-o/dysymtab-2.d: New.
	* gas/mach-o/err-syms-4.s: New.
	* gas/mach-o/err-syms-5.s: New.
	* gas/mach-o/err-syms-6.s: New.
	* gas/mach-o/symbols-6-64.d: New.
	* gas/mach-o/symbols-6-64.s: New.
	* gas/mach-o/symbols-6.d: New.
	* gas/mach-o/symbols-6.s: New.
2012-01-12 14:03:12 +00:00
Tristan Gingold 0a4734dc09 2012-01-12 Tristan Gingold <gingold@adacore.com>
PR gas/13591
	* config/obj-coff.h (sy_obj): Rename macro to avoid a name conflict.
2012-01-12 08:53:34 +00:00
Tristan Gingold 158184ac9e 2012-01-10 Tristan Gingold <gingold@adacore.com>
* struc-symbol.h (struct symbol_flags): New struct, created from...
	(struct symbol): ... this one.  Add sy_flags field, remove flag fields.
	(struct local_symbol): Replace lsy_marker field by lsy_flags.
	Adjust comment.
	(local_symbol_resolved_p): Adjust.
	(local_symbol_mark_resolved): Likewise.
	* symbols.c (LOCAL_SYMBOL_CHECK): Adjust.
	(local_symbol_make, local_symbol_convert, colon)
	(symbol_clone_if_forward_ref, verify_symbol_chain)
	(resolve_symbol_value, snapshot_symbol, S_GET_VALUE)
	(S_IS_WEAKREFR, S_IS_WEAKREFD, S_IS_VOLATILE, S_IS_FORWARD_REF)
	(S_SET_WEAKREFR, S_CLEAR_WEAKREFR, S_SET_WEAKREFD)
	(S_CLEAR_WEAKREFD, S_SET_VOLATILE, S_CLEAR_VOLATILE)
	(S_SET_FORWARD_REF, symbol_same_p, symbol_mark_used)
	(symbol_clear_used, symbol_used_p, symbol_mark_used_in_reloc)
	(symbol_clear_used_in_reloc, symbol_used_in_reloc_p)
	(symbol_mark_mri_common, symbol_clear_mri_common)
	(symbol_mri_common_p, symbol_mark_written, symbol_clear_written)
	(symbol_written_p, symbol_mark_resolved, symbol_resolved_p)
	(symbol_equated_reloc_p, dot_symbol_init)
	(print_symbol_value_1): Adjust.
2012-01-10 11:48:26 +00:00
Iain Sandoe b22161d698 add symbol qualifiers for mach-o to bfd/gas
bfd:

	* mach-o.c (bfd_mach_o_bfd_copy_private_symbol_data): Implement.
	(bfd_mach_o_write_symtab): Remove handling for indirect syms.
	(bfd_mach_o_primary_symbol_sort_key): Likewise.
	(bfd_mach_o_cf_symbols): Likewise.
	(bfd_mach_o_sort_symbol_table): Remove.
	(bfd_mach_o_mangle_symbols): Adjust arguments, remove handling
	for indirect and dysymtab counts.  Do the symbol sorting here.
	(bfd_mach_o_build_dysymtab_command): Count the symbol types here.
	Make the indirect symbols a TODO.
	(bfd_mach_o_build_commands): Adjust call to bfd_mach_o_mangle_symbols.
	(bfd_mach_o_make_empty_symbol): Specifically flag unset symbols with
	a non-zero value.
	(bfd_mach_o_read_symtab_symbol): Record the symbol index.
	(bfd_mach_o_read_symtab_symbol): Adjust recording of global status.
	* mach-o.h (mach_o_data_struct): Remove indirect and dysymtab entries.
	(IS_MACHO_INDIRECT): Remove.
	(SYM_MACHO_FIELDS_UNSET, SYM_MACHO_FIELDS_NOT_VALIDATED): New.

gas:

	* config/obj-macho.c (obj_mach_o_weak): Remove.
	(obj_mach_o_common_parse): Set symbol qualifiers.
	(LAZY, REFE): New macros.
	(obj_mach_o_symbol_type): New enum.
	(obj_mach_o_set_symbol_qualifier): New.
	(obj_mach_o_sym_qual): New.
	(mach_o_pseudo_table): Add symbol qualifiers, set indirect_symbol to
	a dummy function.
	(obj_mach_o_type_for_symbol): New.
	(obj_macho_frob_label): New.
	(obj_macho_frob_symbol): New.
	* config/obj-macho.h (S_SET_ALIGN): Amend temorary var name.
	(obj_frob_label, obj_macho_frob_label): Declare.
	(obj_frob_symbol, obj_macho_frob_symbol): Declare.

gas/testsuite:

	* gas/mach-o/err-syms-1.s: New.
	* gas/mach-o/err-syms-2.s: New.
	* gas/mach-o/err-syms-3.s: New.
	* gas/mach-o/symbols-2.d: New.
	* gas/mach-o/symbols-2.s: New.
	* gas/mach-o/symbols-3.s: New.
	* gas/mach-o/symbols-4.s: New.
	* gas/mach-o/symbols-5.d: New.
	* gas/mach-o/symbols-5.s: New.
2012-01-09 10:47:50 +00:00
Richard Sandiford de64cffdf8 gas/
* config/tc-mips.c (s_tls_rel_directive): Call mips_clear_insn_labels.

gas/testsuite/
	* gas/mips/tls-relw.s, gas/mips/tls-relw.d: New test.
	* gas/mips/mips.exp: Run it.
2012-01-08 12:33:54 +00:00
Richard Sandiford 462427c418 gas/
2011-01-08  Andrew Pinski  <andrew.pinski@caviumnetworks.com>
	    Richard Sandiford  <rdsandiford@googlemail.com>

	* config/tc-mips.c (mips_move_labels): Take the list of labels and
	textness as parameters.
	(mips_move_text_labels): New function.
	(append_insn): Use it instead of mips_move_labels.
	(mips_emit_delays, start_noreorder): Likewise.
	(mips_align): Take the labels rather than just one label.
	Move all labels to after the .align.
	(s_align): Change the last argument to mips_align.
	(s_cons): Likewise.
	(s_float_cons): Likewise.
	(s_gpword): Likewise.
	(s_gpdword): Likewise.

gas/testsuite/
	* gas/mips/align3.s, gas/mips/align3.d: New testcase.
	* gas/mips/mips.exp: Run it.
2012-01-08 12:11:42 +00:00
Tristan Gingold d382c57985 2012-01-06 Tristan Gingold <gingold@adacore.com>
* config/tc-i386.c: Update copyright year.
	(lex_got): Also defined for Mach-O.
	Add a guard for non-ELF configuration.
	(md_longopts): Also handle -64 for Mach-O.
	(md_parse_option): Likewise.
	(i386_target_format): Adjust for x86_64-darwin.
2012-01-06 16:23:39 +00:00
Nick Clifton 23e1d3291c Rotate ChangeLogs 2012-01-05 10:09:39 +00:00
Iain Sandoe 8b282ca52a gas/testsuite:
* gas/mach-o/zerofill-2.d: New.
2012-01-04 11:25:11 +00:00
Iain Sandoe 8cf6e08400 add .zerofill to mach-o GAS.
gas:

	* config/obj-macho.c (obj_mach_o_segT_from_bfd_name): Tidy definition.
	(obj_mach_o_get_section_names): New (split from obj_mach_o_section).
	(obj_mach_o_make_or_get_sect): Likewise.
	(obj_mach_o_section): Split out the functionality shared with zerofill.
	(obj_mach_o_zerofill): New.
	(obj_mach_o_common_parse): Ensure whitespace is skipped.
	(mach_o_pseudo_table): Add .zerofill.

gas/testsuite:

	* gas/mach-o/zerofill-1.d: New.
	* gas/mach-o/zerofill-1.s: New.
2012-01-04 10:59:54 +00:00
Iain Sandoe 68588f9540 support stabs on mach-o GAS.
bfd:

	* mach-o.c (bfd_mach_o_mangle_symbols): Put in the section index
	for stabd symbols.
	(bfd_mach_o_primary_symbol_sort_key): Adjust for stabs.
	(bfd_mach_o_cf_symbols): Likewise.

gas:

	* config/obj-macho.c (obj_macho_process_stab): New.
	* config/obj-macho.h (OBJ_PROCESS_STAB): Define.
	(obj_macho_process_stab): Declare.
2012-01-03 13:18:48 +00:00
Iain Sandoe 7f3072381b add dysymtab write support to bfd/mach-o.
bfd:

	* mach-o.c (bfd_mach_o_write_symtab): Fill in the string table index
	as the value of an indirect symbol.  Keep the string table index in
	non-indirect syms for reference.
	(bfd_mach_o_write_dysymtab): New.
	(bfd_mach_o_primary_symbol_sort_key): New.
	(bfd_mach_o_cf_symbols): New.
	(bfd_mach_o_sort_symbol_table): New.
	(bfd_mach_o_mangle_symbols): Return early if no symbols.  Sort symbols.
	If we are emitting a dysymtab, process indirect symbols and count the
	number of each other kind.
	(bfd_mach_o_mangle_sections): New.
	(bfd_mach_o_write_contents): Split out some pre-requisite code into
	the command builder. Write dysymtab if the command is present.
	(bfd_mach_o_count_sections_for_seg): New.
	(bfd_mach_o_build_seg_command): New.
	(bfd_mach_o_build_dysymtab_command): New.
	(bfd_mach_o_build_commands): Reorganize to support the fact that some
	commands are optional and should not be emitted if there are no
	sections or symbols.
	(bfd_mach_o_set_section_contents): Amend comment.
	* mach-o.h: Amend and add to comments.
	(mach_o_data_struct): Add fields for dysymtab symbols counts and a
	pointer to the indirects, when present.
	(bfd_mach_o_should_emit_dysymtab): New macro.
	(IS_MACHO_INDIRECT): Likewise.

gas/testsuite:

	* gas/mach-o/dysymtab-1-64.d: New.
	* gas/mach-o/dysymtab-1.d: New.
	* gas/mach-o/symbols-1-64.d: New.
	* gas/mach-o/symbols-1.d: New.
	* gas/mach-o/symbols-base-64.s: New.
	* gas/mach-o/symbols-base.s: New.
2012-01-03 10:54:01 +00:00
Iain Sandoe bcf0aac6f6 adjust mach-o default GAS sections.
gas:

	* as.c (perform_an_assembly_pass): Do not create text, data and bss
	sections for MACH-O.  Do not switch to the text section.
	* config/obj-macho.c (obj_mach_o_segT_from_bfd_name): Forward decl.
	(mach_o_begin): Startup with only text section unless suppressed.
	* config/obj-macho.h (obj_begin): define to mach_o_begin ().

gas/testsuite:

	* gas/mach-o/sections-1.d: Amend to recognize that bss is not emitted
	by default.
	* gas/mach-o/sections-2.d: New.
2011-12-29 10:53:10 +00:00
DJ Delorie 9cea966c22 [bfd]
* elf32-rl78.c (rl78_elf_howto_table): Add R_RL78_RH_RELAX.
	(rl78_reloc_map): Add BFD_RELOC_RL78_RELAX.
	(rl78_elf_relocate_section): Add R_RL78_RH_RELAX, R_RL78_RH_SFR,
	and R_RL78_RH_SADDR.
	(rl78_elf_finish_dynamic_sections): Only validate PLT section if
	we didn't relax anything, as relaxing might remove a PLT reference
	after we've set up the table.
	(elf32_rl78_relax_delete_bytes): New.
	(reloc_bubblesort): New.
	(rl78_offset_for_reloc): New.
	(relax_addr16): New.
	(rl78_elf_relax_section): Add support for relaxing long
	instructions into short ones.

[gas]
	* config/rl78-defs.h (rl78_linkrelax_addr16): Add.
	(rl78_linkrelax_dsp, rl78_linkrelax_imm): Remove.
	* config/rl78-parse.y: Tag all addr16 and branch patterns with
	relaxation markers.
	* config/tc-rl78.c (rl78_linkrelax_addr16): New.
	(rl78_linkrelax_branch): New.
	(OPTION_RELAX): New.
	(md_longopts): Add relax option.
	(md_parse_option): Add OPTION_RELAX.
	(rl78_frag_init): Support relaxation.
	(rl78_handle_align): New.
	(md_assemble): Support relaxation.
	(md_apply_fix): Likewise.
	(md_convert_frag): Likewise.
	* config/tc-rl78.h (MAX_MEM_FOR_RS_ALIGN_CODE): New.
	(HANDLE_ALIGN): New.
	(rl78_handle_align): Declare.

	* config/rl78-parse.y (rl78_bit_insn): New.  Set it for all bit
	insn patterns.
	(find_bit_index): New.  Strip .BIT suffix off relevent
	expressions for bit insns.
	(rl78_lex): Exclude bit suffixes from expression parsing.

[include/elf]
	* rl78.h (R_RL78_RH_RELAX, R_RL78_RH_SFR, R_RL78_RH_SADDR): New.
	(RL78_RELAXA_BRA, RL78_RELAXA_ADDR16: New.
2011-12-23 01:49:37 +00:00
Nick Clifton 74929e7bba PR gas/13449
* config/tc-arm.c (create_unwind_entry): Zero allocated table
	entries.
2011-12-21 17:07:26 +00:00
Iain Sandoe ab76eeafa5 bfd:
* mach-o-i386.c (bfd_mach_o_section_type_valid_for_tgt): Define NULL.
	* mach-o-target.c (bfd_mach_o_backend_data): Initialize bfd_mach_o_section_type_valid_for_tgt
	* mach-o-x86-64.c (bfd_mach_o_section_type_valid_for_x86_64): New.
	(bfd_mach_o_section_type_valid_for_tgt): Set to bfd_mach_o_section_type_valid_for_x86_64.
	* mach-o.c (bfd_mach_o_section_type_name): Reorder and eliminate dup.
	(bfd_mach_o_section_attribute_name): Reorder.
	(bfd_mach_o_get_section_type_from_name): If the target has defined a validator for section
	types, then use it.
	* mach-o.h (bfd_mach_o_get_section_type_from_name): Alter declaration to include the bfd.

gas:

	* config/obj-macho.c (obj_mach_o_section): Account for target-dependent section
	types.  Improve error handling when wrong section types/attributes are specified.

gas/testsuite:

	* gas/mach-o/err-sections-1.s: New.
	* gas/mach-o/err-sections-2.s: New.
	* gas/mach-o/sections-3.d: New.
	* gas/mach-o/sections-3.s: New.
2011-12-19 15:42:37 +00:00
Chung-Lin Tang d0f1368214 2011-12-19 Chung-Lin Tang <cltang@codesourcery.com>
gas/
	* config/tc-mips.c (mips_pseudo_table): Add tprelword/tpreldword
	entries.
	(mips16_percent_op): Add MIPS16 TLS relocation ops.
	(md_apply_fix): Add BFD_RELOC_MIPS16_TLS_* switch cases.
	(s_tls_rel_directive): Rename from s_dtprel_internal(). Abstract out
	directive string and reloc type as function parameters. Update
	comments.
	(s_dtprelword,s_dtpreldword): Change to use s_tls_rel_directive().
	(s_tprelword,s_tpreldword): New functions.

	include/
	* elf/mips.h (elf_mips_reloc_type): Add R_MIPS16_TLS_* entries.

	bfd/
	* reloc.c (BFD_RELOC_MIPS16_TLS_GD,BFD_RELOC_MIPS16_TLS_LDM,
	BFD_RELOC_MIPS16_TLS_DTPREL_HI16,BFD_RELOC_MIPS16_TLS_DTPREL_LO16,
	BFD_RELOC_MIPS16_TLS_GOTTPREL,BFD_RELOC_MIPS16_TLS_TPREL_HI16,
	BFD_RELOC_MIPS16_TLS_TPREL_LO16): New relocations for MIPS16 TLS.
	* bfd-in2.h (bfd_reloc_code_real): Regenerate.
	* libbfd.h (bfd_reloc_code_real_names): Regenerate.
	* elf32-mips.c (elf_mips16_howto_table_rel): Add R_MIPS16_TLS_*
	entries.
	(mips16_reloc_map): Add BFD_RELOC_MIPS16_TLS_* to R_MIPS16_TLS_*
	mappings.
	* elfn32-mips.c (elf_mips16_howto_table_rel,
	elf_mips16_howto_table_rela): Add R_MIPS16_TLS_* entries.
	(mips16_reloc_map): Add BFD_RELOC_MIPS16_TLS_* to R_MIPS16_TLS_*
	mappings.
	* elf64-mips.c (mips16_elf64_howto_table_rel,
	mips16_elf64_howto_table_rela): Add R_MIPS16_TLS_* entries.
	(mips16_reloc_map): Add BFD_RELOC_MIPS16_TLS_* to R_MIPS16_TLS_*
	mappings.
	* elfxx-mips.c (TLS_RELOC_P,mips16_reloc_p,
	_bfd_mips_elf_check_relocs): Add cases for R_MIPS16_TLS_* relocations.
	(tls_gd_reloc_p): Add R_MIPS16_TLS_GD case.
	(tls_ldm_reloc_p): Add R_MIPS16_TLS_LDM case.
	(tls_gottprel_reloc_p): Add R_MIPS16_TLS_GOTTPREL case.
	(mips_elf_calculate_relocation): Add cases for R_MIPS16_TLS_*,
	R_MIPS_TLS_DTPREL32/64, and R_MIPS_TLS_TPREL32/64 relocations.
2011-12-19 07:58:02 +00:00
Tristan Gingold 499963bcf1 2011-12-15 Tristan Gingold <gingold@adacore.com>
* config/obj-macho.c (obj_mach_o_fileprop): Fix typo.
2011-12-15 11:43:52 +00:00
Nick Clifton 83c257caea * readelf.c (get_symbol_type): Add ELFOSABI_FREEBSD to the
supported abi's.

	* config/obj-elf.c (obj_elf_type): Add ELFOSABI_FREEBSD to the
	supported abi's.
2011-12-15 11:37:03 +00:00
Tristan Gingold 0c9ef0f001 bfd/
2011-12-15  Iain Sandoe  <iains@gcc.gnu.org>

	* mach-o-target.c (bfd_mach_o_bfd_set_private_flags): Use
	bfd_mach_o_bfd_set_private_flags.
	* mach-o.c (bfd_mach_o_bfd_set_private_flags): New.
	* mach-o.h (bfd_mach_o_bfd_set_private_flags): Declare.

gas/
2011-12-15  Iain Sandoe  <iains@gcc.gnu.org>

	* config/obj-macho.c (obj_mach_o_subsections_by_symbols): New global.
	(obj_mach_o_file_properties): New enum.
	(obj_mach_o_subsections_via_symbols):  Generalize name to...
	... (obj_mach_o_fileprop) and use to set subsections_via_symbols.

gas/testsuite/
2011-12-15  Iain Sandoe  <iains@gcc.gnu.org>

	* gas/mach-o/subsect-via-symbols-0.d: New.
	* gas/mach-o/subsect-via-symbols-1.d: New.
	* gas/mach-o/subsect-via-symbols.s: New.
2011-12-15 10:56:48 +00:00
Nick Clifton 5011093dd0 * frv.opc (parse_uhi16): Fix handling of %hi operator on 64-bit
hosts.

	* cgen-asm.c (cgen_parse_signed_integer): Add code to handle the
	sign extension of negative values on a 64-bit host.
	* frv-asm.c: Regenerate.

	* gas/frv/immediates.s: New test file - checks assembly of
	constant values.
	* gas/frv/immediates.d: Expected disassmbly.
	* gas/frv/allinsn.exp: Run the new test.
2011-12-15 10:21:51 +00:00
Jie Zhang 370a075d48 gas/
2011-12-14  Stuart Henderson  <shenders@gcc.gnu.org>

	* config/bfin-parse.y (asm_1): set SRCx fields to all 1s for
	dspalu32 instrs that don't use them.

gas/testsuite/
2011-12-14  Stuart Henderson  <shenders@gcc.gnu.org>

	* gas/bfin/move.d: Update SRCx field expectations.
	* gas/bfin/move2.d: Likewise.
	* gas/bfin/parallel.d: Likewise.
	* gas/bfin/parallel2.d: Likewise.
	* gas/bfin/parallel3.d: Likewise.
	* gas/bfin/parallel4.d: Likewise.
	* gas/bfin/video.d: Likewise.
	* gas/bfin/video2.d: Likewise.
2011-12-15 04:25:10 +00:00
Tristan Gingold 9dadd4aee8 2011-12-14 Iain Sandoe <iains@gcc.gnu.org>
* gas/mach-o/comm-1.d: New.
	* gas/mach-o/comm-1.s: New.
	* gas/mach-o/lcomm-1.s: New.
	* gas/mach-o/mach-o.exp: Update to use run_dump_tests[].
	* gas/mach-o/sections-1.d: New.
	* gas/mach-o/sections-1.s: New.
	* gas/mach-o/warn-1.s: Add .comm alignment range warning.
2011-12-14 15:32:25 +00:00
Nick Clifton 66dbb2bbf4 * config/tc-cris.c (md_convert_frag): Mark the length_code local
variable as unused as it is only used when ENABLE_CHECKING is on.
2011-12-14 14:10:57 +00:00
Tristan Gingold f68e81fcd4 2011-12-14 Iain Sandoe <iains@gcc.gnu.org>
* gas/mach-o: New.
	* gas/mach-o/mach-o.exp: New.
	* gas/mach-o/warn-1.s: New.
	* gas/mach-o/lcomm-1.s: New.
	* gas/mach-o/lcomm-1.d: New.
2011-12-14 13:27:34 +00:00
Tristan Gingold a455111938 bfd/
2011-12-14  Iain Sandoe  <iains@gcc.gnu.org>

	* mach-o-i386.c (text_section_names_xlat): New table.
	(data_section_names_xlat): Likewise.
	(import_section_names_xlat): Likewise.
	(mach_o_i386_segsec_names_xlat): Likewise.
	(bfd_mach_o_tgt_seg_table): Use new tables.
	* mach-o-x86-64.c (bfd_mach_o_tgt_seg_table): Set NULL.
	* mach-o.c (mach_o_section_name_xlat, mach_o_segment_name_xlat):
	Move to mach-o.h as   typedefs.
	(text_section_names_xlat): Update for current GCC usage.
	(data_section_names_xlat): Likewise.
	(dwarf_section_names_xlat): Likewise.
	(objc_section_names_xlat): New table.
	(segsec_names_xlat): Add objc table.
	(bfd_mach_o_normalize_section_name):  Replace with...
	(bfd_mach_o_section_data_for_mach_sect): New.
	(bfd_mach_o_section_data_for_bfd_name): New.
	(bfd_mach_o_section_data_for_bfd_name): Update to use additional data.
	(bfd_mach_o_convert_section_name_to_mach_o): Likewise.
	(bfd_mach_o_bfd_copy_private_section_data): Implement.
	(bfd_mach_o_write_symtab): Write a zero-length string as the first entry
	for compatibility with system tools.
	(bfd_mach_o_build_commands): Update section alignment info.
	(bfd_mach_o_new_section_hook): Use translation table data to define
	default section flags, type, attributes and alignment, when available.
	(bfd_mach_o_init_section_from_mach_o): Add TODO comment.
	(bfd_mach_o_section_type_name): Add 'symbol_stubs'.
	(bfd_mach_o_section_attribute_name): Add 'self_modifying_code'.
	(bfd_mach_o_get_section_type_from_name): Change "not-found" return
	value.
	(bfd_mach_o_tgt_seg_table): Set default NULL.
	* mach-o.h (bfd_mach_o_segment_command):  Use define for name length.
	(bfd_mach_o_backend_data): Move until after contents are defined.
	(bfd_mach_o_normalize_section_name): Remove.
	(bfd_mach_o_convert_section_name_to_bfd): Declare.
	(mach_o_section_name_xlat): Declare.
	(mach_o_segment_name_xlat): Declare.
	(bfd_mach_o_section_data_for_mach_sect): Declare.
	(bfd_mach_o_section_data_for_bfd_name): Declare.

include/
2011-12-14  Iain Sandoe  <iains@gcc.gnu.org>

	* mach-o/loader.h (bfd_mach_o_section_type): define
	BFD_MACH_O_S_ATTR_NONE to 0.


gas/
2011-12-14  Iain Sandoe  <iains@gcc.gnu.org>

	* config/obj-macho.c: Add some more top-level comments.
	(collect_16char_name): New.
	(obj_mach_o_section): Amend to allow syntax compatible with existing system
	tools.  Use section translation data when available.
	(obj_mach_o_segT_from_bfd_name): New.
	(known_sections): Update.
	(obj_mach_o_known_section): Use obj_mach_o_segT_from_bfd_name.
	(objc_sections): New.
	(obj_mach_o_objc_section): New.
	(debug_sections): New.
	(obj_mach_o_debug_section): New.
	(tgt_sections): New.
	(obj_mach_o_opt_tgt_section): New.
	(obj_mach_o_base_section): New.
	(obj_mach_o_common_parse): Update to create BSS on demand and to handle
	lcomm optional alignment param.
	(obj_mach_o_comm): Update parameter name.
	(obj_mach_o_placeholder): New.
	(mach_o_pseudo_table): Update for GCC section directives.
	* config/obj-macho.h (_OBJ_MACH_O_H): New.
	(USE_ALIGN_PTWO): Define.
	(S_SET_ALIGN) Define.
2011-12-14 10:30:09 +00:00
Nick Clifton 621e3db6a5 * doc/internals.texi (TC_FORCE_RELOCATION_SUB_SAME): Update
to match code.
2011-12-13 12:56:33 +00:00