Commit Graph

1108 Commits

Author SHA1 Message Date
Thiemo Seufer f3c0ec86c4 * config/tc-mips.c (append_insn): Fix jump overflow check.
* gas/mips/jal-range.s: Fix jump overflow check.
	* gas/mips/jal-range.l: Likewise.
2002-09-26 09:00:08 +00:00
Alan Modra 52271982a7 * config/tc-i386.c (process_operands): Warn about "lea" segment
overrides.
2002-09-24 01:46:42 +00:00
Alan Modra 6539b54baf * config/tc-i386.c (md_apply_fix3): Replace S_IS_EXTERNAL,
S_IS_WEAK etc. with S_FORCE_RELOC call.  Correct comment.
	Rename "fseg" to "sym_seg".
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
2002-09-21 10:39:17 +00:00
Jakub Jelinek 37e55690c4 bfd/
* reloc.c (BFD_RELOC_386_TLS_TPOFF, BFD_RELOC_386_TLS_IE,
	BFD_RELOC_386_TLS_GOTIE): Add.
	* bfd-in2.h, libbfd.h: Rebuilt.
	* elf32-i386.c (elf_howto_table): Add R_386_TLS_TPOFF, R_386_TLS_IE
	and R_386_TLS_GOTIE.
	(elf_i386_reloc_type_lookup): Handle it.
	(struct elf_i386_link_hash_entry): Change tls_type type to unsigned
	char instead of enum, change GOT_* into defines.
	(GOT_TLS_IE_POS, GOT_TLS_IE_NEG, GOT_TLS_IE_BOTH): Define.
	(elf_i386_tls_transition): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
	(elf_i386_check_relocs): Likewise.  Avoid crash if local symbol is
	accessed both as normal and TLS symbol.  Move R_386_TLS_LDM and
	R_386_PLT32 cases so that R_386_TLS_IE can fall through.
	Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
	(elf_i386_gc_sweep_hook): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
	Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
	(allocate_dynrelocs): Allocate 2 .got and 2 .rel.got entries if
	tls_type is GOT_TLS_IE_BOTH.
	(elf_i386_size_dynamic_sections): Likewise.
	(elf_i386_relocate_section): Handle R_386_TLS_IE and R_386_TLS_GOTIE.
	Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs.
	(elf_i386_finish_dynamic_symbol): Use tls_type & GOT_TLS_IE to catch
	all 4 GOT_TLS_* TLS types.
gas/
	* config/tc-i386.c (tc_i386_fix_adjustable): Handle
	BFD_RELOC_386_TLS_IE and BFD_RELOC_386_TLS_GOTIE.
	(BFD_RELOC_386_TLS_IE, BFD_RELOC_386_TLS_GOTIE): Define to 0
	if not defined.
	(lex_got): Handle @GOTNTPOFF and @INDNTPOFF.
	(md_apply_fix3, tc_gen_reloc): Handle BFD_RELOC_386_TLS_IE and
	BFD_RELOC_386_TLS_GOTIE.
gas/testsuite/
	* gas/i386/tlspic.s: Add tests.
	* gas/i386/tlspic.d: Regenerated.
	* gas/i386/tlsnopic.s: Add tests.
	* gas/i386/tlsnopic.d: Regenerated.
include/
	* elf/i386.h (R_386_TLS_TPOFF, R_386_TLS_IE, R_386_TLS_GOTIE):
	Define.
ld/testsuite/
	* ld-i386/i386.exp: New.
	* ld-i386/tlsbin.dd: New test.
	* ld-i386/tlsbinpic.s: New test.
	* ld-i386/tlsbin.rd: New test.
	* ld-i386/tlsbin.s: New test.
	* ld-i386/tlsbin.sd: New test.
	* ld-i386/tlsbin.td: New test.
	* ld-i386/tlslib.s: New test.
	* ld-i386/tlsnopic1.s: New test.
	* ld-i386/tlsnopic2.s: New test.
	* ld-i386/tlsnopic.dd: New test.
	* ld-i386/tlsnopic.rd: New test.
	* ld-i386/tlsnopic.sd: New test.
	* ld-i386/tlspic1.s: New test.
	* ld-i386/tlspic2.s: New test.
	* ld-i386/tlspic.dd: New test.
	* ld-i386/tlspic.rd: New test.
	* ld-i386/tlspic.sd: New test.
	* ld-i386/tlspic.td: New test.
2002-09-19 19:01:18 +00:00
Richard Henderson 021c2b5e4b * config/tc-alpha.c (md_pcrel_from): Only adjust special for
branch type relocs.
        (alpha_force_relocation): Don't special-case branch type relocs.

        * gas/alpha/elf-reloc-7.s: New.
        * gas/alpha/elf-reloc-7.d: New.
        * gas/alpha/alpha.exp: Run it.
2002-09-19 16:13:38 +00:00
Nick Clifton 4f2a7c9e31 Handle situation where architecture has not yet been selected. 2002-09-19 14:52:15 +00:00
Chris Demetriou 885add9520 [ gas/ChangeLog ]
2002-09-18  Chris Demetriou  <cgd@broadcom.com>

        * config/tc-mips.c (IS_SEXT_32BIT_NUM): Move closer to top of file.
        (IS_SEXT_16BIT_NUM): New macro.
        (macro_build_ldst_constoffset): New function, to build a set of
        instructions to do a load or store from a constant offset relative
        to a given register.
        (macro, s_cprestore): Use macro_build_ldst_constoffset to implement
        .cprestore pseudo-op.

[ gas/testsuite/ChangeLog ]
2002-09-18  Chris Demetriou  <cgd@broadcom.com>

        * gas/mips/mips-abi32-pic2.s: New file.
        * gas/mips/mips-abi32-pic2.d: New file.
        * gas/mips/mips.exp: Run new test.

[ plus, fixed date on prev. gas/testsuite/ChangeLog entry. ]
2002-09-18 21:33:07 +00:00
Chris Demetriou 65551fa46c [ gas/ChangeLog ]
2002-09-18  Chris Demetriou  <cgd@broadcom.com>

        * config/tc-mips.c (md_apply_fix3): Just return for BFD_RELOC_8.

[ gas/testsuite/ChangeLog ]
2002-09-18  Chris Demetriou  <cgd@broadcom.com>

        * gas/mips/baddata1.s: New file.
        * gas/mips/baddata1.l: New file.
        * gas/mips/mips.exp: Run new test.
2002-09-18 21:05:59 +00:00
Thiemo Seufer 4cf0dd0d7c * config/tc-mips.c (s_change_section): Fix parsing. Code cleanup. 2002-09-18 08:02:22 +00:00
Stan Cox ed6fb7bdf5 * tc-mips.c (load_address): Use BFD_RELOC_MIPS_GOT_DISP for newabi.
(macro): Likewise for la.  Likewise for ld.
	(mips_after_parse_args): Make -xgot optional, not the default.
	(md_apply_fix3): Allow composite relocation to set up gp.
	(tc_gen_reloc): Allow relaxing for newabi.
	Relax R_MIPS_CALL16 to R_MIPS_GOT_PAGE/R_MIPS_GOT_OFST if local.
	Relax R_MIPS_GOT16/R_MIPS_LO16 to R_MIPS_GOT_DISP if local.
2002-09-18 02:25:19 +00:00
Nick Clifton 6189168b13 Note that an implemented BFD_RELOC_ARM_IMMEDIATE has been done.
Do not issue reloc number of unimplemented BFD_RELOC_ARM_IMMEDIATE and
BFD_RELOC_ARM_OFFSET_IMM relocs - their name is already in the error message
- plus remove them from the default case.
Warn about unpredictable behavior of LDM and STM instructions.
2002-09-17 19:23:00 +00:00
Alan Modra 75d12d11a0 * config/tc-tic4x.c: Add function declarations and ATTRIBUTE_UNUSED.
Convert functions to K&R format.
2002-09-17 08:35:10 +00:00
Thiemo Seufer 7ed4a06a3d * config/tc-mips.c (pdr_seg): Define only for ELF.
(s_change_section): Remove unused variable. Don't use for nonELF.
2002-09-17 07:43:25 +00:00
Thiemo Seufer e8cf2216ef * config/obj-elf.c (obj_elf_change_section): Move prototype to
obj-elf.h
	* config/obj-elf.h (obj_elf_change_section): Likewise.
2002-09-17 07:38:14 +00:00
David O'Brien 4ada7262d0 2002-09-16 Bruno Haible <bruno@clisp.org>
* elf32-i386.c: Don't defined ELF_ARCH etc. if this file is included
	by a target variant implementation.
	* elf64-alpha.c: Likewise.
	* elf32-i386-fbsd.c: New file.
	* elf64-alpha-fbsd.c: New file.
	* targets.c: Support bfd_elf32_i386_freebsd_vec and
	bfd_elf64_alpha_freebsd_vec.
	* configure.in: Accept the vectors bfd_elf32_i386_freebsd_vec,
	bfd_elf64_alpha_freebsd_vec.
	* Makefile.am (BFD32_BACKENDS): Add elf32-i386-fbsd.lo.
	(BFD32_BACKENDS_CFILES): Add elf32-i386-fbsd.c.
	(BFD64_BACKENDS): Add elf64-alpha-fbsd.lo.
	(BFD64_BACKENDS_CFILES): Add elf64-alpha-fbsd.c.
	(elf32-i386-fbsd.lo, elf64-alpha-fbsd.lo): Add dependencies.
	* config.bfd: For FreeBSD targets, set targ_defvec to a FreeBSD
	specific targets. Define OLD_FREEBSD_ABI_LABEL if appropriate.

	* config/tc-i386.h (ELF_TARGET_FORMAT): New macro.
	(TARGET_FORMAT): Use ELF_TARGET_FORMAT instead of "elf32-i386".
	* config/tc-i386.c (i386_target_format): Likewise.
	* config/tc-alpha.h (ELF_TARGET_FORMAT): New macro.
	(TARGET_FORMAT): Use ELF_TARGET_FORMAT instead of "elf64-alpha".

	* emulparams/elf_i386_fbsd.sh: Set OUTPUT_FORMAT to
	elf32-i386-freebsd.
	* emulparams/elf64alpha_fbsd.sh: Set OUTPUT_FORMAT to
	elf64-alpha-freebsd.

Approved by:  Alan Modra <amodra@bigpond.net.au>
              Message-ID: <20020715021113.GJ30362@bubble.sa.bigpond.net.au>
2002-09-17 02:24:40 +00:00
Nick Clifton 7fe9cf6bf6 Do not count FAKE operands when deciding if any operands have been skipped. 2002-09-13 09:16:02 +00:00
Jakub Jelinek 9dfe7b396f * config/tc-i386.c (md_apply_fix3): Allow addend for
BFD_RELOC_386_TLS_LDO_32, BFD_RELOC_386_TLS_LE and
	BFD_RELOC_386_TLS_LE_32.
2002-09-11 09:51:58 +00:00
Jeff Law 502b19cb2a * config/tc-hppa.c (md_apply_fix3): Don't set fx_done for
marker relocations such as ENTRY/EXIT.
        * config/tc-hppa.h (MD_APPLY_SYM_VALUE): Definition applies
        to both OBJ_ELF and OBJ_SOM.
2002-09-09 21:31:40 +00:00
Alan Modra a161fe5320 gas reloc rewrite. 2002-09-05 00:01:18 +00:00
Alan Modra b782de161e * config/tc-ppc.c (ppc_frob_symbol): Formatting, warning fix.
(ppc_fix_adjustable <coff version>): Cleanup.
2002-09-04 13:43:43 +00:00
Alan Modra 2a98c3a655 * config/tc-ppc.c (PPC_HIGHER, PPC_HIGHEST): Fix warning.
(md_parse_option): No -a64 without BFD64.
	(ppc_set_cpu): Select appropriate cpu when ppc_obj64.
	(ppc_arch): Use bfd_mach_rs6k for bfd_arch_rs6000.
2002-09-04 13:21:18 +00:00
Nick Clifton 341026c1c1 Do not insert non-BookE32 instructions into the hash table if the target cpu
is the BookE32. (case 107575)
2002-09-04 12:37:30 +00:00
Nick Clifton 86aba9dbfa Add linker relaxation to v850 toolchain 2002-08-29 06:49:35 +00:00
Nick Clifton 026df7c5e6 Add TMS320C4x support 2002-08-28 10:38:51 +00:00
Alan Modra 7065849339 * dwarf2dbg.c: Always include dwarf2dbg.h.
(dwarf2_directive_file): Adjust dummy version args.
	* ecoff.c (ecoff_directive_weakext): Add ATTRIBUTE_UNUSED.
	* expr.c (clean_up_expression <O_subtract>): Allow subtraction
	when symbol values differ.
	* read.c (do_align): Add ATTRIBUTE_UNUSED to label.
	(pseudo_set <O_subtract>): Remove unnecessary segment test.
	* config/obj-bout.c (obj_pseudo_table): Warning fix.
2002-08-27 11:09:43 +00:00
Alan Modra a2199cc1ea * config/tc-w65.c (md_section_align): Fix typo.
(md_parse_option): Return 0, not 1.
2002-08-26 08:55:33 +00:00
Nick Clifton 1489984027 opcodes: Fix definition of "in rd,imm16" opcode.
gas: Adjust ptr variable also in "case 0" case.
2002-08-22 19:22:35 +00:00
Nick Clifton ed71e1110d Add sh-nto support 2002-08-22 17:27:20 +00:00
Jeff Law dfe0d3fe28 * config/tc-h8300.h (TC_LINKRELAX_FIXUP): Define. 2002-08-22 16:24:24 +00:00
Elena Zannoni dc1d03fc42 2002-08-21 Elena Zannoni <ezannoni@redhat.com>
* config/tc-ppc.c (ppc_cleanup): Do something only if format
        is ELF.
        (ppc_apuinfo_section_add): Define only if format is ELF.
        (md_assemble): Emit APUinfo section only if format is ELF.
        Fix formatting.
2002-08-21 23:37:34 +00:00
Alan Modra 9f1838ed64 * config/tc-arc.c (md_pseudo_table <dwarf2_directive_file>): Cast.
* config/tc-frv.c: Likewise.
	* config/tc-hppa.c: Likewise.
	* config/tc-ia64.c: Likewise.
	* config/tc-ip2k.c: Likewise.
	* config/tc-m68hc11.c: Likewise.
	* config/tc-m68k.c: Likewise.
	* config/tc-mmix.c: Likewise.
	* config/tc-mn10300.c: Likewise.
	* config/tc-sh.c: Likewise.
	* config/tc-sparc.c: Likewise.
	* config/tc-v850.c: Likewise.
2002-08-20 23:49:27 +00:00
Richard Sandiford 483fc7cd61 [gas/]
* config/tc-mips.c (macro2): Implement rotates by zero using shifts
        by zero.

[gas/testsuite]
	* gas/mips/rol.s: Add rotate by zero tests.
	* gas/mips/rol.d: Update accordingly.
	* gas/mips/rol64.d: Expect rotates by zero to use dsrl.
2002-08-20 08:28:35 +00:00
Elena Zannoni 6a0c61b777 2002-08-19 Elena Zannoni <ezannoni@redhat.com>
From matthew green  <mrg@redhat.com>

        * config/tc-ppc.c (PPC_OPCODE_CLASSIC): Enable this everywhere
        PPC_OPCODE_PPC is, except for BookE architectures.
        (md_parse_option): Add support for -mspe.
        (md_show_usage): Add -mspe.
        (md_parse_option): Add support for -me500 and
        -me500x2 to generate code for Motorola e500 core complex.
        (md_show_usage): Add -me500 and -me500x2.

        (PPC_APUINFO_ISEL, PPC_APUINFO_PMR, PPC_APUINFO_RFMCI,
        PPC_APUINFO_CACHELCK, PPC_APUINFO_SPE, PPC_APUINFO_EFS,
        PPC_APUINFO_BRLOCK): New macros.

        (ppc_cleanup): New function.
        (ppc_apuinfo_section_add): New function.
        (APUID): New macro.
        (md_assemble): Collect info and write the APUinfo section.

        * config/tc-ppc.h (md_cleanup): Define.
        (ppc_cleanup): Export.
        (ELF_TC_SPECIAL_SECTIONS): Add .PPC.EMB.apuinfo section.
2002-08-19 21:08:55 +00:00
Stan Cox cca86cc8d6 * config/obj-elf.c (obj_elf_change_section): Make non-static.
config/tc-mips.c (s_change_section): New function to support
	IRIX .section pseudo-op.
2002-08-17 15:09:29 +00:00
Nick Clifton 50b15da2e5 Fix assembly of "callt 0x3f" 2002-08-16 07:01:47 +00:00
Alexandre Oliva f21f824289 * config/tc-mips.c (macro_build_jalr): Make sure we generate
the fix-up against on the right frag.
(s_cpsetup): Likewise.  Parse third argument as expression, to
handle global symbols and forward/backward labels correctly.
2002-08-16 00:58:11 +00:00
Nick Clifton a7fda4576d Only define TC_VALIDATE_FIX for ELF builds 2002-08-14 16:33:58 +00:00
Nick Clifton 11f45fb5ff Fix compiling for COFF targets.
Some minor formatting tidyups.
2002-08-14 13:27:06 +00:00
Stephane Carrez e371935fea * config/tc-m68hc11.h (MD_PCREL_FROM_SECTION): Remove.
(TC_HANDLES_FX_DONE): Define to let md_apply_fix3 set fx_done flag
	according to the reloc.
	(tc_fix_adjustable, tc_m68hc11_fix_adjustable): Define.
	(TC_FORCE_RELOCATION): Define.
	(tc_m68hc11_force_relocation): Declare.

	* config/tc-m68hc11.c (md_pseudo_table): Add relax command.
	(s_m68hc11_relax): New function for relax group.
	(build_insn, build_jump_insn): Emit a M68HC11_RL_JUMP reloc at
	beginning of jump instruction.
	(md_pcrel_from): Rename from md_pcrel_from_section and fix
	address computation.
	(tc-gen_reloc): Update.
	(md_estimate_size_before_relax): Create the BFD_RELOC_16_PCREL as
	PC-relative fixup.
	(tc_m68hc11_force_relocation): New function, handle new relocs.
	(tc_m68hc11_fix_adjustable): New to make sure there are enough
	reloc for the linker relax pass.
	(md_apply_fix3): Handle M68HC11_RL_JUMP, M68HC11_RL_GROUP
	and VTABLE relocs.
2002-08-13 22:20:50 +00:00
Stephane Carrez eb086b5940 * config/tc-m68hc11.c (m68hc11_elf_final_processing): New function.
(md_pseudo_table): Add .mode, .far and .interrupt pseudo op.
	(s_m68hc11_mode): New function for .mode pseudo op.
	(s_m68hc11_mark_symbol): New function for .far and .interrupt
	pseudo op.
	* config/tc-m68hc11.h (elf_tc_final_processing): Define.
	(m68hc11_elf_final_processing): Declare.
2002-08-13 21:52:57 +00:00
Stephane Carrez 7bfda7ebd0 * config/tc-m68hc11.c (md_begin): Take into account additional
page operand for call instruction.
	(print_opcode_format): Likewise.
	(check_range): Likewise for page range checking.
	(get_operand): Don't skip a possible comma in operands.
	(fixup8): Generate BFD_RELOC_M68HC11_PAGE reloc.
	(fixup16): Likwise with BFD_RELOC_M68HC11_LO16.
	(fixup24): New to handle call reloc.
	(build_insn): Handle missing page operand for call instruction.
	(find): Likewise.
	(md_apply_fix3): Take into account new relocs.
	(get_operand): Fix the mode for indexed indirect addressing.
	(build_indexed_byte): Fix post index byte for indexed indirect mode.
2002-08-13 21:38:15 +00:00
Richard Sandiford fdb987ee01 [gas/]
* config/tc-mips.c (mips_ip): Don't work out the value of
	constant %hi()s here.

[gas/testsuite/]
	* gas/mips/elf-consthilo.[sd]: New test.
	* gas/mips/mips.exp: Run it.
2002-08-12 08:33:42 +00:00
Alan Modra 31312f958e * config/tc-i386.c (tc_i386_fix_adjustable): Test OUTPUT_FLAVOR
for ELF, and don't bother checking ELF relocs when non-ELF.
	(i386_immediate): Allow absolute_section expressions for aout.
	(i386_displacement): Likewise.  Also test bfd_is_com_section.
	(md_estimate_size_before_relax): Test OUTPUT_FLAVOR for ELF.
	(md_apply_fix3): Hack for bfd_install_relocation when fx_pcrel,
	not when fx_addsy.  Remove dead code.
2002-08-10 14:49:48 +00:00
Alan Modra 6088b00e51 * config/tc-i386.h: Reorganize. 2002-08-09 12:37:41 +00:00
Maciej W. Rozycki 0c11417f42 * config/tc-mips.c (macro): Handle a register plus a 16-bit
immediate offset in "dla" and "la" expansions.
* gas/mips/empic.d: Treat "addiu" and "daddiu" as equivalent when
$0 is source.
* mips-opc.c (mips_builtin_opcodes): Remove "dla" and "la" as
aliases to "daddiu" and "addiu".
2002-08-09 11:07:24 +00:00
Jakub Jelinek 2bbd9c2554 * config/tc-i386.c (output_insn): Save frag_now and frag_now_fix ()
at start of insn, pass it to output_disp and output_imm.
	(output_disp): Added arguments.  If _GLOBAL_OFFSET_TABLE_ is seen
	in displacement for R_386_32 reloc, use R_386_GOTPC and compute
	properly addend.
	(output_imm): Added arguments.  Compute properly addend for
	R_386_GOTPC.
	(md_apply_fix3): Remove R_386_GOTPC handling.
	* testsuite/gas/i386/gotpc.s: New.
	* testsuite/gas/i386/gotpc.d: New.
	* testsuite/gas/i386/i386.exp: Add gotpc test.
2002-08-09 00:10:19 +00:00
Richard Henderson dbac4f5ba8 * config/tc-alpha.c (cpu_types): Enabled ev67, ev68, -m21264a
and m21264b processor names and cpu types.
        * doc/c-alpha.texi: Documented new types.
2002-08-06 22:06:08 +00:00
Alan Modra 95210096dc * config/tc-ppc.c (md_apply_fix3): Adjust 16 bit XCOFF reloc offset. 2002-08-06 02:30:06 +00:00
Richard Sandiford 9860559818 [gas/]
* config/tc-mips.c (tc_gen_reloc): Extend GP-relative addend
	handling to BFD_RELOC_MIPS16_GPREL.

[gas/testsuite/]
	* gas/mips/elf-rel6.[sd]: New test.
	* gas/mips/mips.exp: Run it.
2002-08-01 20:14:49 +00:00
Nick Clifton 08df23795b Ensure that offset to literal pool is computed using signed arithmetic so that
proper sign extension is performed if X_add_number is a 64-bit integer.
2002-08-01 16:31:16 +00:00