Commit Graph

326 Commits

Author SHA1 Message Date
Thiemo Seufer 0499d65b9b * mips.h: Assign 'm'/'M' codes to MIPS16e save/restore
instructions.  Define MIPS16_ALL_ARGS and MIPS16_ALL_STATICS for
        save/restore encoding of the args field.

        * mips16-opc.c: Add MIPS16e save/restore opcodes.
        * mips-dis.c (print_mips16_insn_arg): Handle printing of 'm'/'M'
        codes for save/restore.

        * config/tc-mips.c (mips16_ip): Add handling of 'm' and 'M' codes
        for the MIPS16e save/restore instructions.

        * gas/mips/mips.exp: Run new save/restore tests.
        * gas/testsuite/gas/mips/mips16e-save.s: New test for generating
        different styles of save/restore instructions.
        * gas/testsuite/gas/mips/mips16e-save.d: New.
2005-11-14 02:25:39 +00:00
Thiemo Seufer 44075ae21c * config/tc-mips.c (md_parse_option): Fix typo in comment. 2005-11-01 01:59:28 +00:00
David Ung 290248614c * config/tc-mips.c (append_insn): Convert MIPS16 jr/jalr jumps
into jrc/jalrc versions if ISA_MIPS32+ and not doing the swap,
hence avoiding to emit a nop.

* gas/mips/mips.exp: Run new test.
* gas/testsuite/gas/mips/mips16e-jrc.s: New test for converting
jalr/jr to the compact jalrc/jrc instructions.
* gas/testsuite/gas/mips/mips16e-jrc.d: New.
2005-10-19 18:47:09 +00:00
Nick Clifton 9497f5ac6b This adjusts equate handling by
- allowing true forward references (which will always assume the referenced
  symbols have at the point of use) through the new .eqv pseudo-op and the
  new == operator
- disallowing changing .equiv-generated equates (so that the protection this
  provides is both forward and backward)
- snapshotting equates when their value gets changed so that previous uses
  don't get affected by the new value.
- allowing expressions in places where absolute expressions (or register
  names) are needed which were not completely resolvable at the point of
  their definition but which are fully resolvable at the point of use

In addition it fixes PR/288.
2005-10-11 11:16:17 +00:00
Richard Henderson 07a53e5cdb * dwarf2dbg.c (struct line_entry): Replace frag and frag_ofs
with label.
        (dwarf2_loc_mark_labels): New.
        (dwarf2_gen_line_info_1): Split out of ...
        (dwarf2_gen_line_info): ... here.  Create the temp symbol here.
        (dwarf2_emit_label): New.
        (dwarf2_directive_loc_mark_labels): New.
        (out_set_addr): Take a symbol instead of frag+ofs.
        (relax_inc_line_addr): Likewise.
        (emit_inc_line_addr): Assert delta non-negative.
        (process_entries): Remove dead code.  Update to work with temp
        symbols instead of frag+ofs.
        * dwarf2dbg.h (dwarf2_directive_loc_mark_labels): Declare.
        (dwarf2_emit_label, dwarf2_loc_mark_labels): Declare.
        * config/obj-elf.c (elf_pseudo_tab): Add loc_mark_labels.
        * config/obj-elf.h (obj_frob_label): New.
        * config/tc-alpha.c (alpha_define_label): Call dwarf2_emit_label.
        * config/tc-arm.c, config/tc-hppa.c, config/tc-m68k.c,
        config/tc-mips.c, config/tc-ppc.c, config/tc-sh.c, config/tc-xtensa.c:
        Similarly in the respective tc_frob_label implementation functions.
        * config/tc-i386.c (md_pseudo_table): Move file and loc to
        non-elf section; add loc_mark_labels.
        * config/tc-ia64.c (struct label_fix): Add dw2_mark_labels.
        (ia64_flush_insns): Check for marked labels; emit line entry if so.
        (emit_one_bundle): Similarly.
        (ia64_frob_label): Record marked labels.
        * config/tc-m68hc11.h (tc_frob_label): Remove.
        * config/tc-ms1.c (md_pseudo_table): Remove file and loc.
        * config/tc-sh.h (tc_frob_label): Pass sym to sh_frob_label.
        * config/tc-sh64.h (tc_frob_label): Likewise.
        * doc/as.texinfo (LNS directives): Docuement .loc_mark_blocks.
2005-09-20 18:24:48 +00:00
David Ung b8ee1a6e86 * config/tc-mips.c (append_insn): Undo last change. Instead add
guard to suppress calling frag_grow if the current instruction is
one that allows a delay slot.
2005-09-07 11:39:17 +00:00
Chao-ying Fu ef2e4d86d6 * config/tc-mips.c (mips_set_options): Add ase_mt for MT instructions.
(mips_opts): Add -1 to initialize ase_mt.
(file_ase_mt): New variable for -mmt.
(CPU_HAS_MT): New define.
(validate_mips_insn): Add supports for +t, +T, !, $, *, &, g operand
formats.
(mips_ip): Check ase_mt to enable MT instructions.
Handle !, $, *, &, +T, +t, g operand formats.
For "mftc1", "mfthc1", "cftc1", "mttc1", "mtthc1", "cttc1", we allow
odd float registers.
(OPTION_MT, OPTION_NO_MT): New define.
(OPTION_COMPAT_ARCH_BASE): Change because of inserting MT define.
(md_parse_option): Parse OPTION_MT and OPTION_NO_MT.
(mips_after_parse_args): Set ase_mt based on CPU.
(s_mipsset): Handle ".set mt" and ".set nomt".
(mips_elf_final_processing): Remind of adding new flag for MT ASE.
(md_show_usage): Show usage of -mmt and -mno-mt.
* doc/as.texinfo: Document -mmt and -mno-mt options.
* doc/c-mips.texi: Likewise, and document ".set mt" and ".set nomt"
directives.
2005-09-06 18:53:03 +00:00
David Ung e9df6573ba * config/tc-mips.c (append_insn): Correctly handle mips16 case
when the frags are different for the 2 instructions we want to
swap.  If the lengths of the 2 instructions are not the same, we
won't do the swap but emit an nop.
2005-09-01 16:35:41 +00:00
Chao-ying Fu 74cd071d38 * config/tc-mips.c (mips_set_options): Add ase_dsp for DSP instructions.
(mips_opts): Add -1 to initialize ase_dsp.
(file_ase_dsp): New variable for -mdsp.
(CPU_HAS_DSP): New define.
(validate_mips_insn): Add supports for 3, 4, 5, 6, 7, 8, 9, 0, ', :, @
operand formats.
(mips_ip): Add min_range and max_range for checking singed numbers.
Check ase_dsp to enable DSP instructions.
Handle 3, 4, 5, 6, 7, 8, 9, 0, ', :, @ operand formats.
(OPTION_DSP, OPTION_NO_DSP): New define.
(OPTION_COMPAT_ARCH_BASE): Change because of inserting DSP define.
(md_parse_option): Parse OPTION_DSP and OPTION_NO_DSP.
(mips_after_parse_args): Set ase_dsp based on CPU.
(s_mipsset): Handle ".set dsp" and ".set nodsp".
(mips_elf_final_processing): Remind of adding new flag for DSP ASE.
(md_show_usage): Show usage of -mdsp and -mno-dsp.
2005-08-25 18:17:36 +00:00
David Ung ff32420076 * config/tc-mips.c (mips_cpu_info_table): Add 5kf to the table of
cpu names.
2005-08-23 11:32:42 +00:00
Thiemo Seufer 8a06b76942 * config/tc-mips.c (s_mips_globl): Allow multiple symbols per .globl. 2005-07-30 13:53:13 +00:00
Zack Weinberg 55cf6793d8 gas:
* cgen.c, cgen.h, tc.h, write.c, config/obj-coff.c
	* config/tc-a29k.c, config/tc-alpha.c, config/tc-alpha.h
	* config/tc-arc.c, config/tc-arc.h, config/tc-arm.c
	* config/tc-arm.h, config/tc-avr.c, config/tc-avr.h
	* config/tc-cris.c, config/tc-crx.c, config/tc-d10v.c
	* config/tc-d10v.h, config/tc-d30v.c, config/tc-d30v.h
	* config/tc-dlx.c, config/tc-dlx.h, config/tc-fr30.h
	* config/tc-frv.c, config/tc-frv.h, config/tc-h8300.c
	* config/tc-h8500.c, config/tc-hppa.c, config/tc-hppa.h
	* config/tc-i370.c, config/tc-i370.h, config/tc-i386.c
	* config/tc-i386.h, config/tc-i860.c, config/tc-i860.h
	* config/tc-i960.c, config/tc-i960.h, config/tc-ia64.c
	* config/tc-ip2k.c, config/tc-ip2k.h, config/tc-iq2000.c
	* config/tc-iq2000.h, config/tc-m32r.c, config/tc-m32r.h
	* config/tc-m68hc11.c, config/tc-m68hc11.h, config/tc-m68k.c
	* config/tc-m68k.h, config/tc-m88k.c, config/tc-maxq.c
	* config/tc-mcore.c, config/tc-mcore.h, config/tc-mips.c
	* config/tc-mips.h, config/tc-mmix.c, config/tc-mn10200.c
	* config/tc-mn10300.c, config/tc-msp430.c, config/tc-ns32k.c
	* config/tc-openrisc.h, config/tc-or32.c, config/tc-or32.h
	* config/tc-pdp11.c, config/tc-pj.c, config/tc-pj.h
	* config/tc-ppc.c, config/tc-ppc.h, config/tc-s390.c
	* config/tc-s390.h, config/tc-sh64.c, config/tc-sh.c
	* config/tc-sh.h, config/tc-sparc.c, config/tc-sparc.h
	* config/tc-tahoe.c, config/tc-tic30.c, config/tc-tic4x.c
	* config/tc-tic54x.c, config/tc-tic80.c, config/tc-v850.c
	* config/tc-v850.h, config/tc-vax.c, config/tc-vax.h
	* config/tc-w65.c, config/tc-xstormy16.c, config/tc-xstormy16.h
	* config/tc-xtensa.c, config/tc-z8k.c:
	Replace all instances of the string "_apply_fix3" with
	"_apply_fix".
	* po/POTFILES.in, po/gas.pot: Regenerate.
bfd:
	* coff-i386.c: Change md_apply_fix3 to md_apply_fix in comment.
cgen:
	* doc/porting.texi: Change all mention of md_apply_fix3 and
	gas_cgen_md_apply_fix3 to md_apply_fix and gas_cgen_md_apply_fix
	respectively.
2005-06-07 17:54:22 +00:00
Maciej W. Rozycki 32b26a03e4 * config/tc-mips.c (mips_cpu_info_table): Add cpu names m4k, 24k,
24kc, 24kf and 24kfx under MIPS32 release 2.
2005-06-07 12:09:26 +00:00
Maciej W. Rozycki 20e1fcfd31 gas/:
* config/tc-mips.c (load_register): Add leading "0x" to the
output of sprintf_vma().
(macro): Likewise.

gas/testsuite/:
* gas/mips/ldstla-32-1.l: Update to handle leading zeroes.
* gas/mips/ldstla-32-mips3-1.l: Likewise.
2005-06-01 19:23:58 +00:00
Nick Clifton 4b4da1607a Update the address and phone number of the FSF 2005-05-05 09:13:19 +00:00
Nick Clifton 55e08f71a9 (macro): Use sprintf_vma to convert a > 32 bit number into a readable string.
(load_register): Likewise.
2005-04-20 14:35:40 +00:00
Maciej W. Rozycki 9ee2a2d449 * config/tc-mips.c (normalize_constant_expr): Don't check for
HAVE_32BIT_GPRS.
(check_absolute_expr): Only call normalize_constant_expr() if
HAVE_32BIT_GPRS.
(mips_ip): Likewise.

* config/tc-mips.c (check_absolute_expr): Fix formatting.
2005-04-18 14:16:10 +00:00
Maciej W. Rozycki 9f872bbe2a * config/tc-mips.c (normalize_constant_expr): Fix formatting. 2005-04-15 19:16:44 +00:00
Maciej W. Rozycki 39a59cf89e * config/tc-mips.c (macro) [ldd_std]: Don't attempt the GP
optimization for constant addresses.
2005-04-14 15:32:58 +00:00
Maciej W. Rozycki 2051e8c45f gas/:
* config/tc-mips.c (IS_ZEXT_32BIT_NUM): New macro.
(normalize_address_expr): New function to sign-extend address
offsets that fit into 32 bits in 32-bit mode.
(macro_build_ldst_constoffset): Use normalize_address_expr()
instead of a handcoded sequence.
(load_register): Likewise.  Report oversized numbers in a useful
way.
(macro) [ld_st, ldd_std]: Reject all oversized offsets, not only
for constant addresses.  Report oversized numbers in a useful way.
(mips_ip): Use normalize_address_expr() for addresses.

gas/testsuite/:
* gas/mips/ldstla-32.s: Exclude offsets that are now meant to fail
and include more instructions/offsets that are meant to succeed.
Use $4 instead $3 to avoid register dependencies.
* gas/mips/ldstla-32.d: Update accordingly.
* gas/mips/ldstla-32-shared.d: Likewise.
* gas/mips/ldstla-32-mips3.d: New test based on the above, except
for mips3.
* gas/mips/ldstla-32-mips3-shared.d: Similarly, for PIC.
* gas/mips/ldstla-32-mips3.s: Source for the new tests.
* gas/mips/ldstla-32-1.s: New test for offsets that are meant to
fail.
* gas/mips/ldstla-32-mips3-1.s: Likewise, for mips3.
* gas/mips/ldstla-32-1.l: Stderr output for the new test.
* gas/mips/ldstla-32-mips3-1.l: Likewise.
* gas/mips/mips.exp: Run the new tests.
2005-04-13 18:17:10 +00:00
H.J. Lu b215186bfd 2005-04-10 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-mips.c (md_apply_fix3): Fix typos in BFD_RELOC_64.
2005-04-10 16:25:51 +00:00
Maciej W. Rozycki 704803a97e * config/tc-mips.c (mips_frob_file): Sort BFD_RELOC_MIPS16_LO16
relocations correctly as well.
(mips_fix_adjustable): Don't make BFD_RELOC_MIPS16_LO16
relocations in mergeable sections section-relative either.
2005-03-21 21:59:34 +00:00
Eric Christopher 5862107c33 ==> ChangeLog <==
2005-03-14  Eric Christopher  <echristo@redhat.com>

        * config/tc-mips.c: Include dw2gencfi.h.
        (mips_cfi_frame_initial_instructions): New.
        * config/tc-mips.h (TARGET_USE_CFIPOP): Define.
        (tc_cfi_frame_initial_instructions): Ditto.
        (DWARF2_DEFAULT_RETURN_COLUMN): Ditto.
        (DWARF2_CIE_DATA_ALIGNMENT): Ditto.
        * Makefile.am: Update dependencies.
        * Makefile.in: Regenerate.

==> testsuite/ChangeLog <==
2005-03-14  Eric Christopher  <echristo@redhat.com>

        * gas/cfi/cfi-mips-1.d, gas/cfi/cfi-mips-1.s: New dump test.
        * gas/cfi/cfi.exp: Run it.
        * gas/cfi/cfi-common-1.d: Update.
        * gas/cfi/cfi-common-2.d: Ditto.
        * gas/cfi/cfi-common-3.d: Ditto.
        * gas/cfi/cfi-common-4.d: Ditto.
2005-03-15 05:28:17 +00:00
Richard Sandiford 4184909a51 * config/tc-mips.c (s_cpsetup): Use '__gnu_local_gp' instead of '_gp'
for -mno-shared optimization.
2005-03-09 11:56:15 +00:00
Richard Sandiford 7d8e00cf78 * config/tc-mips.c (MAX_VR4130_NOPS, MAX_DELAY_NOPS): New macros.
(MAX_NOPS): Bump to 4.
	(mips_fix_vr4130): New variable.
	(nops_for_vr4130): New function.
	(nops_for_insn): Use MAX_DELAY_NOPS rather than MAX_NOPS.  Use
	nops_for_vr4130 if working around VR4130 errata.
	(OPTION_FIX_VR4130, OPTION_NO_FIX_VR4130): New macros.
	(md_longopts): Add -mfix-vr4130 and -mno-fix-vr4130.
	(md_parse_option): Handle them.
	(md_show_usage): Print them.
	* doc/c-mips.texi: Document -mfix-vr4130 and -mno-fix-vr4130.
2005-03-09 09:39:31 +00:00
Richard Sandiford dc36a61fc5 * config/tc-mips.c (append_insn): Remove cop_interlocks test from
branch delay code.
2005-03-09 09:35:00 +00:00
Richard Sandiford 7d10b47d34 * config/tc-mips.h (mips_flush_pending_output): Delete.
(mips_emit_delays): Declare.
	(md_flush_pending_output): Use mips_emit_delays.
	* config/tc-mips.c (mips_no_prev_insn): Remove parameter; always forget
	the previous instructions.
	(md_begin, append_insn, md_parse_option): Update callers.
	(mips_emit_delay): Remove parameter.  Move INSNS != 0 code to
	start_noreorder.
	(mips_align, s_change_sec, s_cons, s_float_cons, s_gpword)
	(s_gpdword): Update callers.
	(start_noreorder, end_noreorder): New functions.
	(macro, macro2, mips16_macro, s_mipsset): Use them instead of
	manipulating mips_opts or prev_nop_frag directly.
	(mips_flush_pending_output): Delete.
2005-03-09 09:22:25 +00:00
Richard Sandiford 404a80717c * config/tc-mips.c (mips_move_labels): New function, taken from...
(append_insn, mips_emit_delays): ...here.
2005-03-09 09:21:18 +00:00
Richard Sandiford 71400594f2 * config/tc-mips.c (MAX_NOPS): New macro.
(history): Resize to 1 + MAX_NOPS.
	(fix_vr4120_class): New enumeration.
	(vr4120_conflicts): New variable.
	(init_vr4120_conflicts): New function.
	(md_begin): Call it.
	(insn_uses_reg): Constify first argument.
	(classify_vr4120_insn, insns_between, nops_for_insn, nops_for_sequence)
	(nops_for_insn_or_target): New functions.
	(append_insn): Use the new nops_for_* functions instead of inline
	delay checks.  Generalize prev_nop_frag handling to handle an
	arbitrary history length.  Insert nops into the history buffer
	once the number of nops in prev_nop_frag is fixed.
	(emit_delays): Use nops_for_insn instead of inline delay checks.
2005-03-09 09:20:27 +00:00
Richard Sandiford 9b91f5445f * config/tc-mips.c (append_insn): Remove now-redundant nops != 0
check from branch delay code.  Remove unnecessary check for branches.
2005-03-09 09:17:41 +00:00
Richard Sandiford 1e91584932 * config/tc-mips.c (dummy_opcode): Delete.
(nop_insn, mips16_nop_insn): New variables.
	(NOP_INSN): New macro.
	(insn_length, create_insn, install_insn, move_insn, add_fixed_insn)
	(add_relaxed_insn, insert_into_history, emit_nop): New functions.
	(md_begin): Initialize nop_insn and mips16_nop_insn.
	(append_insn): Use the new emit_nop function to add nops, recording
	them in the history buffer.  Use add_fixed_insn or add_relaxed_insn
	to reserve room for the instruction and install_insn to install the
	final form.  Use insert_into_history to record the instruction in
	the history buffer.  Use move_insn to do delay slot filling.
	(mips_emit_delays): Use add_fixed_insn instead of the emit_nop macro.
	(macro_build, mips16_macro_build, macro_build_lui, mips_ip)
	(mips16_ip): Use create_insn to initialize mips_cl_insns.
2005-03-09 09:17:02 +00:00
Richard Sandiford bf12938eac * config/tc-mips.c (INSERT_BITS, EXTRACT_BITS, INSERT_OPERAND)
(EXTRACT_OPERAND, MIPS16_INSERT_OPERAND, MIPS16_EXTRACT_OPERAND): New.
	(insn_uses_reg, reg_needs_delay, append_insn, macro_build)
	(mips16_macro_build, macro_build_lui, mips16_macro, mips_ip)
	(mips16_ip): Use the new macros instead of explicit masks and shifts.
2005-03-09 09:15:35 +00:00
Richard Sandiford a38419a54c * config/tc-mips.c (mips_cl_insn): Replace the valid_p, delay_slot_p
and extended_p fields with a single fixed_p field.
	(append_insn, mips_no_prev_insn): Adjust accordingly.
2005-03-09 09:14:20 +00:00
Richard Sandiford 2fa1597374 * config/tc-mips.c (mips_cl_insn): Replace reloc_type array with
a single mips16_absolute_jump_p bit.
	(append_insn): Adjust accordingly.
2005-03-09 09:13:18 +00:00
Richard Sandiford 47e39b9d3f * config/tc-mips.h (mips_cl_insn): Move definition to...
* config/tc-mips.c (mips_cl_insn): ...here.  Add new fields:
	frag, where, fixp, reloc_type, valid_p, noreorder_p, delay_slot_p
	and extended_p.
	(history): New variable.
	(prev_insn, prev_prev_insn, prev_insn_valid, prev_insn_frag)
	(prev_insn_where, prev_insn_reloc_type, prev_insn_fixp)
	(prev_insn_is_delay_slot, prev_insn_unreordered, prev_insn_extended)
	(prev_prev_insn_unreordered): Delete.
	(reg_needs_delay, append_insn, mips_no_prev_insn, mips_emit_delays)
	(macro_start): Replace uses of prev_insn* with the equivalent history[]
	field.
2005-03-09 09:12:29 +00:00
Thiemo Seufer bbe506e8ba bfd/ChangeLog
* elfxx-mips.c (mips_elf_calculate_relocation): Handle special
	'__gnu_local_gp' symbol used by gas -mno-shared.

	gas/ChangeLog
	* config/tc-mips.c (macro_build_lui): Use '__gnu_local_gp'
	instead of '_gp' for -mno-shared optimization.
	(s_cpload): Ditto.
	(s_abicalls): Document it in the comment.
	(md_show_usage): Document the -mno-shared option.

	gas/testsuite/ChangeLog
	* gas/mips/elf-rel23b.d: Use '__gnu_local_gp' instead of '_gp'
	for -mno-shared optimization.
	* gas/mips/elf-rel25a.d: Ditto.

	ld/testsuite/ChangeLog
	* ld-mips-elf/multi-got-no-shared-1.s,
	ld-mips-elf/multi-got-no-shared-2.s,
	ld-mips-elf/multi-got-no-shared.d: New tests.
	* ld-mips-elf/mips-elf.exp: Run them.
2005-03-05 00:01:44 +00:00
Richard Sandiford aed1a26192 * config/tc-mips.c (mips_set_options): Add sym32 field.
(mips_opts): Initialize it.
	(HAVE_32BIT_ADDRESSES): Set to true if pointers are 32 bits wide.
	(HAVE_64BIT_ADDRESSES): Redefine as !HAVE_32BIT_ADDRESSES.
	(HAVE_32BIT_SYMBOLS, HAVE_64BIT_SYMBOLS): New macros.
	(load_address): Use HAVE_64BIT_SYMBOLS instead of HAVE_64BIT_ADDRESSES
	when deciding whether to use a symbolic %highest/%higher expansion.
	(macro): Likewise.  Remove o64/n32 linux hack.  Always use
	ADDRESS_ADD*_INSN for address addition in the expansion of "dla"
	and "la".  Handle constants separately from symbolic expressions in
	the "ld_st:" case, using 64-bit arithmetic if HAVE_64BIT_ADDRESSES
	and using load_register to load the high part of the address.
	(OPTION_MSYM32, OPTION_NO_MSYM32): New macros.
	(OPTION_ELF_BASE): Bump by 2.
	(md_longopts): Add entries for -msym32 and -mno-sym32.
	(md_parse_option): Handle them.
	(usage): Document them.
	(s_mipsset): Handle ".set sym32" and ".set nosym32".
	(s_cpload, s_cpsetup): Use HAVE_64BIT_SYMBOLS instead of
	HAVE_64BIT_ADDRESSES to detect 64-bit values of "_gp".
	* doc/c-mips.texi: Document ".set sym32", ".set nosym32",
	-msym32 and -mno-sym32.
2005-03-04 09:51:11 +00:00
Thiemo Seufer 6caf9ef47f * config/tc-mips.c (load_address): Implement GP optimization
for 64bit address space non-PIC. Fix formatting.
        (macro): Likewise. Simplify code.
        (md_parse_option): Don't bail out if -G 0 is set for PIC code.
        (mips_after_parse_args): Simplify code.
2005-03-03 19:53:18 +00:00
Daniel Jacobowitz 3f98094e75 * config/tc-mips.c (percent_op): Add %tlsgd, %tlsldm, %dtprel_hi,
%dtprel_lo, %tprel_hi, %tprel_lo, and %gottprel.
	(parse_relocation): Check for a word break after a relocation
	operator.
	(md_apply_fix3): Handle TLS relocations, and mark thread-local
	symbols.
2005-03-02 21:23:33 +00:00
Alan Modra 2132e3a318 * cgen.c: Warning fixes.
* config/tc-arc.c: Likewise.
	* config/tc-arm.c: Likewise.
	* config/tc-avr.c: Likewise.
	* config/tc-d10v.c: Likewise.
	* config/tc-d30v.c: Likewise.
	* config/tc-frv.c: Likewise.
	* config/tc-frv.h: Likewise.
	* config/tc-h8300.c: Likewise.
	* config/tc-h8500.c: Likewise.
	* config/tc-i370.c: Likewise.
	* config/tc-i960.c: Likewise.
	* config/tc-ia64.c: Likewise.
	* config/tc-ip2k.c: Likewise.
	* config/tc-m68hc11.c: Likewise.
	* config/tc-maxq.c: Likewise.
	* config/tc-mcore.c: Likewise.
	* config/tc-mips.c: Likewise.
	* config/tc-msp430.c: Likewise.
	* config/tc-pj.c: Likewise.
	* config/tc-ppc.c: Likewise.
	* config/tc-ppc.h: Likewise.
	* config/tc-s390.c: Likewise.
	* config/tc-sh.c: Likewise.
	* config/tc-sh64.c: Likewise.
	* config/tc-tic4x.c: Likewise.
	* config/tc-tic80.c: Likewise.
	* config/tc-v850.c: Likewise.
	* config/tc-vax.c: Likewise.
	* config/tc-w65.c: Likewise.
	* config/tc-xstormy16.c: Likewise.
	* config/tc-z8k.c: Likewise.
2005-02-23 12:28:06 +00:00
Eric Christopher 9b2f1d3522 2005-02-22 Eric Christopher <echristo@redhat.com>
* ld-mips-elf/reloc-merge-lo16.d: Correct symbol
	table size for __start.

2005-02-22  Eric Christopher  <echristo@redhat.com>

	* config/tc-mips.c (struct proc): Change isym to
	func_sym. New member func_end_sym.
	(s_mips_ent): Update.
	(s_mips_end): Ditto. Add code to compute function size.
2005-02-22 23:54:41 +00:00
Maciej W. Rozycki 58e2ea4d1c gas/:
* config/tc-mips.c (append_insn): Call dwarf2_emit_insn() before
emitting insn.

gas/testsuite/:
* gas/mips/mips16-dwarf2.d: New test to check DWARF2 line
information for MIPS16.
* gas/mips/mips16-dwarf2.s: Source for the new test.
* gas/mips/mips.exp: Run the new test.
2005-02-22 12:32:26 +00:00
Thiemo Seufer 8fc2e39ed7 /gas/ChangeLog
* config/tc-mips.c (macro_build_ldst_constoffset): Fail on $at
	uses after .set noat.
	(load_address): Likewise.
	(macro): Likewise. Don't try to avoid $at use by sacrificing
	the target register before it is stored, it won't work.

	/gas/testsuite/ChangeLog
	* gas/mips/noat-1.s, gas/mips/noat-1.d, gas/mips/noat-2.s,
	gas/mips/noat2.l, gas/mips/noat-3.s, gas/mips/noat-3.l,
	gas/mips/noat-4.s, gas/mips/noat-4.l, gas/mips/noat-5.s,
	gas/mips/noat-5.l, gas/mips/noat-6.s, gas/mips/noat-6.l,
	gas/mips/noat-7.s, gas/mips/noat-7.l: New files, testcases for
	.set noat in macro expansions.
	* gas/mips/mips.exp: Run new testcases.
	* gas/mips/rol-hw.d, gas/mips/rol-hw.l, gas/mips/rol.d,
	gas/mips/rol.l, gas/mips/rol.s, gas/mips/rol64-hw.d,
	gas/mips/rol64-hw.l, gas/mips/rol64.d, gas/mips/rol64.l,
	gas/mips/rol64.s, gas/mips/uld2-eb.d, gas/mips/uld2-el.d,
	gas/mips/uld2.l, gas/mips/uld2.s, gas/mips/ulh2-eb.d,
	gas/mips/ulh2-el.d, gas/mips/ulh2.l, gas/mips/ulh2.s,
	gas/mips/ulw2-eb-ilocks.d, gas/mips/ulw2-eb.d,
	gas/mips/ulw2-el-ilocks.d, gas/mips/ulw2-el.d, gas/mips/ulw2.l,
	gas/mips/ulw2.s: Don't try to test .set noat.
2005-02-18 22:12:53 +00:00
Alan Modra f17c130bd8 * tc.h (struct relax_type, relax_typeS): Move from here..
* as.h: ..to here.  Make rlx_forward and rlx_backward an offsetT.
	* ecoff.c (ecoff_new_file): Add appfile param.
	* ecoff.h (ecoff_new_file): Likewise.
	* itbl-lex.h: New file.
	* itbl-lex.l: Include itbl-lex.h.
	* itbl-parse.y: Likewise.
	(insntbl_line, yyparse, yylex): Move to itbl-lex.h.
	* read.c (s_app_file_string): Mark appfile possibly unused.
	* subsegs.c (seg_not_empty_p): Make sec possibly unused.
	* subsegs.h (struct seg_info_trash): Delete.
	(seg_info): Use segment_info_type instead.
	* config/obj-coff.c (struct filename_list): Make filename const char *.
	* config/obj-ecoff.h (obj_app_file): Pass app to ecoff_new_file.
	* config/obj-elf.c (elf_file_symbol): Similarly.
	* config/tc-a29k.c (md_apply_fix3): Make val a valueT.  Don't use
	signed right shift.
	* config/tc-arc.c (md_operand): Warning fix.
	* config/tc-arm.c (arm_parse_reloc): Only define when OBJ_ELF.
	(md_begin): Rearrange #if defined OBJ_COFF || defined OBJ_ELF.
	* config/tc-cris.h (TC_IMPLICIT_LCOMM_ALIGNMENT): Use do while.
	* config/tc-frv.c (frv_force_relocation): Warning fix.
	* config/tc-m68k.c (md_parse_option): Delete unused var.
	* config/tc-mcore.c (mylog2): Rename from log2 throughout.
	* config/tc-sparc.c: Likewise.
	(s_common): Warning fix.
	* config/tc-mips.c (append_insn): Use unsigned long long expressions.
	* config/tc-mmix.c (PUSHJSTUB_MAX, PUSHJSTUB_MIN): Define from
	addressT.
	* config/tc-s390.c (s390_insn): Delete test of unsigned >= 0.
	* config/tc-sh.c (sh_cfi_frame_initial_instructions,
	sh_regname_to_dw2regnum): Only define for OBJ_ELF.
	* config/tc-tic4x.c (tic4x_insert_reg): Use ISLOWER.
	(tic4x_do_align): Use TIC_NOP_OPCODE.
	* config/tc-tic4x.h (TIC_NOP_OPCODE): Rename from NOP_OPCODE.
	* config/tc-vax.c: Include netinet/in.h.
	(tc_headers_hook): Formatting.
	* config/tc-xstormy16.c (md_pcrel_from_section): Correct parens.
2005-02-17 13:46:05 +00:00
Thiemo Seufer b8285c27bd * config/tc-mips.c (load_address): Fix formatting.
(macro): Don't use AT if .set noat is in effect. Fix formatting.
	Catch macros which are unexpandable without AT. Remove duplicate
	zeroing of used_at.
	(macro2): Remove duplicate zeroing of used_at.
2005-02-16 15:49:13 +00:00
Maciej W. Rozycki d6f1659387 bfd/:
2005-02-15  Nigel Stephens  <nigel@mips.com>
            Maciej W. Rozycki  <macro@mips.com>

	* elf32-mips.c (elf_mips16_howto_table_rel): New array for MIPS16
	reloc howtos.  Add R_MIPS16_HI16 and R_MIPS16_LO16 relocs and
	R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
	(elf_mips16_jump_howto): Move into elf_mips16_howto_table_rel.
	(elf_mips16_gprel_howto): Likewise.  Redefine src_mask and
	dst_mask.
	(mips16_gprel_reloc): Remove bit shuffling; call
	_bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
	and _bfd_mips16_elf_reloc_shuffle() instead.
	(mips16_reloc_map): New reloc map for MIPS16 relocs.
	(bfd_elf32_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
	relocs.
	(mips_elf32_rtype_to_howto): Fetch MIPS16 howtos from
	elf_mips16_howto_table_rel.
	* elf64-mips.c (mips16_elf64_howto_table_rel): New array for
	MIPS16 REL reloc howtos.  Add R_MIPS16_HI16 and R_MIPS16_LO16
	relocs and R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
	(elf_mips16_jump_howto): Move into mips16_elf64_howto_table_rel.
	(elf_mips16_gprel_howto): Likewise.  Redefine src_mask and
	dst_mask.
	(mips16_elf64_howto_table_rela): New array for MIPS16 RELA
	reloc howtos.  Add R_MIPS16_26, R_MIPS16_GPREL, R_MIPS16_HI16 and
	R_MIPS16_LO16 relocs and R_MIPS16_GOT16 and R_MIPS16_CALL16
	placeholders.
	(mips16_gprel_reloc): Remove bit shuffling; call
	_bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
	and _bfd_mips16_elf_reloc_shuffle() instead.
	(mips16_reloc_map): New reloc map for MIPS16 relocs.
	(bfd_elf64_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
	relocs.
	(mips_elf64_rtype_to_howto): Fetch MIPS16 howtos from
	mips16_elf64_howto_table_rela or mips16_elf64_howto_table_rel.
	* elfn32-mips.c (elf_mips16_howto_table_rel): New array for MIPS16
	REL reloc howtos.  Add R_MIPS16_HI16 and R_MIPS16_LO16 relocs and
	R_MIPS16_GOT16 and R_MIPS16_CALL16 placeholders.
	(elf_mips16_jump_howto): Move into elf_mips16_howto_table_rel.
	(elf_mips16_gprel_howto): Likewise.  Redefine src_mask and
	dst_mask.
	(mips16_gprel_reloc): Remove bit shuffling; call
	_bfd_mips16_elf_reloc_unshuffle(), _bfd_mips_elf_gprel16_with_gp()
	and _bfd_mips16_elf_reloc_shuffle() instead.
	(mips16_reloc_map): New reloc map for MIPS16 relocs.
	(bfd_elf32_bfd_reloc_type_lookup): Use mips16_reloc_map for MIPS16
	relocs.
	(mips_elf_n32_rtype_to_howto): Fetch MIPS16 howtos from
	elf_mips16_howto_table_rela or elf_mips16_howto_table_rel.
	* elfxx-mips.c (_bfd_mips16_elf_reloc_unshuffle): New function to
	handle bit shuffling for MIPS16 relocs.
	(_bfd_mips16_elf_reloc_shuffle): Likewise.
	(_bfd_mips_elf_lo16_reloc): Use _bfd_mips16_elf_reloc_unshuffle()
	and _bfd_mips16_elf_reloc_shuffle().
	(_bfd_mips_elf_generic_reloc): Likewise.
	(mips_elf_calculate_relocation): Likewise.  Handle R_MIPS16_HI16
	and R_MIPS16_LO16.
	(mips_elf_obtain_contents): Remove bit shuffling.
	(mips_elf_perform_relocation): Likewise; call
	_bfd_mips16_elf_reloc_unshuffle() and _bfd_mips16_elf_reloc_shuffle()
	instead.
	(_bfd_mips_elf_relocate_section): Likewise.  Handle R_MIPS16_HI16
	and R_MIPS16_LO16.
	* elfxx-mips.h (_bfd_mips16_elf_reloc_unshuffle): Declare.
	(_bfd_mips16_elf_reloc_shuffle): Likewise.
	* reloc.c (BFD_RELOC_MIPS16_HI16): New reloc.
	(BFD_RELOC_MIPS16_HI16_S): Likewise.
	(BFD_RELOC_MIPS16_LO16): Likewise.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.

gas/:
2005-02-15  Nigel Stephens  <nigel@mips.com>
            Maciej W. Rozycki  <macro@mips.com>

	* config/tc-mips.c (reloc_needs_lo_p): Handle
	BFD_RELOC_MIPS16_HI16_S.
	(fixup_has_matching_lo_p): Handle BFD_RELOC_MIPS16_LO16.
	(append_insn): Add BFD_RELOC_MIPS16_GPREL, BFD_RELOC_MIPS16_HI16_S
	and BFD_RELOC_MIPS16_LO16 to relocs to suppress overflow
	complaints on.
	(mips16_ip): Resolve BFD_RELOC_MIPS16_HI16_S,
	BFD_RELOC_MIPS16_HI16 and BFD_RELOC_MIPS16_LO16 for constants.
	Call my_getSmallExpression() to parse percent operators.
	(percent_op_match, mips_percent_op): Separate definitions.
	(mips16_percent_op): Define percent operators for the MIPS16 mode.
	(parse_relocation): Handle the MIPS16 mode using
	mips16_percent_op.
	(md_apply_fix3): Handle BFD_RELOC_MIPS16_HI16,
	BFD_RELOC_MIPS16_HI16_S and BFD_RELOC_MIPS16_LO16.

gas/testsuite/:
2005-02-15  Nigel Stephens  <nigel@mips.com>
            Maciej W. Rozycki  <macro@mips.com>

	* gas/mips/mips16-hilo.d: New test for the R_MIPS16_HI16 and
	R_MIPS16_LO16 relocs.
	* gas/mips/mips16-hilo-n32.d: Likewise, for the n32 ABI.
	* gas/mips/mips16-hilo.s: Source for the new tests.
	* gas/mips/mips.exp: Run the new tests.

include/:
2005-02-15  Nigel Stephens  <nigel@mips.com>
            Maciej W. Rozycki  <macro@mips.com>

	* elf/mips.h (R_MIPS16_GOT16): New reloc code.
	(R_MIPS16_CALL16): Likewise.
	(R_MIPS16_HI16): Likewise.
	(R_MIPS16_LO16): Likewise.
	(R_MIPS16_min): New fake reloc code.
	(R_MIPS16_max): Likewise.

ld/testsuite/:
2005-02-15  Nigel Stephens  <nigel@mips.com>
            Maciej W. Rozycki  <macro@mips.com>

	* ld-mips-elf/mips16-hilo.d: New test for the R_MIPS16_HI16 and
	R_MIPS16_LO16 relocs.
	* ld-mips-elf/mips16-hilo-n32.d: Likewise, for the n32 ABI.
	* ld-mips-elf/mips16-hilo.s: Auxiliary source for the new tests.
	* ld-mips-elf/mips-elf.exp: Run the new tests.
2005-02-15 19:57:54 +00:00
Ben Elliston 65ec77d245 * config/atof-ieee.c, config/obj-coff.c, config/obj-elf.c,
config/obj-ieee.c, config/obj-som.c, config/obj-vms.c,
	config/tc-a29k.c, config/tc-alpha.c, config/tc-arc.c,
	config/tc-arm.c, config/tc-d30v.c, config/tc-dlx.c,
	config/tc-fr30.c, config/tc-h8300.c, config/tc-h8500.c,
	config/tc-i370.c, config/tc-i386.c, config/tc-i960.c,
	config/tc-ia64.c, config/tc-m32r.c, config/tc-m32r.h,
	config/tc-m68hc11.c, config/tc-m68hc11.h, config/tc-mips.c,
	config/tc-mn10200.c, config/tc-msp430.c, config/tc-ns32k.c,
	config/tc-openrisc.c, config/tc-or32.c, config/tc-pdp11.c,
	config/tc-pj.c, config/tc-sparc.h, config/tc-tic54x.c,
	config/tc-tic80.c, config/tc-v850.c, config/tc-w65.c,
	config/tc-xtensa.c, config/tc-z8k.c, config/xtensa-relax.c: Remove
	#if 0'd code throughout.
2005-01-31 23:18:35 +00:00
Fred Fish 9c6ed8e64b 2005-01-19 Fred Fish <fnf@specifixinc.com>
* config/tc-mips.c (dummy_opcode): Add init for new struct member.
2005-01-19 23:33:33 +00:00
Ian Lance Taylor 6943caf048 * config/tc-mips.c (macro) [M_LA_AB]: Give an error for a offset
which is too large in the case of NO_PIC without 64-bit
	addresses.
2004-12-11 03:41:31 +00:00
Ian Lance Taylor aa6975fbb3 * config/tc-mips.c (mips_in_shared): New static variable.
(macro_build_lui): Permit "_gp" if !mips_in_shared.
	(md_longopts): Add -mshared and -mno-shared.
	(md_parse_option): Handle OPTION_MSHARED and OPTION_MNO_SHARED.
	(s_cpload): Implement !mips_in_shared case.
	(s_cpsetup): Likewise.
	* doc/c-mips.texi (MIPS Opts): Document -mno-shared.
	* NEWS: Mention -mno-shared.
2004-12-10 19:48:21 +00:00