Commit Graph

80 Commits

Author SHA1 Message Date
Alan Modra e1e9003466 PR gas/12519
* config/obj-elf.c (elf_frob_symbol): Properly handle size expression.
	* ld-mn10300/i135409-3.s: Correct .size label reference.
	* ld-sh/sh64/stolib.s: Likewise.
2011-02-25 13:45:54 +00:00
Maciej W. Rozycki d898aefbfa * ld-sh/sh.exp: Add missing newline. 2010-08-20 21:13:03 +00:00
Andreas Schwab 3437afb199 binutils/testsuite/:
* binutils-all/readelf.s: Ignore "Key to Flags" contents.
* binutils-all/readelf.s-64: Likewise.
* binutils-all/i386/compressed-1b.d: Likewise.
* binutils-all/i386/compressed-1c.d: Likewise.
* binutils-all/x86-64/compressed-1b.d: Likewise.
* binutils-all/x86-64/compressed-1c.d: Likewise.

gas/testsuite/:
* gas/i386/x86-64-unwind.d: Ignore "Key to Flags" contents.
* gas/ia64/alias-ilp32.d: Likewise.
* gas/ia64/alias.d: Likewise.
* gas/ia64/group-1.d: Likewise.
* gas/ia64/group-2.d: Likewise.
* gas/ia64/secname-ilp32.d: Likewise.
* gas/ia64/secname.d: Likewise.
* gas/ia64/unwind-ilp32.d: Likewise.
* gas/ia64/unwind.d: Likewise.
* gas/mmix/byte-1.d: Likewise.
* gas/mmix/loc-1.d: Likewise.
* gas/mmix/loc-2.d: Likewise.
* gas/mmix/loc-3.d: Likewise.
* gas/mmix/loc-4.d: Likewise.
* gas/mmix/loc-5.d: Likewise.

ld/testsuite/:
* ld-mmix/bspec1.d: Ignore "Key to Flags" contents.
* ld-mmix/bspec2.d: Likewise.
* ld-mmix/local1.d: Likewise.
* ld-mmix/local3.d: Likewise.
* ld-mmix/local5.d: Likewise.
* ld-mmix/local7.d: Likewise.
* ld-mmix/undef-3.d: Likewise.
* ld-sh/sh64/crange1.rd: Likewise.
* ld-sh/sh64/crange2.rd: Likewise.
* ld-sh/sh64/crange3-cmpct.rd: Likewise.
* ld-sh/sh64/crange3-media.rd: Likewise.
* ld-sh/sh64/crange3.rd: Likewise.
* ld-sh/sh64/crangerel1.rd: Likewise.
* ld-sh/sh64/crangerel2.rd: Likewise.
2010-07-19 15:11:03 +00:00
Nick Clifton 8e45593ff3 2010-05-21 Daniel Jacobowitz <dan@codesourcery.com>
Joseph Myers  <joseph@codesourcery.com>
            Andrew Stubbs  <ams@codesourcery.com>

        bfd/
        * config.bfd (sh-*-uclinux* | sh[12]-*-uclinux*): Add
        bfd_elf32_shl_vec, and FDPIC vectors to targ_selvecs.
        * configure.in: Handle FDPIC vectors.
        * elf32-sh-relocs.h: Add FDPIC and movi20 relocations.
        * elf32-sh.c (DEFAULT_STACK_SIZE): Define.
        (SYMBOL_FUNCDESC_LOCAL): Define.  Use it instead of
        SYMBOL_REFERENCES_LOCAL for function descriptors.
        (fdpic_object_p): New.
        (sh_reloc_map): Add FDPIC and movi20 relocations.
        (sh_elf_info_to_howto, sh_elf_relocate_section): Handle new invalid
        range.
        (struct elf_sh_plt_info): Add got20 and short_plt.  Update all
        definitions.
        (FDPIC_PLT_ENTRY_SIZE, FDPIC_PLT_LAZY_OFFSET): Define.
        (fdpic_sh_plt_entry_be, fdpic_sh_plt_entry_le, fdpic_sh_plts): New.
        (FDPIC_SH2A_PLT_ENTRY_SIZE, FDPIC_SH2A_PLT_LAZY_OFFSET): Define.
        (fdpic_sh2a_plt_entry_be, fdpic_sh2a_plt_entry_le)
        (fdpic_sh2a_short_plt_be, fdpic_sh2a_short_plt_le, fdpic_sh2a_plts):
        New.
        (get_plt_info): Handle FDPIC.
        (MAX_SHORT_PLT): Define.
        (get_plt_index, get_plt_offset): Handle short_plt.
        (union gotref): New.
        (struct elf_sh_link_hash_entry): Add funcdesc, rename tls_type to
        got_type and adjust all uses.  Add GOT_FUNCDESC.
        (struct sh_elf_obj_tdata): Add local_funcdesc.  Rename
        local_got_tls_type to local_got_type.
        (sh_elf_local_got_type): Renamed from sh_elf_local_got_tls_type.  All
        users changed.
        (sh_elf_local_funcdesc): Define.
        (struct elf_sh_link_hash_table): Add sfuncdesc, srelfuncdesc, fdpic_p,
        and srofixup.
        (sh_elf_link_hash_newfunc): Initialize new fields.
        (sh_elf_link_hash_table_create): Set fdpic_p.
        (sh_elf_omit_section_dynsym): New.
        (create_got_section): Create .got.funcdesc, .rela.got.funcdesc
        and .rofixup.
        (allocate_dynrelocs): Allocate local function descriptors and space
        for R_SH_FUNCDESC-related relocations, and for rofixups.
        Handle GOT_FUNCDESC.  Create fixups.  Handle GOT entries which
        require function descriptors.
        (sh_elf_always_size_sections): Handle PT_GNU_STACK and __stacksize.
        (sh_elf_modify_program_headers): New.
        (sh_elf_size_dynamic_sections): Allocate function descriptors for
        local symbols.  Allocate .got.funcdesc contents.  Allocate rofixups.
        Handle local GOT entries of type GOT_FUNCDESC.  Create fixups for
        local GOT entries.  Ensure that FDPIC libraries always have a PLTGOT
        entry in the .dynamic section.
        (sh_elf_add_dyn_reloc, sh_elf_got_offset, sh_elf_initialize_funcdesc)
        (sh_elf_add_rofixup, sh_elf_osec_to_segment)
        (sh_elf_osec_readonly_p, install_movi20_field): New functions.
        (sh_elf_relocate_section): Handle new relocations, R_SH_FUNCDESC,
        R_SH_GOTFUNCDESC and R_SH_GOTOFFFUNCDESC.  Use sh_elf_got_offset
        and .got.plt throughout to find _GLOBAL_OFFSET_TABLE_.  Add rofixup
        read-only section warnings.  Handle undefined weak symbols.  Generate
        fixups for R_SH_DIR32 and GOT entries.  Check for cross-segment
        relocations and clear EF_SH_PIC.  Handle 20-bit relocations.
        Always generate R_SH_DIR32 for FDPIC instead of R_SH_RELATIVE.
        (sh_elf_gc_sweep_hook): Handle R_SH_FUNCDESC, R_SH_GOTOFF20,
        R_SH_GOTFUNCDESC, R_SH_GOTFUNCDESC20, and R_SH_GOTOFFFUNCDESC.
        Handle 20-bit relocations.
        (sh_elf_copy_indirect_symbol): Copy function descriptor reference
        counts.
        (sh_elf_check_relocs): Handle new relocations.  Make symbols
        dynamic for FDPIC relocs.  Account for rofixups.  Error for FDPIC
        symbol mismatches.  Allocate a GOT for R_SH_DIR32. Allocate fixups
        for R_SH_DIR32.
        (sh_elf_copy_private_data): Copy PT_GNU_STACK size.
        (sh_elf_merge_private_data): Copy initial flags.  Do not clobber
        non-mach flags.  Set EF_SH_PIC for FDPIC.  Reject FDPIC mismatches.
        (sh_elf_finish_dynamic_symbol): Do not handle got_funcdesc entries
        here.  Rename sgot to sgotplt and srel to srelplt.  Handle short_plt,
        FDPIC descriptors, and got20.  Create R_SH_FUNCDESC_VALUE for FDPIC.
        Use install_movi20_field.  Rename srel to srelgot.  Always generate
        R_SH_DIR32 for FDPIC instead of R_SH_RELATIVE.
        (sh_elf_finish_dynamic_sections): Fill in the GOT pointer in rofixup.
        Do not fill in reserved GOT entries for FDPIC.  Correct DT_PLTGOT.
        Rename sgot to sgotplt.  Assert that the right number of rofixups
        and dynamic relocations were allocated.
        (sh_elf_use_relative_eh_frame, sh_elf_encode_eh_address): New.
        (elf_backend_omit_section_dynsym): Use sh_elf_omit_section_dynsym.
        (elf_backend_can_make_relative_eh_frame)
        (elf_backend_can_make_lsda_relative_eh_frame)
        (elf_backend_encode_eh_address): Define.
        (TARGET_BIG_SYM, TARGET_BIG_NAME, TARGET_LITTLE_SYM)
        (TARGET_LITTLE_NAME, elf_backend_modify_program_headers, elf32_bed):
        Redefine for FDPIC vector.
        * reloc.c: Add SH FDPIC and movi20 relocations.
        * targets.c (_bfd_target_vector): Add FDPIC vectors.
        * configure, bfd-in2.h, libbfd.h: Regenerated.

        binutils/
        * readelf.c (get_machine_flags): Handle EF_SH_PIC and EF_SH_FDPIC.

        gas/
        * config/tc-sh.c (sh_fdpic): New.
        (sh_check_fixup): Handle relocations on movi20.
        (parse_exp): Do not reject PIC operators here.
        (build_Mytes): Check for unhandled PIC operators here.  Use
        sh_check_fixup for movi20.
        (enum options): Add OPTION_FDPIC.
        (md_longopts, md_parse_option, md_show_usage): Add --fdpic.
        (sh_fix_adjustable, md_apply_fix): Handle FDPIC and movi20 relocations.
        (sh_elf_final_processing): Handle --fdpic.
        (sh_uclinux_target_format): New.
        (sh_parse_name): Handle FDPIC relocation operators.
        * config/tc-sh.h (TARGET_FORMAT): Define specially for TE_UCLINUX.
        (sh_uclinux_target_format): Declare for TE_UCLINUX.
        * configure.tgt (sh-*-uclinux* | sh[12]-*-uclinux*): Set
        em=uclinux.
        * doc/c-sh.texi (SH Options): Document --fdpic.

        gas/testsuite/
        * gas/sh/basic.exp: Run new tests.  Handle uClinux like Linux.
        * gas/sh/fdpic.d: New file.
        * gas/sh/fdpic.s: New file.
        * gas/sh/reg-prefix.d: Force big-endian.
        * gas/sh/sh2a-pic.d: New file.
        * gas/sh/sh2a-pic.s: New file.
        * lib/gas-defs.exp (is_elf_format): Include sh*-*-uclinux*.

        include/elf/
        * sh.h (EF_SH_PIC, EF_SH_FDPIC): Define.
        (R_SH_FIRST_INVALID_RELOC_6, R_SH_LAST_INVALID_RELOC_6): New.  Adjust
        other invalid ranges.
        (R_SH_GOT20, R_SH_GOTOFF20, R_SH_GOTFUNCDESC, R_SH_GOTFUNCDESC20)
        (R_SH_GOTOFFFUNCDESC, R_SH_GOTOFFFUNCDESC20, R_SH_FUNCDESC)
        (R_SH_FUNCDESC_VALUE): New.

        ld/
        * Makefile.am (ALL_EMULATIONS): Add eshelf_fd.o and eshlelf_fd.o.
        (eshelf_fd.c, eshlelf_fd.c): New rules.
        * Makefile.in: Regenerate.
        * configure.tgt (sh-*-uclinux*): Add shelf_fd and shlelf_fd
        emulations.
        * emulparams/shelf_fd.sh: New file.
        * emulparams/shlelf_fd.sh: New file.
        * emulparams/shlelf_linux.sh: Update comment.

        ld/testsuite/
        * ld-sh/sh.exp: Handle uClinux like Linux.
        * lib/ld-lib.exp (is_elf_format): Include sh*-*-uclinux*.
        * ld-sh/fdpic-funcdesc-shared.d: New file.
        * ld-sh/fdpic-funcdesc-shared.s: New file.
        * ld-sh/fdpic-funcdesc-static.d: New file.
        * ld-sh/fdpic-funcdesc-static.s: New file.
        * ld-sh/fdpic-gotfuncdesc-shared.d: New file.
        * ld-sh/fdpic-gotfuncdesc-shared.s: New file.
        * ld-sh/fdpic-gotfuncdesc-static.d: New file.
        * ld-sh/fdpic-gotfuncdesc-static.s: New file.
        * ld-sh/fdpic-gotfuncdesci20-shared.d: New file.
        * ld-sh/fdpic-gotfuncdesci20-shared.s: New file.
        * ld-sh/fdpic-gotfuncdesci20-static.d: New file.
        * ld-sh/fdpic-gotfuncdesci20-static.s: New file.
        * ld-sh/fdpic-goti20-shared.d: New file.
        * ld-sh/fdpic-goti20-shared.s: New file.
        * ld-sh/fdpic-goti20-static.d: New file.
        * ld-sh/fdpic-goti20-static.s: New file.
        * ld-sh/fdpic-gotofffuncdesc-shared.d: New file.
        * ld-sh/fdpic-gotofffuncdesc-shared.s: New file.
        * ld-sh/fdpic-gotofffuncdesc-static.d: New file.
        * ld-sh/fdpic-gotofffuncdesc-static.s: New file.
        * ld-sh/fdpic-gotofffuncdesci20-shared.d: New file.
        * ld-sh/fdpic-gotofffuncdesci20-shared.s: New file.
        * ld-sh/fdpic-gotofffuncdesci20-static.d: New file.
        * ld-sh/fdpic-gotofffuncdesci20-static.s: New file.
        * ld-sh/fdpic-gotoffi20-shared.d: New file.
        * ld-sh/fdpic-gotoffi20-shared.s: New file.
        * ld-sh/fdpic-gotoffi20-static.d: New file.
        * ld-sh/fdpic-gotoffi20-static.s: New file.
        * ld-sh/fdpic-plt-be.d: New file.
        * ld-sh/fdpic-plt-le.d: New file.
        * ld-sh/fdpic-plt.s: New file.
        * ld-sh/fdpic-plti20-be.d: New file.
        * ld-sh/fdpic-plti20-le.d: New file.
        * ld-sh/fdpic-stack-default.d: New file.
        * ld-sh/fdpic-stack-size.d: New file.
        * ld-sh/fdpic-stack.s: New file.
2010-05-25 14:12:43 +00:00
Nick Clifton 70ecb3842d PR 11225
* objdump.c (only): Replace with linked list.
        (only_size, only_used): Replace with only_list.
        (process_section_p): Set seen field on matches sections.
        (add_only): New function.
        (free_only_list): New function.
        (disassemble_section): Check only_list.
        (main): Use add_only and free_only_list.

        * gas/pe/aligncomm-c.d: Dump all sections.

        * ld-sh/refdbg-0-dso.d: Dump all sections.
2010-01-28 15:25:20 +00:00
Alan Modra f9272224cd Tolerate some whitespace differences in readelf output. 2009-09-23 03:12:28 +00:00
Alan Modra aa820537ea update copyright dates 2009-09-02 07:25:43 +00:00
Kaz Kojima 27a1ada688 * ld-sh/arch/arch_expected.txt: Regenerate. 2008-06-09 22:22:05 +00:00
Andrew Stubbs 52b5ca5b35 2008-04-15 Andrew Stubbs <andrew.stubbs@st.com>
gas/

	* config/tc-sh.c (md_apply_fix): Make sure BFD_RELOC_SH_PCRELIMM8BY4
	relocations are properly aligned, and not negative.

gas/testsuite/

	* gas/sh/arch/arch.exp: Align PC-relative instructions in the gererated
	assembly files.
	* gas/sh/arch/sh-dsp.s: Regenerate.
	* gas/sh/arch/sh.s: Regenerate.
	* gas/sh/arch/sh2.s: Regenerate.
	* gas/sh/arch/sh2a-nofpu-or-sh3-nommu.s: Regenerate.
	* gas/sh/arch/sh2a-nofpu-or-sh4-nommu-nofpu.s: Regenerate.
	* gas/sh/arch/sh2a-nofpu.s: Regenerate.
	* gas/sh/arch/sh2a-or-sh3e.s: Regenerate.: Regenerate.
	* gas/sh/arch/sh2a-or-sh4.s: Regenerate.
	* gas/sh/arch/sh2a.s: Regenerate.
	* gas/sh/arch/sh2e.s: Regenerate.
	* gas/sh/arch/sh3-dsp.s: Regenerate.
	* gas/sh/arch/sh3-nommu.s: Regenerate.
	* gas/sh/arch/sh3.s: Regenerate.
	* gas/sh/arch/sh3e.s: Regenerate.
	* gas/sh/arch/sh4-nofpu.s: Regenerate.
	* gas/sh/arch/sh4-nommu-nofpu.s: Regenerate.
	* gas/sh/arch/sh4.s: Regenerate.
	* gas/sh/arch/sh4a-nofpu.s: Regenerate.
	* gas/sh/arch/sh4a.s: Regenerate.
	* gas/sh/arch/sh4al-dsp.s: Regenerate.
	* gas/sh/err-mova.s: New test.

ld/testsuite/

	* ld-sh/arch/sh-dsp.s: Regenerate.
	* ld-sh/arch/sh.s: Regenerate.
	* ld-sh/arch/sh2.s: Regenerate.
	* ld-sh/arch/sh2a-nofpu-or-sh3-nommu.s: Regenerate.
	* ld-sh/arch/sh2a-nofpu-or-sh4-nommu-nofpu.s: Regenerate.
	* ld-sh/arch/sh2a-nofpu.s: Regenerate.
	* ld-sh/arch/sh2a-or-sh3e.s: Regenerate.: Regenerate.
	* ld-sh/arch/sh2a-or-sh4.s: Regenerate.
	* ld-sh/arch/sh2a.s: Regenerate.
	* ld-sh/arch/sh2e.s: Regenerate.
	* ld-sh/arch/sh3-dsp.s: Regenerate.
	* ld-sh/arch/sh3-nommu.s: Regenerate.
	* ld-sh/arch/sh3.s: Regenerate.
	* ld-sh/arch/sh3e.s: Regenerate.
	* ld-sh/arch/sh4-nofpu.s: Regenerate.
	* ld-sh/arch/sh4-nommu-nofpu.s: Regenerate.
	* ld-sh/arch/sh4.s: Regenerate.
	* ld-sh/arch/sh4a-nofpu.s: Regenerate.
	* ld-sh/arch/sh4a.s: Regenerate.
	* ld-sh/arch/sh4al-dsp.s: Regenerate.
2008-04-15 15:53:26 +00:00
Nick Clifton 504b7d2026 Support the use of the STT_COMMON type. (In source and object files only at the moment) 2007-10-16 14:42:15 +00:00
Nick Clifton f96b4a7b0f Update sources to GPLv3 2007-07-06 14:09:45 +00:00
Richard Sandiford e68ed250e8 ld/testsuite/
* ld-arm/vxworks1.ld: Swap .bss and .data.
	* ld-arm/vxworks1-lib.rd: Update accordingly.
	* ld-arm/vxworks1-lib.td: New test.
	* ld-arm/arm-elf.exp: Run it.

	* ld-i386/vxworks1.ld: Swap .bss and .data.
	* ld-i386/vxworks1-lib.rd: Update accordingly.
	* ld-i386/vxworks1-lib.td: New test.
	* ld-i386/i386.exp: Run it.

	* ld-mips-elf/vxworks1.ld: Swap .bss and .data.
	* ld-mips-elf/vxworks1-lib.rd: Update accordingly.
	* ld-mips-elf/vxworks1.rd: Likewise.

	* ld-powerpc/vxworks1.ld: Swap .bss and .data.
	* ld-powerpc/vxworks1-lib.rd: Update accordingly.
	* ld-powerpc/vxworks1-lib.td: New test.
	* ld-powerpc/powerpc.exp: Run it.

	* ld-sh/vxworks1.ld: Swap .bss and .data.
	* ld-sh/vxworks1-lib.rd: Update accordingly.
	* ld-sh/vxworks1-lib.td: New test.
	* ld-sh/sh-vxworks.exp: Run it.

	* ld-sparc/vxworks1.ld: Swap .bss and .data.
	* ld-sparc/vxworks1-lib.rd: Update accordingly.
	* ld-sparc/vxworks1-lib.td: New test.
	* ld-sparc/sparc.exp: Run it.
2007-05-15 12:22:34 +00:00
Richard Sandiford 224e2b28d4 ld/testsuite/
* ld-sh/vxworks1.dd: Remove hexadecimal prefixes from constant pool
	contents.  Consistently use "!" as the comment character.
	Consistently use _PROCEDURE_LINKAGE_TABLE_ in the first PLT entry.
	* ld-sh/vxworks1-le.dd: Likewise.
	* ld-sh/vxworks1-lib.dd: Likewise.
	* ld-sh/vxworks1-lib-le.dd: Likewise.
	* ld-sh/vxworks3.dd: Likewise.
	* ld-sh/vxworks3-le.dd: Likewise.
2007-05-14 12:07:11 +00:00
Kaz Kojima 683b7041b0 * ld-sh/ld-r-1.d: Update.
* ld-sh/shared-1.d: Likewise.
2007-03-23 00:00:23 +00:00
Kaz Kojima 3091e75f27 * ld-sh/sh64/abi32.xd, ld-sh/sh64/abi64.xd, ld-sh/sh64/cmpct1.xd,
* ld-sh/sh64/crange1.rd, ld-sh/sh64/crange2.rd,
	* ld-sh/sh64/crange3-cmpct.rd, ld-sh/sh64/crange3-media.rd,
	* ld-sh/sh64/crange3.rd, ld-sh/sh64/mix1.xd, ld-sh/sh64/mix2.xd,
	* ld-sh/sh64/shdl32.xd, ld-sh/sh64/shdl64.xd: Update for removal
	of empty sections.
2006-10-30 00:48:03 +00:00
Kaz Kojima 23bacdc9bf * gas/sh/sh64/syntax-1.d: Update.
* ld-sh/sh64/abi32.xd, ld-sh/sh64/abi64.xd, ld-sh/sh64/cmpct1.xd,
	* ld-sh/sh64/crange1.rd, ld-sh/sh64/crange2.rd,
	* ld-sh/sh64/crange3-cmpct.rd, ld-sh/sh64/crange3-media.rd,
	* ld-sh/sh64/crange3.rd, ld-sh/sh64/crangerel1.rd,
	* ld-sh/sh64/crangerel2.rd, ld-sh/sh64/mix1.xd,
	* ld-sh/sh64/mix2.xd, ld-sh/sh64/rel32.xd, ld-sh/sh64/rel64.xd,
	* ld-sh/sh64/reldl32.rd, ld-sh/sh64/reldl64.rd,
	* ld-sh/sh64/shdl32.xd, ld-sh/sh64/shdl64.xd: Update.
2006-10-22 01:19:06 +00:00
Kaz Kojima af4658dc3d * ld-sh/tlsbin-1.d: Update.
* ld-sh/tlspic-1.d: Likewise.
	* ld-sh/tlstpoff-1.d: Likewise.
2006-10-20 15:16:44 +00:00
Alan Modra 74541ad4c0 bfd/
* elf-bfd.h (struct elf_link_hash_table): Reorder.  Add
	text_index_section and data_index_section.
	(struct elf_backend_data): Add elf_backend_init_index_section.
	(_bfd_elf_init_1_index_section): Declare.
	(_bfd_elf_init_2_index_sections): Declare.
	* elfxx-target.h (elf_backend_init_index_section): Define.
	(elfNN_bed): Init new field.
	* elflink.c (_bfd_elf_link_omit_section_dynsym): Keep first tls
	section and text_index_section plus data_index_section.
	(_bfd_elf_link_renumber_dynsyms): Clear dynindx on omitted sections.
	(_bfd_elf_init_1_index_section): New function.
	(_bfd_elf_init_2_index_sections): New function.
	(bfd_elf_size_dynsym_hash_dynstr): Call elf_backend_init_index_section.
	(elf_link_input_bfd): When emitting relocs, use text_index_section
	and data_index_section for removed sections.
	* elf-m10300.c (elf_backend_omit_section_dynsym): Define.
	* elf32-i386.c: Likewise.
	* elf32-m32r.c: Likewise.
	* elf32-sh.c: Likewise.
	* elf32-xstormy16.c: Likewise.
	* elf32-xtensa.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elf64-hppa.c: Likewise.
	* elf64-mmix.c: Likewise.
	* elf64-sh64.c: Likewise.
	* elfxx-ia64.c: Likewise.
	* elf32-arm.c (elf32_arm_final_link_relocate): Use text_index_section
	and data_index_section sym for relocs against sections with no dynamic
	section sym.
	(elf_backend_init_index_section): Define.
	* elf32-cris.c: Similarly.
	* elf32-hppa.c: Similarly.
	* elf32-i370.c: Similarly.
	* elf32-m68k.c: Similarly.
	* elf32-mips.c: Similarly.
	* elf32-ppc.c: Similarly.
	* elf32-s390.c: Similarly.
	* elf32-sparc.c: Similarly.
	* elf32-vax.c: Similarly.
	* elf64-mips.c: Similarly.
	* elf64-ppc.c: Similarly.
	* elf64-s390.c: Similarly.
	* elf64-sparc.c: Similarly.
	* elf64-x86-64.c: Similarly.
	* elfn32-mips.c: Similarly.
	* elfxx-mips.c: Similarly.
	* elfxx-sparc.c: Similarly.
	* linker.c (fix_syms): Base symbols in removed sections on
	previous section in preference to using absolute section.

ld/
	* ldlang.c (strip_excluded_output_sections): Do strip sections
	that define syms, but don't ignore them.
	* ld.texinfo (Output Section Discarding): Revise.
	* emultempl/armcoff.em (gld${EMULATION_NAME}_finish): Always call
	finish_default.

ld/testsuite/
	Update for section sym changes.
2006-10-17 13:41:49 +00:00
Kaz Kojima aeb0c9c635 * ld-sh/tlspic-2.d: Update. 2006-09-29 12:37:28 +00:00
Richard Sandiford 55e6e39790 bfd/
2006-08-02  Richard Sandiford  <richard@codesourcery.com>
	    Kazu Hirata  <kazu@codesourcery.com>
	    Phil Edwards  <phil@codesourcery.com>
	    Nathan Sidwell  <nathan@codesourcery.com>

	* config.bfd (sh-*-vxworks): Use bfd_elf32_shvxworks_vec and
	bfd_elf32_shlvxworks_vec.
	* configure.in (bfd_elf32_sh64_vec): Add elf-vxworks.lo.
	(bfd_elf32_sh64l_vec, bfd_elf32_sh64lin_vec): Likewise.
	(bfd_elf32_sh64blin_vec, bfd_elf32_sh64lnbsd_vec): Likewise.
	(bfd_elf32_sh64nbsd_vec, bfd_elf32_sh_vec): Likewise.
	(bfd_elf32_shblin_vec, bfd_elf32_shl_vec): Likewise.
	(bfd_elf32_shl_symbian_vec, bfd_elf32_shlin_vec): Likewise.
	(bfd_elf32_shlnbsd_vec, bfd_elf32_shnbsd_vec): Likewise.
	(bfd_elf32_shlvxworks_vec, bfd_elf32_shvxworks_vec): New stanzas.
	* configure: Regenerate.
	* Makefile.am: Regenerate dependencies.
	* Makefile.in: Regenerate.
	* elf-vxworks.c (elf_vxworks_gott_symbol_p): New function.
	(elf_vxworks_add_symbol_hook): Use it.
	(elf_vxworks_link_output_symbol_hook): Likewise.  Use the hash
	table entry to check for weak undefined symbols and to obtain
	the original bfd.
	(elf_vxworks_emit_relocs): Use target_index instead of this_idx.
	* elf32-sh-relocs.h: New file, split from elf32-sh.c.
	(R_SH_DIR32): Use SH_PARTIAL32 for the partial_inplace field,
	SH_SRC_MASK32 for the src_mask field, and SH_ELF_RELOC for the
	special_function field.
	(R_SH_REL32): Use SH_PARTIAL32 and SH_SRC_MASK32 here too.
	(R_SH_REL32, R_SH_TLS_GD_32, R_SH_TLS_LD_32): Likewise.
	(R_SH_TLS_LDO_32, R_SH_TLS_IE_32, R_SH_TLS_LE_32): Likewise.
	(R_SH_TLS_DTPMOD32, R_SH_TLS_DTPOFF32, R_SH_TLS_TPOFF32): Likewise.
	(R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT): Likewise.
	(R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): Likewise.
	(SH_PARTIAL32, SH_SRC_MASK32, SH_ELF_RELOC): Undefine at end of file.
	* elf32-sh.c: Include elf32-vxworks.h.
	(MINUS_ONE): Define.
	(sh_elf_howto_table): Include elf32-sh-relocs.h with SH_PARTIAL32
	set to TRUE, SH_SRC_MASK32 set to 0xffffffff, and SH_ELF_RELOC set
	to sh_elf_reloc.
	(sh_vxworks_howto_table): New variable.  Include elf32-sh-relocs.h
	with SH_PARTIAL32 set to FALSE, SH_SRC_MASK32 set to 0, and
	SH_ELF_RELOC set to bfd_elf_generic_reloc.
	(vxworks_object_p, get_howto_table): New functions.
	(sh_elf_reloc_type_lookup): Fix typo.  Use get_howto_table.
	(sh_elf_info_to_howto): Use get_howto_table.
	(sh_elf_relax_section): Honor the partial_inplace field of the
	R_SH_DIR32 howto.
	(sh_elf_relax_delete_bytes): Likewise.
	(elf_sh_plt_info): New structure.
	(PLT_ENTRY_SIZE): Replace both definitions with...
	(ELF_PLT_ENTRY_SIZE): ...this new macro, with separate definitions for
	INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
	(elf_sh_plt0_entry_be): Update sizes of both definitions accordingly.
	(elf_sh_plt0_entry_le): Likewise.
	(elf_sh_plt_entry_be, elf_sh_plt_entry_le): Likewise.
	(elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): Likewise.
	(elf_sh_plts): New structure, with separate definitions for
	INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
	(elf_sh_plt0_entry): Delete both definitions.
	(elf_sh_plt_entry, elf_sh_pic_plt_entry): Likewise.
	(elf_sh_sizeof_plt, elf_sh_plt_plt0_offset): Likewise.
	(elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset): Likewise.
	(elf_sh_plt_reloc_offset): Likewise.
	(movi_shori_putval): Delete in favor of...
	(install_plt_field): ...this new function, with separate definitions
	for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
	(get_plt_info): New function, with separate definitions
	for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
	(elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset): Delete.
	(VXWORKS_PLT_HEADER_SIZE, VXWORKS_PLT_ENTRY_SIZE): New macros.
	(vxworks_sh_plt0_entry_be, vxworks_sh_plt0_entry_le): New constants.
	(vxworks_sh_plt_entry_be, vxworks_sh_plt_entry_le): Likewise.
	(vxworks_sh_pic_plt_entry_be, vxworks_sh_pic_plt_entry_le): Likewise.
	(get_plt_index, get_plt_offset): New functions.
	(elf_sh_link_hash_table): Add srelplt2, plt_info and vxworks_p fields.
	(sh_elf_link_hash_table_create): Initialize them.
	(sh_elf_create_dynamic_sections): Call
	elf_vxworks_create_dynamic_sections for VxWorks.
	(allocate_dynrelocs): Use htab->plt_info to get the size of PLT
	entries.  Allocate relocation entries in .rela.plt.unloaded if
	generating a VxWorks executable.
	(sh_elf_always_size_sections): New function.
	(sh_elf_size_dynamic_sections): Extend .rela.plt handling to
	.rela.plt.unloaded.
	(sh_elf_relocate_section): Use get_howto_table.  Honor
	partial_inplace when calculating the addend for dynamic
	relocations.  Use get_plt_index.
	(sh_elf_finish_dynamic_symbol): Use get_plt_index, install_plt_field
	and htab->plt_info.  Fill in the bra .plt offset for VxWorks
	executables.  Populate .rela.plt.unloaded.  Do not make
	_GLOBAL_OFFSET_TABLE_ absolute on VxWorks.
	(sh_elf_finish_dynamic_sections): Use install_plt_field and
	htab->plt_info.  Handle cases where there is no special PLT header.
	Populate the first relocation in .rela.plt.unloaded and fix up
	the remaining entries.
	(sh_elf_plt_sym_val): Use get_plt_info.
	(elf_backend_always_size_sections): Define.
	(TARGET_BIG_SYM, TARGET_BIG_NAME): Override for VxWorks.
	(TARGET_LITTLE_SYM, TARGET_BIG_SYM): Likewise.
	(elf32_bed, elf_backend_want_plt_sym): Likewise.
	(elf_symbol_leading_char, elf_backend_want_got_underscore): Likewise.
	(elf_backend_grok_prstatus, elf_backend_grok_psinfo): Likewise.
	(elf_backend_add_symbol_hook): Likewise.
	(elf_backend_link_output_symbol_hook): Likewise.
	(elf_backend_emit_relocs): Likewise.
	(elf_backend_final_write_processing): Likewise.
	(ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Likewise.
	* targets.c (bfd_elf32_shlvxworks_vec): Declare.
	(bfd_elf32_shvxworks_vec): Likewise.
	(_bfd_target_vector): Include bfd_elf32_shlvxworks_vec and
	bfd_elf32_shvxworks_vec.

gas/
	* config/tc-sh.c (apply_full_field_fix): New function.
	(md_apply_fix): Use it instead of md_number_to_chars.  Do not fill
	in fx_addnumber for BFD_RELOC_32_PLT_PCREL.
	(tc_gen_reloc): Use fx_addnumber rather than 0 as the default case.
	* config/tc-sh.h (TARGET_FORMAT): Override for TE_VXWORKS.

ld/
2006-08-02  Richard Sandiford  <richard@codesourcery.com>
	    Kazu Hirata  <kazu@codesourcery.com>
	    Phil Edwards  <phil@codesourcery.com>

	* Makefile.am (ALL_EMULATIONS): Add eshelf_vxworks.o and
	eshlelf_vxworks.o.
	(eshelf_vxworks.c, eshlelf_vxworks.c): New rules.
	* Makefile.in: Regenerate.
	* configure.tgt (sh-*-vxworks): Use shelf_vxworks and
	shlelf_vxworks.
	* emulparams/shelf_vxworks.sh: New file.
	* emulparams/shlelf_vxworks.sh: Likewise.
	* emulparams/vxworks.sh (FINI): Prefix _etext with ${SYMPREFIX}.
	(OTHER_END_SYMBOLS): Likewise _ehdr.
	(DATA_END_SYMBOLS): Likewise _edata.
	* emultempl/vxworks.em (vxworks_after_open): Check whether output_bfd
	is indeed an ELF file before dealing with --force-dynamic.

ld/testsuite/
	* ld-sh/rd-sh.exp: Treat vxworks1-static.d specially.
	* ld-sh/sh-vxworks.exp: New file.
	* ld-sh/sh.exp: Extend sh-linux SIZEOF_HEADERS handling to
	sh-*-vxworks.
	* ld-sh/vxworks1-le.dd, ld-sh/vxworks1-lib-le.dd,
	* ld-sh/vxworks1-lib.dd, ld-sh/vxworks1-lib.nd,
	* ld-sh/vxworks1-lib.rd, ld-sh/vxworks1-lib.s,
	* ld-sh/vxworks1-static.d, ld-sh/vxworks1.dd,
	* ld-sh/vxworks1.ld, ld-sh/vxworks1.rd, ld-sh/vxworks1.s,
	* ld-sh/vxworks2-static.sd, ld-sh/vxworks2.s,
	* ld-sh/vxworks2.sd, ld-sh/vxworks3-le.dd,
	* ld-sh/vxworks3-lib-le.dd, ld-sh/vxworks3-lib.dd,
	* ld-sh/vxworks3-lib.s, ld-sh/vxworks3.dd, ld-sh/vxworks3.s,
	* ld-sh/vxworks4.d, ld-sh/vxworks4a.s, ld-sh/vxworks4b.s,
	* ld-sh/reloc1.s, ld-sh/reloc1.d: New tests.
2006-08-04 13:13:56 +00:00
Nick Clifton 3e4cf9243a * ld-sh/arch/arch.exp (test_arch): Set the endian flag to suit the multilib
being tested.
2006-07-21 09:56:40 +00:00
H.J. Lu d72d9b9e57 Updo the last change to binutils and ld/testsuite. 2006-02-02 22:53:46 +00:00
H.J. Lu de205c03b9 binutils/
2006-02-02  H.J. Lu  <hongjiu.lu@intel.com>

	* readelf.c (process_program_headers): Undo the change made on
	2004-09-22.  Match PT_DYNAMIC segment only with SHT_DYNAMIC
	sections.

ld/testsuite/

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

	* ld-i386/tlsbin.rd: Update for changed segment map.
	* ld-i386/tlsnopic.rd: Likewise.
	* ld-i386/tlspic.rd: Likewise.
	* ld-powerpc/tlsexe.r: Likewise.
	* ld-powerpc/tlsexe32.r: Likewise.
	* ld-powerpc/tlsexetoc.r: Likewise.
	* ld-powerpc/tlsso.r: Likewise.
	* ld-powerpc/tlsso32.r: Likewise.
	* ld-powerpc/tlstocso.r: Likewise.
	* ld-s390/tlsbin.rd: Likewise.
	* ld-s390/tlsbin_64.rd: Likewise.
	* ld-s390/tlspic.rd: Likewise.
	* ld-s390/tlspic_64.rd: Likewise.
	* ld-sh/tlsbin-2.d: Likewise.
	* ld-sh/tlspic-2.d: Likewise.
	* ld-x86-64/tlsbin.rd: Likewise.
	* ld-x86-64/tlspic.rd: Likewise.
2006-02-02 22:05:56 +00:00
Alan Modra 85167a847e Adjust for dynamic sym changes. 2005-08-15 15:39:48 +00:00
Nick Clifton 75be928bd2 Update FSF addresses 2005-05-12 07:32:09 +00:00
Nick Clifton ee58dd1ec5 Replace linux-gnu with linux-* to allow for versions of Linux which do not use
glibc.
2005-05-05 10:29:16 +00:00
H.J. Lu 57316bff0a bfd/
2005-03-16  H.J. Lu  <hongjiu.lu@intel.com>

	* elflink.c (elf_mark_used_section): New.
	(bfd_elf_gc_sections): Call elf_gc_mark_section for
	non-relocatable link if we don't do GC.

include/

2005-03-16  H.J. Lu  <hongjiu.lu@intel.com>

	* bfdlink.h (bfd_link_info): Add gc_sections.

ld/

2005-03-16  H.J. Lu  <hongjiu.lu@intel.com>

	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Remove
	unused empty output sections for non-relocatable link.

	* ld.h (args_type): Remove gc_sections.

	* ldlang.c (lang_mark_used_section): New.
	(lang_gc_sections): Use link_info.gc_sections instead of
	command_line.gc_sections.
	* ldmain.c (main): Likewise.
	* lexsup.c (parse_args): Likewise.
	* ldlang.c (lang_process): Call lang_mark_used_section.

	* ldmain.c (main): Initialize link_info.gc_sections to FALSE.

ld/testsuite/

2005-03-16  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-alpha/tlsbin.rd: Updated for empty section removal.
	* ld-alpha/tlsbinr.rd: Likewise.
	* ld-alpha/tlspic.rd: Likewise.
	* ld-arm/mixed-lib.sym: Likewise.
	* ld-i386/tlsbin.rd: Likewise.
	* ld-i386/tlsnopic.rd: Likewise.
	* ld-i386/tlspic.rd: Likewise.
	* ld-ia64/tlsbin.rd: Likewise.
	* ld-ia64/tlspic.rd: Likewise.
	* ld-powerpc/apuinfo.rd: Likewise.
	* ld-powerpc/powerpc.exp: Likewise.
	* ld-powerpc/tlsexe32.r: Likewise.
	* ld-s390/tlsbin.rd: Likewise.
	* ld-s390/tlsbin_64.rd: Likewise.
	* ld-s390/tlspic.rd: Likewise.
	* ld-s390/tlspic_64.rd: Likewise.
	* ld-sh/tlsbin-2.d: Likewise.
	* ld-sh/tlspic-2.d: Likewise.
	* ld-sparc/tlssunbin32.rd: Likewise.
	* ld-sparc/tlssunnopic32.rd: Likewise.
	* ld-sparc/tlssunpic32.rd: Likewise.
	* ld-x86-64/tlsbin.rd: Likewise.
	* ld-x86-64/tlspic.rd: Likewise.
2005-03-16 21:52:48 +00:00
Alan Modra aef6203bd6 update copyright dates 2005-03-03 11:52:12 +00:00
Nick Clifton e38bc3b524 Fix SH2A machine variants in order to correctly select instruction inheritance 2005-01-17 14:08:17 +00:00
Kaz Kojima 15dd0fe8d4 * ld-sh/shared-1.d: Update for changed dynamic syms.
* ld-sh/sh64/gotplt.d: Likewise.
	* ld-sh/sh64/init-cmpct.d: Likewise.
	* ld-sh/sh64/init-media.d: Likewise.
	* ld-sh/sh64/init64.d: Likewise.
2005-01-11 23:55:14 +00:00
Alan Modra 5c799c0790 bfd/
* elfcode.h (elf_slurp_symbol_table): Use bfd_elf_sym_name so that
	canonical sections syms have a name.

gas/testsuite/
	Update for changed section syms.

ld/testsuite/
	Update for changed section syms.
2004-12-11 04:32:37 +00:00
Alan Modra cbaa0dc574 binutils/
* readelf.c (process_program_headers): Don't include .tbss in non-TLS
	segments.

ld/testsuite/
	* ld-i386/tlsbin.rd: Update for changed segment map.
	* ld-i386/tlsnopic.rd: Likewise.
	* ld-i386/tlspic.rd: Likewise.
	* ld-powerpc/tlsexe.r: Likewise.
	* ld-powerpc/tlsexe32.r: Likewise.
	* ld-powerpc/tlsexetoc.r: Likewise.
	* ld-powerpc/tlsso.r: Likewise.
	* ld-powerpc/tlsso32.r: Likewise.
	* ld-powerpc/tlstocso.r: Likewise.
	* ld-s390/tlsbin.rd: Likewise.
	* ld-s390/tlsbin_64.rd: Likewise.
	* ld-s390/tlspic.rd: Likewise.
	* ld-s390/tlspic_64.rd: Likewise.
	* ld-sh/tlsbin-2.d: Likewise.
	* ld-sh/tlspic-2.d: Likewise.
	* ld-x86-64/tlsbin.rd: Likewise.
	* ld-x86-64/tlspic.rd: Likewise.
2004-09-22 07:24:14 +00:00
Alan Modra b301b24869 bfd/
* elf.c (IS_LOADED): Define.
	(assign_file_positions_for_segments): Don't round up file offset of
	PT_LOAD segments containing no SEC_LOAD sections, instead round down.
	Delete code handling link script adjustment of lma.  Do the adjust
	in later code handling similar ajustments.  Remove dead code error
	check.  Warn if section lma would require a negative offset
	adjustment.  Tweak lma adjustment to use p_filesz rather than p_memsz.
	Use p_vaddr + p_memsz inside section loop in place of voff.  Don't
	update voff in section loop.  Change voff in segment loop to be an
	adjustment on top of "off".  Set sec->filepos and update "off" later.
	Test for loadable sections consistently using IS_LOADED.  Similarly,
	test for alloc-only sections other than .tbss consistently.
	Don't bother checking SEC_ALLOC in PT_LOAD segments.  Remove FIXME.
	Tidy PT_NOTE handling.  Use %B and %A in error messages.
	(assign_file_positions_except_relocs): Use %B in error message.

ld/testsuite/
	* ld-scripts/overlay-size.d: Don't check .mbss lma.
	* ld-sh/sh64/mix1.xd: Update for changed .bss file offset.
	* ld-sh/sh64/shdl32.xd: Likewise.
	* ld-sh/sh64/shdl64.xd: Likewise.
2004-09-22 06:45:39 +00:00
Kaz Kojima ff636ee388 [gas/testsuite]
* gas/sh/basic.exp: Don't do sh2a test for sh5.
	* gas/sh/sh2a.d: Match elf32-sh* format too.

[ld/testsuite]
	* ld-sh/sh64/crange3-cmpct.rd: Update.
	* ld-sh/sh64/crange3-media.rd: Update.
2004-07-30 00:29:22 +00:00
Kaz Kojima f6a8ae8136 * emulparams/shlelf32_linux.sh (COMMONPAGESIZE): Set to 4KB.
* ld-elf/frame.exp: Don't run on sh*-*-elf*.
	* ld-sh/shared-1.d: Adjust for section reordering changes.
	* ld-sh/shared-2.d: Likewise.
	* ld-sh/tlsbin-2.d: Likewise.
	* ld-sh/tlspic-2.d: Likewise.
	* ld-sh/sh64/abi32.xd: Likewise.
	* ld-sh/sh64/abi64.xd: Likewise.
	* ld-sh/sh64/cmpct1.xd: Likewise.
	* ld-sh/sh64/crange1.rd: Likewise.
	* ld-sh/sh64/crange2.rd: Likewise.
	* ld-sh/sh64/crange3-cmpct.rd: Likewise.
	* ld-sh/sh64/crange3-media.rd: Likewise.
	* ld-sh/sh64/crange3.rd: Likewise.
	* ld-sh/sh64/gotplt.d: Likewise.
	* ld-sh/sh64/init-cmpct.d: Likewise.
	* ld-sh/sh64/init-media.d: Likewise.
	* ld-sh/sh64/init64.d: Likewise.
	* ld-sh/sh64/mix1.xd: Likewise.
	* ld-sh/sh64/mix2.xd: Likewise.
	* ld-sh/sh64/shdl32.xd: Likewise.
	* ld-sh/sh64/shdl64.xd: Likewise.
2004-07-02 11:25:54 +00:00
Joern Rennecke 5b9b7d8109 gas/testsuite:
Actually add these files:
	2004-05-28  Andrew Stubbs <andrew.stubbs@superh.com>
	* testsuite/gas/sh/arch: New directory.
	* testsuite/gas/sh/arch/arch.exp: New test script.
	* testsuite/gas/sh/arch/arch_expected.txt: New file.
	* testsuite/gas/sh/arch/sh.s: New file.
	* testsuite/gas/sh/arch/sh2.s: New file.
	* testsuite/gas/sh/arch/sh-dsp.s: New file.
	* testsuite/gas/sh/arch/sh2e.s: New file.
	* testsuite/gas/sh/arch/sh3-nommu.s: New file.
	* testsuite/gas/sh/arch/sh3.s: New file.
	* testsuite/gas/sh/arch/sh3-dsp.s: New file.
	* testsuite/gas/sh/arch/sh3e.s: New file.
	* testsuite/gas/sh/arch/sh4-nommu-nofpu.s: New file.
	* testsuite/gas/sh/arch/sh4-nofpu.s: New file.
	* testsuite/gas/sh/arch/sh4.s: New file.
	* testsuite/gas/sh/arch/sh4a-nofpu.s: New file.
	* testsuite/gas/sh/arch/sh4al-dsp.s: New file.
ld/testsuite:
	Actually add these files:
	2004-05-28  Andrew Stubbs <andrew.stubbs@superh.com>
	* testsuite/ld-sh/arch/arch.exp: New test script.
	* testsuite/ld-sh/arch/arch_expected.txt: New file.
	* testsuite/ld-sh/arch/sh.s: New file.
	* testsuite/ld-sh/arch/sh2.s: New file.
	* testsuite/ld-sh/arch/sh-dsp.s: New file.
	* testsuite/ld-sh/arch/sh2e.s: New file.
	* testsuite/ld-sh/arch/sh3-nommu.s: New file.
	* testsuite/ld-sh/arch/sh3.s: New file.
	* testsuite/ld-sh/arch/sh3-dsp.s: New file.
	* testsuite/ld-sh/arch/sh3e.s: New file.
	* testsuite/ld-sh/arch/sh4-nommu-nofpu.s: New file.
	* testsuite/ld-sh/arch/sh4-nofpu.s: New file.
	* testsuite/ld-sh/arch/sh4.s: New file.
	* testsuite/ld-sh/arch/sh4a-nofpu.s: New file.
	* testsuite/ld-sh/arch/sh4al-dsp.s: New file.
	* testsuite/ld-sh/arch/sh4a.s: New file.
2004-06-29 16:35:05 +00:00
Kaz Kojima 2f2f4511bd * ld-sh/tlsbin-2.d: Adjust for section reordering changes
and removal of unneeded STT_SECTION symbols from .dynsym.
	* ld-sh/tlsbin-3.d: Likewise.
	* ld-sh/tlspic-2.d: Likewise.
2004-05-12 05:58:09 +00:00
Ben Elliston b24f926d5b * ld-sh/sh64/relax.exp: Remove stray semicolons.
* ld-sh/sh64/relfail.exp: Likewise.
	* lib/ld-lib.exp: Likewise.
2004-05-12 03:08:09 +00:00
Kaz Kojima 7e415deb05 * ld-sh/sh64/crange1.rd: Update sh_info to decimal.
* ld-sh/sh64/crange2.rd: Likewise.
	* ld-sh/sh64/crange3.rd: Likewise.
	* ld-sh/sh64/crange3-cmpct.rd: Likewise.
	* ld-sh/sh64/crange3-media.rd: Likewise.
	* ld-sh/sh64/crangerel1.rd: Likewise.
	* ld-sh/sh64/crangerel2.rd: Likewise.
2004-05-06 00:13:39 +00:00
Kaz Kojima 1f1799d5ad bfd/
* elf32-sh.c (sh_elf_plt_sym_val): New function.
	(elf_backend_plt_sym_val): Define.

opcodes/
	* sh-dis.c (print_insn_sh): Print the value in constant pool
	as a symbol if it looks like a symbol.

gas/testsuite/
	* gas/sh/pcrel2.d: Update.
	* gas/sh/tlsd.d: Update.
	* gas/sh/tlsnopic.d: Update.
	* gas/sh/tlspic.d: Update.

ld/testsuite/
	* ld-sh/tlsbin-1.d: Update
	* ld-sh/tlspic-1.d: Update.
2004-04-23 02:47:39 +00:00
Kaz Kojima f60ec7acea * ld-sh/sh64/shmix-1.s: Add align to match data alignment.
* ld-sh/sh64/shmix-3.s: Likewise.
	* ld-sh/sh64/mix1.sd: Update.
	* ld-sh/sh64/mix1.xd: Likewise.
	* ld-sh/sh64/mix1-noexp.sd: Likewise.
	* ld-sh/sh64/mix2.sd: Likewise.
	* ld-sh/sh64/mix2.xd: Likewise.
	* ld-sh/sh64/mix2-noexp.sd: Likewise.
2003-12-01 12:01:22 +00:00
Alan Modra a2b2bf0e86 Update for changed section alignment. 2003-12-01 06:56:51 +00:00
Kaz Kojima 46e993b970 [bfd]
* elf32-sh.c (sh_elf_relocate_section): Handle R_SH_IMM_*_PCREL
	relocations.
	(sh_elf_check_relocs): Likewise.

	* elf32-sh64.c (elf_backend_merge_symbol_attribute): Define.
	(sh64_elf_merge_symbol_attribute): New.
	* elf64-sh64.c (elf_backend_merge_symbol_attribute): Define.
	(sh64_elf64_merge_symbol_attribute): New.

[ld/testsuite]
	* ld-sh/sh64/rd-sh64.exp: If the test matches *-dso.d, copy
	the output of linker to the file tmpdir/*-dso.so.
	* ld-sh/sh64/stobin-0-dso.d: New.
	* ld-sh/sh64/stobin-1.d: New.
	* ld-sh/sh64/stobin.s: New.
	* ld-sh/sh64/stolib.s: New.
2003-10-15 06:23:55 +00:00
Kaz Kojima f19ae42f43 [ld]
* emulparams/shelf32_nbsd.sh (OTHER_SECTIONS): Redefine.

[ld/testsuite]
	* ld-sh/rd-sh.exp (LDFLAGS): Define appropriately for each
	sh64/sh5 targets.
	* ld-sh/sh.exp: Don't do relaxing test for sh64*-*-* and
	sh5*-*-* targets.
	* ld-sh/sh64/relax.exp (emul32): Set to shelf32_nbsd for netbsd.
	* ld-sh/sh64/relfail.exp: Set parameters for netbsd.
	* ld-sh/sh64/sh64.exp: Skip this for netbsd.  Trim the section
	numbers for crangerel1 and crengerel2 tests.
	* ld-sh/sh64/abi32.sd: Update.
	* ld-sh/sh64/abi32.xd: Likewise.
	* ld-sh/sh64/abi64.sd: Likewise.
	* ld-sh/sh64/abi64.xd: Likewise.
	* ld-sh/sh64/abixx-noexp.sd: Likewise.
	* ld-sh/sh64/cmpct1.sd: Likewise.
	* ld-sh/sh64/cmpct1.xd: Likewise.
	* ld-sh/sh64/crange1.rd: Likewise.
	* ld-sh/sh64/crange2.rd: Likewise.
	* ld-sh/sh64/crange3-cmpct.rd: Likewise.
	* ld-sh/sh64/crange3-media.rd: Likewise.
	* ld-sh/sh64/crange3.rd: Likewise.
	* ld-sh/sh64/crangerel1.rd: Likewise.
	* ld-sh/sh64/crangerel2.rd: Likewise.
	* ld-sh/sh64/dlsection.sd: Likewise.
	* ld-sh/sh64/endian.sbd: Likewise.
	* ld-sh/sh64/endian.sld: Likewise.
	* ld-sh/sh64/gotplt.d: Likewise.
	* ld-sh/sh64/init-cmpct.d: Likewise.
	* ld-sh/sh64/init-media.d: Likewise.
	* ld-sh/sh64/init.s: Align functions.
	* ld-sh/sh64/init64.d: Update.
	* ld-sh/sh64/mix1-noexp.sd: Likewise.
	* ld-sh/sh64/mix1.sd: Likewise.
	* ld-sh/sh64/mix1.xd: Likewise.
	* ld-sh/sh64/mix2-noexp.sd: Likewise.
	* ld-sh/sh64/mix2.sd: Likewise.
	* ld-sh/sh64/mix2.xd:Likewise.
	* ld-sh/sh64/rel32.xd: Likewise.
	* ld-sh/sh64/rel64.xd: Likewise.
	* ld-sh/sh64/reldl32.rd: Likewise.
	* ld-sh/sh64/reldl64.rd: Likewise.
	* ld-sh/sh64/shdl32.xd: Update.
	* ld-sh/sh64/shdl64.sd: Likewise.
	* ld-sh/sh64/shdl64.xd: Likewise.
	* ld-sh/shared-1.d: Add -z nocombreloc to ld option.  Update.
	* ld-sh/sub2l-1.d: Make file format match with elf32-sh.*.
	* ld-sh/weak1.d: Likewise.
2003-10-13 05:09:21 +00:00
Kaz Kojima 866f48b717 * elf32-sh.c (sh_elf_check_relocs): Don't set DF_TEXTREL here.
* ld-sh/shared-2.d, ld-sh/textrel1.s, ld-sh/textrel2.s: New test.
2003-08-02 13:46:44 +00:00
Kaz Kojima 267fb3c1ce * elf32-sh.c (tpoff): New.
(struct elf_sh_dyn_relocs): Remove tls_tpoff32.
	(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
        (allocate_dynrelocs): Don't make unnecessary dynamic TLS
	relocations.  Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses.
        (sh_elf_relocate_section): Likewise. Remove unnecessary tests.
	(dtpoff_base): Fix wrong indentation.
	(sh_elf_check_relocs): Don't set DF_STATIC_TLS flag with non-TLS
	relocations.  Don't set tls_tpoff32 flag.  Don't make unnecessary
	R_SH_TLS_TPOFF32 relocations.

	* ld-sh/tlsbin-1.d, ld-sh/tlsbin-2.d, ld-sh/tlsbin-3.d,
	ld-sh/tlstpoff-1.d, ld-sh/tlstpoff-2.d: Update for removing
	unnecessary TLS relocs.
2003-04-24 05:19:09 +00:00
Joern Rennecke ef23021837 bfd:
* archures.c (enum bfd_architecture): Amend comment to refer to SuperH.
        * cpu-sh.c: Likewise.
        * elf32-sh.c: Likewise.
        * reloc.c (bfd_reloc_code_real): Likewise.
        * elf32-sh64-com.c: Change comment to refer to SuperH.
        * elf32-sh64.c: Likewise.
        * elf64-sh64.c: Likewise.
        * bfd-in2.h (enum bfd_architecture): Regenerate.
binutils:
        * readelf.c (get_machine_name) <EM_SH>: Amend return value
        to refer to SuperH.
gas:
        * config/tc-sh.c: Amend comment to refer to SuperH.
        * config/tc-sh.h: Likewise.
        (LISTING_HEADER): Amend to refer to SuperH.
        * config/tc-sh64.c: Change comment to refer to SuperH.
        * config/tc-sh64.h (LISTING_HEADER): Change to refer to SuperH.
        * doc/as.texinfo [SH, GENERIC]: Amend / Change to refer to SuperH.
        * doc/c-sh.texi: Amend to refer to SuperH.
        Add SuperH architecture documentation references.
        * doc/c-sh64.texi: Change to refer to SuperH.
include/elf:
        * common.h (EM_SH): Amend comment to refer to SuperH.
ld/testsuite:
        * ld-sh/sh64/crange3-cmpct.rd (Machine): Change to refer to SuperH.
        * ld-sh/sh64/crange3-media.rd (Machine): Likewise.
2003-04-23 21:09:04 +00:00
Nick Clifton c2dcd04ec8 Replace occurrances of 'Hitachi' with 'Renesas'. 2003-04-15 08:51:55 +00:00
Daniel Jacobowitz 878a91906b * ld-discard/extern.s, ld-discard/start.s, ld-discard/static.s,
ld-sh/refdbg.s: Add leading 0 to .debug_info to prevent parsing it
	for error messages.
2003-04-13 14:42:22 +00:00
Kaz Kojima 0f85b45c31 * ld-sh/tlstpoff-1.d: New.
* ld-sh/tlstpoff-2.d: New.
	* ld-sh/tlstpoff1.s: New.
	* ld-sh/tlstpoff2.s: New.
2003-02-10 22:19:26 +00:00