aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-sh.c
AgeCommit message (Collapse)AuthorFilesLines
2004-04-23bfd/Kaz Kojima1-0/+12
* 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-03-27 * Makefile.am: Remove all mention of elflink.h.Alan Modra1-18/+7
* Makefile.in: Regenerate. * bfd-in.h (bfd_elf_discard_info): Declare. (bfd_elf32_discard_info, bfd_elf64_discard_info): Delete. * bfd-in2.h: Regenerate. * elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol, bfd_elf32_link_record_dynamic_symbol, bfd_elf64_link_record_dynamic_symbol, _bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link, bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol, _bfd_elf32_link_record_local_dynamic_symbol, _bfd_elf64_link_record_local_dynamic_symbol, _bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets, _bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link, _bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry, _bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets, _bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry, _bfd_elf32_reloc_symbol_deleted_p, _bfd_elf64_reloc_symbol_deleted_p): Delete. (bfd_elf_link_record_dynamic_symbol, bfd_elf_link_record_local_dynamic_symbol, bfd_elf_final_link, bfd_elf_gc_sections, bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry, bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link, bfd_elf_reloc_symbol_deleted_p): Declare. (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. * elf32-arm.h: Update for changed function names. Remove local WILL_CALL_FINISH_DYNAMIC_SECTION define. * elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c, * elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c, * elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c, * elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c, * elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c, * elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c, * elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, * elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise. * elfxx-target.h (bfd_elfNN_bfd_final_link): Define. (bfd_elfNN_print_symbol): Define. * elfcode.h: Don't include elflink.h. (elf_bfd_discard_info, elf_reloc_symbol_deleted_p, elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections, elf_gc_common_finalize_got_offsets, elf_gc_common_final_link, elf_gc_record_vtinherit, elf_gc_record_vtentry, elf_link_record_local_dynamic_symbol): Don't define. * elflink.c: Update for changed function names. Move elflink.h code here. * elflink.h: Delete file. * po/SRC-POTFILES.in: Regenerate. * po/bfd.pot: Regenerate. doc/ * bfdint.texi: Remove all mention of elflink.h.
2004-03-25bfd/Alan Modra1-1/+1
* elflink.h (elf_link_add_object_symbols): Add DT_NEEDED for as-needed and chained shared libs only if dynsym. Clear dynsym on forced-local. * elf-bfd.h (_bfd_elf_add_dynamic_entry): Declare. (bfd_elf32_add_dynamic_entry, bfd_elf64_add_dynamic_entry): Delete. (_bfd_elf_add_dt_needed_tag): Declare. (_bfd_elf_sort_symbol): Declare. (_bfd_elf_finalize_dynstr): Declare. (RELOC_FOR_GLOBAL_SYM): Formatting. * elfcode.h (elf_add_dynamic_entry): Delete. * elflink.c (_bfd_elf_add_dynamic_entry): New function. Corresponding elflink.h function converted to use elf_size_info. (_bfd_elf_add_dt_needed_tag): Likewise. (_bfd_elf_sort_symbol): Likewise. (_bfd_elf_finalize_dynstr): Likewise. (compute_bucket_count): Likewise. (bfd_elf_size_dynamic_sections): Likewise. Check result of _bfd_elf_strtab_add before calling _bfd_elf_strtab_addref. (elf_adjust_dynstr_offsets, elf_collect_hash_codes): Moved from.. * elflink.h: ..here. (sort_symbol, add_dt_needed_tag): Delete. (elf_add_dynamic_entry, elf_finalize_dynstr): Delete. (compute_bucket_count, NAME(bfd_elf,size_dynamic_sections)): Delete. Update all users. * elf32-arm.h (add_dynamic_entry): Update. Remove casts. * elf32-cris.c (add_dynamic_entry): Likewise. * elf32-hppa.c (add_dynamic_entry): Likewise. * elf32-i370.c (add_dynamic_entry): Likewise. * elf32-i386.c (add_dynamic_entry): Likewise. * elf32-m32r.c (add_dynamic_entry): Likewise. * elf32-m68k.c (add_dynamic_entry): Likewise. * elf32-ppc.c (add_dynamic_entry): Likewise. * elf32-s390.c (add_dynamic_entry): Likewise. * elf32-sh.c (add_dynamic_entry): Likewise. * elf32-sparc.c (add_dynamic_entry): Likewise. * elf32-vax.c (add_dynamic_entry): Likewise. * elf32-xtensa.c (add_dynamic_entry): Likewise. * elf64-alpha.c (add_dynamic_entry): Likewise. * elf64-hppa.c (add_dynamic_entry): Likewise. * elf64-ppc.c (add_dynamic_entry): Likewise. * elf64-s390.c (add_dynamic_entry): Likewise. * elf64-sparc.c (add_dynamic_entry): Likewise. * elf64-x86-64.c (add_dynamic_entry): Likewise. * elfxx-ia64.c (add_dynamic_entry): Likewise. * elfxx-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Likewise. * elf32-frv.c (elf32_frv_size_dynamic_sections): Likewise. * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. ld/ * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Update size_dynamic_sections call.
2004-03-20bfd/H.J. Lu1-4/+2
2004-03-20 H.J. Lu <hongjiu.lu@intel.com> * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Report error if unresolved symbols in objects aren't allowed. * elf-hppa.h (elf_hppa_relocate_section): Properly handle unresolved symbols. (elf_hppa_remark_useless_dynamic_symbols): Likewise. (elf_hppa_unmark_useless_dynamic_symbols): * elf32-frv.c (elf32_frv_relocate_section): Likewise. * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. (elf32_hppa_relocate_section): Likewise. * elf32-i370.c (i370_elf_relocate_section): Likewise. * elf32-m32r.c (m32r_elf_relocate_section): Likewise. * elf32-sh.c (sh_elf_relocate_section): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Likewise. * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. * elf-m10200.c (mn10200_elf_relocate_section): Use RELOC_FOR_GLOBAL_SYMBOL. * elf32-avr.c (elf32_avr_relocate_section): Likewise. * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. * elf32-fr30.c (fr30_elf_relocate_section): Likewise. * elf32-h8300.c (elf32_h8_relocate_section): Likewise. * elf32-i860.c (elf32_i860_relocate_section): Likewise. * elf32-m68hc1x.c (m68hc11_get_relocation_value): Likewise. * elf32-mcore.c (mcore_elf_relocate_section): Likewise. * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. * elf32-v850.c (v850_elf_relocate_section): Likewise. * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. * elf64-mmix.c (mmix_elf_relocate_section): Likewise. include/ 2004-03-20 H.J. Lu <hongjiu.lu@intel.com> * bfdlink.h (bfd_link_info): Correct comments for the unresolved_syms_in_objects field. ld/ 2004-03-20 H.J. Lu <hongjiu.lu@intel.com> * lexsup.c (parse_args): Don't set unresolved_syms_in_objects or unresolved_syms_in_shared_libs for -Bdynamic and -Bstatic.
2004-03-032003-03-03 Andrew Stubbs <andrew.stubbs@superh.com>Joern Rennecke1-1/+4
opcodes: * sh-dis.c (print_insn_sh): Don't disassemble fp instructions in nofpu mode. Add BFD type bfd_mach_sh4_nommu_nofpu. * sh-opc.h: Add sh4_nommu_nofpu architecture and adjust instructions accordingly. bfd: * archures.c: Add bfd_mach_sh4_nommu_nofpu. * cpu-sh.c: Ditto. * elf32-sh.c: Ditto. * bfd-in2.h: Regenerate. include/elf: * sh.h: Add EF_SH4_NOMMU_NOFPU. gas: * config/tc-sh.c (md_parse_option): Add -isa=sh4-nofpu and -isa=sh4-nommu-nofpu options. Adjust help messages accordingly. (sh_elf_final_processing): Output BFD type sh4_nofpu if that is the most general type or the user specifically requested it. (md_assemble): Add a new error message for when an instruction is understood, but is not allowed due to an -isa option.
2003-12-04 * elf32-i386.c (elf_i386_object_p): Delete.Alan Modra1-13/+1
(elf_backend_object_p): Don't define. * elf32-s390.c (elf_s390_object_p): No need to alloc tdata here. * elf32-sh.c (sh_elf_object_p): Likewise. * elf32-sparc.c (elf32_sparc_object_p): Likewise. * elf64-alpha.c (elf64_alpha_object_p): Likewise. * elf64-s390.c (elf_s390_object_p): Likewise. * elf64-x86-64.c (elf64_x86_64_elf_object_p): Likewise.
2003-11-27 * elf32-arm.h: Fix comment typos.Kazu Hirata1-4/+4
* elf32-d30v.c: Likewise. * elf32-dlx.c: Likewise. * elf32-h8300.c: Likewise. * elf32-i370.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-mcore.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-sh.c: Likewise. * elf32-v850.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-mips.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-sparc.c: Likewise. * elflink.c: Likewise. * elflink.h: Likewise. * elfn32-mips.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise.
2003-11-17 * elf.c (_bfd_elf_link_hash_copy_indirect): CopyDaniel Jacobowitz1-1/+2
ELF_LINK_HASH_NEEDS_PLT. Fix formatting. * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Likewise. * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise. * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise. * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise. * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise. * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. * elf32-xtensa.c (elf_xtensa_copy_indirect_symbol): Remove. (elf_backend_copy_indirect_symbol): Don't define.
2003-11-05 * elf.c (_bfd_elf_rela_local_sym): Accept asection **, and returnAlan Modra1-1/+1
updated section in case of merged section. * elf-bfd.h (_bfd_elf_rela_local_sym): Update declaration. * elf-hppa.h (elf_hppa_relocate_section): Adjust call. * elf-m10200.c (mn10200_elf_relocate_section): Likewise. * elf-m10300.c (mn10300_elf_relocate_section): Likewise. * elf32-arm.h (elf32_arm_relocate_section): Likewise. * elf32-avr.c (elf32_avr_relocate_section): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. * elf32-fr30.c (fr30_elf_relocate_section): Likewise. * elf32-frv.c (elf32_frv_relocate_section): Likewise. * elf32-h8300.c (elf32_h8_relocate_section): Likewise. * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. * elf32-i370.c (i370_elf_relocate_section): Likewise. * elf32-i860.c (elf32_i860_relocate_section): Likewise. * elf32-m32r.c (m32r_elf_relocate_section): Likewise. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-mcore.c (mcore_elf_relocate_section): Likewise. * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf32-s390.c (elf_s390_relocate_section): Likewise. * elf32-sh.c (sh_elf_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. * elf32-v850.c (v850_elf_relocate_section) Likewise. * elf32-vax.c (elf_vax_relocate_section): Likewise. * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. * elf64-mmix.c (mmix_elf_relocate_section): Likewise. * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. * elf64-s390.c (elf_s390_relocate_section): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Likewise. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. * elf32-cris.c (cris_elf_relocate_section): Don't recalculate symbol section for reloc output. * elf32-i370.c (i370_elf_relocate_section): Likewise. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. * elf32-vax.c (elf_vax_relocate_section): Likewise. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Don't recalculate everything for R_PPC_RELAX32 reloc. Don't bother checking ppc_elf_install_value return value. * elf64-ppc.c (ppc64_elf_relocate_section <R_PPC64_TOC>): Sanity check sec->id.
2003-11-04 * bfd-in.h (_bfd_elf_tls_setup): Declare.Alan Modra1-6/+6
* bfd-in2.h: Regenerate. * elf-bfd.h (struct elf_link_tls_segment): Delete. (struct elf_link_hash_table): Add tls_sec and tls_size. * elf.c (_bfd_elf_link_hash_table_init): Init tls_sec and tls_size. * elflink.c (_bfd_elf_tls_setup): New function. * elflink.h (struct elf_final_link_info): Remove first_tls_sec. (elf_bfd_final_link): Don't set first_tls_sec here. Update code saving tls segment info, round segment size up. (elf_link_output_extsym): Adjust code using tls segment info. (elf_link_input_bfd): Likewise. * elf32-i386.c (dtpoff_base, tpoff): Likewise. * elf32-s390.c (dtpoff_base, tpoff): Likewise. * elf32-sh.c (dtpoff_base, tpoff): Likewise. * elf32-sparc.c (dtpoff_base, tpoff): Likewise. * elf64-s390.c (dtpoff_base, tpoff): Likewise. * elf64-x86-64.c (dtpoff_base, tpoff): Likewise. * elfxx-ia64.c (elfNN_ia64_tprel_base): Likewise. (elfNN_ia64_dtprel_base): Likewise. * elf64-alpha.c (alpha_get_dtprel_base): Likewise. (alpha_get_tprel_base): Likewise. (struct alpha_relax_info): Remove tls_segment. (elf64_alpha_relax_got_load): Adjust invocation of alpha_get_dtprel_base and alpha_get_tprel_base. (elf64_alpha_relax_tls_get_addr): Likewise. (elf64_alpha_relax_section): Likewise. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_relax_find_tls_segment): Delete. * elf32-ppc.c (struct ppc_elf_link_hash_table): Remove tls_sec. (ppc_elf_tls_setup): Call _bfd_elf_tls_setup. Return section. (ppc_elf_relocate_section): Adjust to use elf.tls_sec. * elf32-ppc.h (ppc_elf_tls_setup): Update. * elf64-ppc.c (struct ppc_link_hash_table): Remove tls_sec. (ppc64_elf_tls_setup): Call _bfd_elf_tls_setup. Return section. (ppc64_elf_tls_optimize): Adjust to use elf.tls_sec. (ppc64_elf_relocate_section): Likewise. * elf64-ppc.h (ppc64_elf_tls_setup): Update. * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Call _bfd_elf_tls_setup.
2003-11-03 * elf-bfd.h (struct elf_backend_data): Remove plt_header_size.Daniel Jacobowitz1-1/+0
* elf-m10300.c (elf_backend_plt_header_size): Don't define. * elf32-arm.h (elf_backend_plt_header_size): Don't define. * elf32-cris.c (elf_backend_plt_header_size): Don't define. * elf32-i386.c (elf_backend_plt_header_size): Don't define. * elf32-mips.c (elf_backend_plt_header_size): Don't define. * elf32-ppc.c (elf_backend_plt_header_size): Don't define. * elf32-s390.c (elf_backend_plt_header_size): Don't define. * elf32-sh.c (elf_backend_plt_header_size): Don't define. * elf32-sparc.c (elf_backend_plt_header_size): Don't define. * elf64-alpha.c (elf_backend_plt_header_size): Don't define. * elf64-hppa.c (elf_backend_plt_header_size): Don't define. * elf64-mips.c (elf_backend_plt_header_size): Don't define. * elf64-ppc.c (elf_backend_plt_header_size): Don't define. * elf64-s390.c (elf_backend_plt_header_size): Don't define. * elf64-sh64.c (elf_backend_plt_header_size): Don't define. * elf64-sparc.c (elf_backend_plt_header_size): Don't define. * elf64-x86-64.c (elf_backend_plt_header_size): Don't define. * elfn32-mips.c (elf_backend_plt_header_size): Don't define. * elfxx-ia64.c (elf_backend_plt_header_size): Don't define. * elfxx-target.h (elf_backend_plt_header_size): Don't define or include in target initializer.
2003-10-21 * archures.c (bfd_mach_sh4a, bfd_mach_sh4al_dsp, bfd_mach_sh4_nofpu,Corinna Vinschen1-0/+12
bfd_mach_sh4a_nofpu): New machine types. * bfd-in2.h: Rebuilt. * cpu-sh.c (compatible): Remove unused function. (SH4A_NEXT, SH4AL_DSP_NEXT, SH4_NOFPU_NEXT, SH4A_NOFPU_NEXT): New. (arch_info_struct): Add sh4a, sh4al_dsp, sh4-nofpu and sh4a-nofpu. * elf32-sh.c (sh_elf_set_mach_from_flags): Handle them.
2003-10-15[bfd]Kaz Kojima1-2/+32
* 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-09-24* sh.h (R_SH_SWITCH8, R_SH_GNU_VTINHERIT, R_SH_GNU_VTENTRY,DJ Delorie1-57/+293
R_SH_LOOP_START,R_SH_LOOP_END): Move to "reserved" spaces. (R_SH_DIR16, R_SH_DIR8, R_SH_DIR8UL, R_SH_DIR8UW, R_SH_DIR8U, R_SH_DIR8SW, R_SH_DIR8S, R_SH_DIR4UL, R_SH_DIR4UW, R_SH_DIR4U, R_SH_PSHA, R_SH_PSHL): New. * elf32-sh.c (sh_elf_howto_table): R_SH_SWITCH8, R_SH_GNU_VTINHERIT, R_SH_GNU_VTENTRY, R_SH_LOOP_START,R_SH_LOOP_END moved to "reserved" spaces, R_SH_DIR16, R_SH_DIR8, R_SH_DIR8UL, R_SH_DIR8UW, R_SH_DIR8U, R_SH_DIR8SW, R_SH_DIR8S, R_SH_DIR4UL, R_SH_DIR4UW, R_SH_DIR4U, R_SH_PSHA, R_SH_PSHL added. (sh_reloc_map): Add R_SH_DIR16 and R_SH_DIR8. (sh_elf_relocate_section): Support new relocs.
2003-08-20Better handking for unresolved symbolsNick Clifton1-6/+9
2003-08-11 * elf32-i386.c (elf_i386_relocate_section): Make undefined symbolsJakub Jelinek1-2/+2
fatal if -pie. * elf32-s390.c (elf_s390_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. * elf64-s390.c (elf_s390_relocate_section): Likewise. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. (ppc_elf_relocate_section) <case R_PPC_RELAX32>: Issue fatal error on undefined symbols if -pie. * elf32-sh.c (sh_elf_relocate_section): Likewise.
2003-08-07 * elfxx-target.h: Remove PTR cast.Alan Modra1-3/+3
* targets.c (bfd_target): Make backend_data const void *. * elf-bfd.h: Constify all occurrences of struct elf_backend_data. * elf-m10300.c: Likewise. * elf.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i386.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-sh.c: Likewise. * elf32-sh64.c: Likewise. * elf32-sparc.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-mips.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elflink.h: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-mips.h: Likewise. * elf.c (prep_headers): Remove useless check for null backend_data. * bfd-in2.h: Regenerate.
2003-08-02 * elf32-sh.c (sh_elf_check_relocs): Don't set DF_TEXTREL here.Kaz Kojima1-2/+0
* ld-sh/shared-2.d, ld-sh/textrel1.s, ld-sh/textrel2.s: New test.
2003-07-25 * elf32-sh.c: Convert to C90. Replace PTR with void *.Kaz Kojima1-216/+129
* elf32-sh64-com.c: Likewise. * elf32-sh64.c: Likewise. * elf32-sh64.h: Likewise. * elf64-sh64.c: Likewise.
2003-07-24 * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL.Kaz Kojima1-24/+8
(allocate_dynrelocs): Likewise. (sh_elf_relocate_section): Likewise. Use SYMBOL_REFERENCES_LOCAL. (sh_elf_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL.
2003-07-12Set maxpagesize for NTO targets to 4kNick Clifton1-1/+5
2003-07-04 * elf32-sh.c (sh_elf_create_dynamic_sections): Return if dynamicKaz Kojima1-30/+21
sections were created already. Remove unnecessary tests of the previous change.
2003-07-04 * elf32-sh.c (sh_elf_create_dynamic_sections): Don't callKaz Kojima1-19/+32
bfd_make_section for existing sections.
2003-07-04 * elf32-sparc.c (elf32_sparc_check_relocs): Don't callAlan Modra1-27/+24
create_got_section if we already have done so. * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise. (sh_elf_check_relocs): Likewise. (sh_elf_adjust_dynamic_symbol): Delete "dynobj" var. Use htab->root.dynobj instead. (sh_elf_check_relocs): Likewise. (sh_elf_finish_dynamic_sections): Likewise.
2003-06-25Correct spelling of "relocatable".Alan Modra1-10/+10
2003-06-03 * elf32-sh.c (sh_elf_size_dynamic_sections): Create .interp sectionKaz Kojima1-2/+2
and DT_DEBUG dynamic tag even for position independent executables. * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewize.
2003-05-13 * elf32-sh.c (sh_elf_adjust_dynamic_symbol): For weak symbols,Kaz Kojima1-5/+34
copy ELF_LINK_NON_GOT_REF from weakdef. (allocate_dynrelocs): For undef weak syms with non-default visibility, a) don't allocate plt entries, b) don't allocate .got relocs, c) discard dyn rel space (sh_elf_relocate_section): d) don't generate .got relocs, e) don't generate dynamic relocs. (sh_elf_copy_indirect_symbol): Don't copy ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
2003-05-09 * elflink.c (_bfd_elf_link_create_dynamic_sections): Move fromAlan Modra1-3/+3
elflink.h. Replace LOG_FILE_ALIGN with bed->s->log_file_align. (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align. (bfd_elf_record_link_assignment): Move from elflink.h. (_bfd_elf_merge_symbol): Likewise. (_bfd_elf_add_default_symbol): Likewise. (_bfd_elf_export_symbol): Likewise. (_bfd_elf_link_find_version_dependencies): Likewise. (_bfd_elf_link_assign_sym_version): Likewise. (_bfd_elf_link_read_relocs): Likewise. (_bfd_elf_link_size_reloc_section): Likewise. (_bfd_elf_fix_symbol_flags): Likewise. (_bfd_elf_adjust_dynamic_symbol): Likewise. (_bfd_elf_link_sec_merge_syms): Likewise. (elf_link_read_relocs_from_section): Likewise. Use bed->s->sizeof_rel and bed->s->sizeof_rela. (_bfd_elf_link_output_relocs): Likewise. * elf-bfd.h (struct elf_size_info): Rename file_align to log_file_align. (struct elf_info_failed): Move from elflink.h. (struct elf_assign_sym_version_info): Likewise. (struct elf_find_verdep_info): Likewise. (_bfd_elf_create_dynamic_sections): Delete duplicate declaration. (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol, _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, _bfd_elf_link_assign_sym_version, _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs, _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs, _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol, _bfd_elf_link_sec_merge_syms): Declare. (bfd_elf32_link_create_dynamic_sections): Don't declare. (_bfd_elf32_link_read_relocs): Likewise. (bfd_elf64_link_create_dynamic_sections): Likewise. (_bfd_elf64_link_read_relocs): Likewise. * elflink.h: Move lots o' stuff elsewhere. * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare. (bfd_elf64_record_link_assignment): Likewise. (bfd_elf_record_link_assignment): Declare. * bfd-in2.h: Regenerate. * elfcode.h (elf_link_create_dynamic_sections): Don't declare. (NAME(_bfd_elf,size_info)): Adjust for log_file_align. * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align. (assign_file_positions_for_segments): Likewise. (assign_file_positions_except_relocs): Likewise. (swap_out_syms, elfcore_write_note): Likewise. * elf-m10200.c: Adjust for changed function names. * elf-m10300.c: Likewise. * elf32-arm.h: Likewise. * elf32-h8300.c: Likewise. * elf32-hppa.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mips.c: Likewise. * elf32-ppc.c: Likewise. * elf32-sh.c: Likewise. * elf32-v850.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-sh64.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align. * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-mips.c (mips_elf64_size_info): Likewise. * elf64-s390.c (s390_elf64_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2003-04-24 * elf32-sh.c (tpoff): New.Kaz Kojima1-203/+64
(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-23bfd:Joern Rennecke1-1/+1
* 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-15Replace occurrances of 'Hitachi' with 'Renesas'.Nick Clifton1-1/+1
2003-03-03Fix sh-elf linker relaxation:Joern Rennecke1-8/+32
gcc: * config/sh/sh.h (EXTRA_SPECS): Add subtarget_asm_relax_spec and subtarget_asm_isa_spec. (SUBTARGET_ASM_RELAX_SPEC, SUBTARGET_ASM_ISA_SPEC): Define. (ASM_SPEC): Define as SH_ASM_SPEC. (SH_ASM_SPEC): New; take the role of ASM_SPEC, but safe from svr4.h. Use subtarget_asm_relax_spec and subtarget_asm_isa_spec. * config/sh/elf.h (ASM_SPEC): Use SH_ASM_SPEC. (SUBTARGET_ASM_ISA_SPEC): Undef / define. gcc/testsuite: gcc.dg/sh-relax.c: New test. include/elf: * sh.h (EF_SH_MERGE_MACH): Make sure SH2E & SH3/SH3E merge to SH3E, and SH2E & SH4 merge to SH4, not SH2E. gas: * config/tc-sh.c (sh_dsp): Replace with preset_target_arch. (md_begin): Use preset_target_arch. (md_longopts): Make isa option unconditional. (md_parse_option): Make OPTION_DSP and OPTION_ISA sh4 / any set preset_target_arch. (md_apply_fix3): If BFD_ASSEMBLER, adjust SWITCH_TABLE fixups by -S_GET_VALUE (fixP->fx_subsy). (tc_gen_reloc): For SWITCH_TABLE fixups, the symbol is fixp->fx_subsy, and the addend is 0. Adjust addend of R_SH_IND12W relocations by fixp->fx_offset - 4. * config/tc-sh.h (TC_FORCE_RELOCATION_SUB_LOCAL): Define. bfd: elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary relocation (no special function), and make it non-partial_inplace. (sh_elf_relax_section): When creating a bsr, use a consistent value no matter if the symbol is extern or not; set addend to -4. Don't swap load / non-load instructions for SH4. (sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset rather than if the symbol is external to determine if adjusting the offset makes sense. Adjust the addend too if appropriate. (sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the relocation.
2003-02-19 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Simplify dynamic relocAlan Modra1-33/+27
removal. Localize vars. Remove unnecessary dynobj test. * elf32-i386 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses, and optimize. (elf_i386_relocate_section): Likewise. (elf_i386_gc_sweep_hook): Simplify dyn reloc removal. Localize vars. * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise. * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise. * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise. * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise. * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise. Remove local_dynrel for section too. Don't touch HIPLT22, LOPLT10, PCPLT32 or PCPLT10 relocs. Don't subtract twice on PLT32 relocs. Formatting.
2003-02-17Fix the behaviour of --allow-shlib-undefined, so that it does what it claimsNick Clifton1-1/+0
to do. Add an inverse switch. Update the documentation.
2003-02-10 * elf32-sh.c (elf_sh_dyn_relocs): Add tls_tpoff32 field.Kaz Kojima1-14/+35
(elf_sh_link_hash_entry): Remove tls_tpoff32 field. (sh_elf_link_hash_newfunc): Remove the initialization of tls_tpoff32 field. (allocate_dynrelocs): Keep dyn_relocs if it includes the entry for which tls_tpoff32 flag is set. (sh_elf_relocate_section): Covert to LE only if the dyn_relocs of the symbol includes the entry matched with the input_section and having tls_tpoff32 flag on. When linking statically, set symbol index of R_SH_TLS_TPOFF32 relocation to zero if the symbol is defined in this executable. (sh_elf_check_relocs): Set tls_tpoff32 flag appropriately.
2003-01-23Add SH2E supportNick Clifton1-0/+3
2003-01-20Treat elfNN_bed like other macros defined in elfxx-target.h and #undef itNick Clifton1-24/+19
before #define'ing it.
2002-11-30s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. SimplifyAlan Modra1-468/+468
comparisons of bfd_boolean vars with TRUE/FALSE. Formatting.
2002-11-28include/elf/ChangeLogAlan Modra1-49/+42
* internal.h (elf32_internal_ehdr, Elf32_Internal_Ehdr, elf64_internal_ehdr, Elf64_Internal_Ehdr, elf32_internal_phdr, Elf32_Internal_Phdr, elf64_internal_phdr, Elf64_Internal_Phdr, elf32_internal_shdr, Elf32_Internal_Shdr, elf64_internal_shdr, Elf64_Internal_Shdr, elf32_internal_sym, elf64_internal_sym, Elf32_Internal_Sym, Elf64_Internal_Sym, Elf32_Internal_Note, elf32_internal_note, elf32_internal_rel, Elf32_Internal_Rel, elf64_internal_rel, Elf64_Internal_Rel, elf32_internal_rela, elf64_internal_rela, Elf32_Internal_Rela, Elf64_Internal_Rela, elf32_internal_dyn, elf64_internal_dyn, Elf32_Internal_Dyn, Elf64_Internal_Dyn, elf32_internal_verdef, elf64_internal_verdef, elf32_internal_verdaux, elf64_internal_verdaux, elf32_internal_verneed, elf64_internal_verneed, elf32_internal_vernaux, elf64_internal_vernaux, elf32_internal_versym, elf64_internal_versym, Elf32_Internal_Verdef, Elf64_Internal_Verdef, Elf32_Internal_Verdaux, Elf64_Internal_Verdaux, Elf32_Internal_Verneed, Elf64_Internal_Verneed, Elf32_Internal_Vernaux, Elf64_Internal_Vernaux, Elf32_Internal_Versym, Elf64_Internal_Versym, Elf32_Internal_Syminfo, Elf64_Internal_Syminfo): Delete. (Elf_Internal_Rel): Delete. bfd/ChangeLog * elf-bfd.h: Replace occurrences of Elf32_Internal_* and Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel with Elf_Internal_Rela. * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h, elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c, elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto. * elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr throughout instead. * elf.c (_bfd_elf_no_info_to_howto_rel): Delete. * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *. Remove INLINE keyword. (elf_swap_reloc_in): Likewise. Also clear r_addend. (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand as a bfd_byte *. (elf_write_relocs): Consolidate REL and RELA code. (elf_slurp_reloc_table_from_section): Simplify REL code. (NAME(_bfd_elf,size_info)): Populate reloc swap entries. * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define. * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and RELA code. (elf_link_adjust_relocs): Likewise. Don't malloc space for temp reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL. (elf_link_output_relocs): Likewise. (elf_reloc_link_order): Likewise. (elf_finish_pointer_linker_section): Likewise. (struct elf_link_sort_rela): Remove union. (elf_link_sort_cmp1): Update to suit. (elf_link_sort_cmp2): Here too. (elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory over-allocation for int_rels_per_ext_rel != 1 case. * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls. * elf32-i386.c: Likewise. * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out. * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise. * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out. * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out. * elfxx-mips.c (sort_dynamic_relocs): Likewise for bfd_elf32_swap_reloc_in. * elf32-arm.h: Update elf32_arm_info_to_howto calls. * elf32-mips.c: Likewise for mips_info_to_howto_rel. (mips_elf64_swap_reloc_in): Zero r_addend. (mips_elf64_be_swap_reloc_in): Likewise. (mips_elf64_slurp_one_reloc_table): Simplify. * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2002-11-28 * elf32-sh.c (sh_elf_relocate_section): Don't complain aboutKaz Kojima1-0/+7
unresolved debugging relocs in dynamic applications. * elf64-sh64.c (sh_elf64_relocate_section): Likewise. * ld-sh/refdbg-0-dso.d: New test. * ld-sh/refdbg-1.d: Likewise. * ld-sh/refdbg.s: Likewise. * ld-sh/refdbglib.s: Likewise.
2002-11-06 * Makefile.am: Remove entries for elf32-qnx.[ch].Alan Modra1-23/+0
* Makefile.in: Regenerate. * config.bfd: Change arm-nto to use bfd_elf32_{big|little}arm_vec, ppc-nto to use bfd_elf32_powerpc{le}_vec, sh-nto to use bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec. * configure.in: Remove support for bfd_elf32_sh{l}qnx_vec, bfd_elf32_powerpc{le}qnx_vec, bfd_elf32_{big|little}armqnx_vec, and bfd_elf32_i386qnx_vec, and removed elf32-qnx.lo from other targets. bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec. * configure: Regenerate. * elf32-qnx.c: Remove. * elf32-qnx.h: Remove. * elf.c: Remove calls to QNX specific set_nonloadable_filepos, is_contained_by_filepos, and copy_private_bfd_data_p. * elf32-i386.c: Remove QNX extended bfd support. * elf32-ppc.c: Remove QNX extended bfd support. * elf32-sh.c: Remove QNX extended bfd support. * elfarm-nabi.c: Remove QNX extended bfd support. * targets.c: Remove qnx vectors. * elfxx-target.h (elf_backend_set_nonloadable_filepos): Remove (elf_backend_is_contained_by_filepos): Remove. (elf_backend_copy_private_bfd_data_p): Remove. * po/SRC-POTFILES.in: Regenerate.
2002-10-16 * Makefile.am (BFD32_BACKENDS): Remove elfarmqnx-nabi.lo,Alan Modra1-4/+138
elf32-i386-fbsd.lo, elf32-i386qnx.lo, elf32-ppcqnx.lo, elf32-sh-lin.lo, elf32-sh64-lin.lo, elf32-sh-nbsd.lo, elf32-sh64-nbsd.lo, elf32-shqnx.lo. Add elf32-qnx.lo. (BFD32_BACKENDS_CFILES): Likewise for corresponding C files. (BFD64_BACKENDS): Remove elf64-sh64-lin.lo, elf64-sh64-nbsd.lo. (BFD64_BACKENDS_CFILES): Likewise for corresponding C files. (SOURCE_HFILES): Add elf32-qnx.h. (BUILD_HFILES): Add bfdver.h. Run "make dep-am". * Makefile.in: Regenerate. * configure.in Update bfd vector dependencies. * configure: Regenerate. * elf32-i386-fbsd.c: Delete. Move code to elf32-i386.c. * elf32-i386qnx.c: Likewise. * elf32-ppcqnx.c: Delete. Move code to elf32-ppc.c. * elf32-sh-nbsd.c: Delete. Move code to elf32-sh.c. * elf32-sh-lin.c: Likewise. * elf32-shqnx.c: Likewise. * elf32-sh64-lin.c: Delete. Move code to elf32-sh64.c. * elf32-sh64-nbsd.c: Likewise. * elf64-sh64-lin.c: Delete. Move code to elf64-sh64.c. * elf64-sh64-nbsd.c: Likewise. * elfarmqnx-nabi.c: Delete. Move code to elfarm-nabi.c. * elf32-arm.h (ELF_MAXPAGESIZE): Always define. * elf32-i386.c: Remove ELF_ARCH and ELF32_I386_C_INCLUDED tests. * elf32-ppc.c: Remove ELF32_PPC_C_INCLUDED tests. * elf32-qnx.h (elf_backend_set_nonloadable_filepos): Always define. (elf_backend_is_contained_by_filepos): Likewise. (elf_backend_copy_private_bfd_data_p): Likewise. Globalize and move functions to.. * elf32-qnx.c: ..here. New file. * elf32-sh.c: Remove ELF_ARCH and ELF32_SH_C_INCLUDED tests. Don't emit target vectors when INCLUDE_SHMEDIA. * elf32-sh64.c: Remove ELF_ARCH test. Move TARGET_* etc. defines to end of file. * elf64-sh64.c: Remove ELF_ARCH test. * elfarm-nabi.c: Remove ELFARM_NABI_C_INCLUDED test. * po/BLD-POTFILES.in: Regenerate. * po/SRC-POTFILES.in: Regenerate.
2002-10-14* elf32-sh.c (elf_sh_link_hash_entry): ReplaceStephen Clarke1-132/+283
datalabel_got_offset with union of datalabel_got offset and refcount. (sh_elf_link_hash_newfunc): Initialize datalabel_got.refcount. (allocate_dynrelocs): Delete unnecessary code for STT_DATALABEL type. Create entry in got for datalabel version of symbol if datalabel_got.refcount > 0. (sh_elf_relocate_section): Use datalabel_got union. (sh_elf_gc_sweep_hook): Pull common code to initialize h and eh out of switch statement. Declare seen_stt_datalabel. Initialize it. Decrement datalabel_got.refcount for got relocs when seen_stt_datalabel is true. Decrement local_got_refcounts entry for datalabel got relocs of local symbols. (sh_elf_copy_indirect_symbol): Copy datalabel_got field over. (sh_elf_check_relocs): Declare seen_stt_datalabel. Initialize it. When seen_stt_datalabel is true, increment datalabel_got refcount rather than got.refcount. (sh_elf_finish_dynamic_symbol): Create relocs to initialize got entry for datalabel version of symbol.
2002-10-11 * elf32-sh.c (sh_elf_optimized_tls_reloc, sh_elf_mkobject,Kaz Kojima1-26/+935
sh_elf_object_p, dtpoff_base): New functions. (sh_elf_howto_table): Add TLS relocs. (sh_reloc_map): Likewise. (sh_elf_info_to_howto): Support TLS relocs. (elf_sh_link_hash_entry): Add tls_type and tls_tpoff32. (sh_elf_hash_entry, sh_elf_tdata, sh_elf_local_got_tls_type): New macros. (sh_elf_obj_tdata): New. (elf_sh_link_hash_table): Add tls_ldm_got. (sh_elf_link_hash_table_create): Clear refcount of tls_ldm_got. (allocate_dynrelocs): Support TLS relocs. (sh_elf_size_dynamic_sections): Likewise. (sh_elf_relocate_section): Support TLS relocs. Don't try to find .rela.got section when found already. Return false after printing error about unresolvable relocation. (sh_elf_gc_sweep_hook): Support TLS relocs. (sh_elf_check_relocs): Likewise. (sh_elf_finish_dynamic_symbol): Likewise. (bfd_elf32_mkobject, elf_backend_object_p): Define for TLS case. * reloc.c: Add SH TLS relocs. * libbfd.h: Regenerate.
2002-10-11Fix numerous occurrences ofAlan Modra1-3/+6
warning: dereferencing type-punned pointer will break strict-aliasing rules
2002-10-10* elf32-sh.c (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le):Stephen Clarke1-2/+2
Correct mistake in calculation of address of .got. * elf64-sh64.c (elf_sh64_pic_plt_entry_be, elf_sh64_pic_plt_entry_le): Likewise.
2002-10-02* elf32-sh.c (elf_sh_link_hash_entry): Add gotplt_refcount.Stephen Clarke1-4/+27
(sh_elf_link_hash_newfunc): Initialize it. (allocate_dynrelocs): Transfer gotplt refs from plt.refcount to got.refcount for symbols that are forced local or when we have direct got refs. (sh_elf_gc_sweep_hook): Adjust gotplt_refcount. Use it to correctly adjust got.refcount and plt.refcount. (sh_elf_copy_indirect_symbol): Copy gotplt_refcount across. (sh_elf_check_relocs): Increment gotplt_refcount.
2002-08-24 * elf32-sh.c (sh_elf_copy_indirect_symbol): New.Alan Modra1-583/+966
(create_got_section, allocate_dynrelocs, readonly_dynrelocs): Likewise. (struct elf_sh_pcrel_relocs_copied): Removed. (struct elf_sh_dyn_relocs): New. (struct elf_sh_link_hash_entry): Replace pcrel_relocs_copied field with dyn_relocs. (struct elf_sh_link_hash_table): Add short-cuts to get dynamic sections and sym_sec. (sh_elf_link_hash_newfunc): Clear dyn_relocs. (sh_elf_link_hash_table_create): Clear shorts-cuts and sym_sec. (sh_elf_create_dynamic_sections): Use create_got_section instead of _bfd_elf_create_got_section. (sh_elf_check_relocs): Likewise. (sh_elf_create_dynamic_sections): Use short-cuts to the dynamic sections. (sh_elf_adjust_dynamic_symbol, sh_elf_size_dynamic_sections, sh_elf_relocate_section, sh_elf_check_relocs, sh_elf_finish_dynamic_symbol, sh_elf_finish_dynamic_sections): Likewise. (sh_elf_adjust_dynamic_symbol): Handle nocopyreloc. Keep the dynamic relocations and avoiding the copy relocation when we didn't find any dynamic relocations in the section which has contents or is read-only. (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New. (sh_elf_size_dynamic_sections): Don't reset the size of .rela.got section even if dynamic_sections_created flag is off. Don't use sh_elf_discard_copies. Scan all input bfd and use allocate_dynrelocs. Call readonly_dynrelocs to determine whether we need DT_TEXTREL. (sh_elf_adjust_dynamic_symbol): Use plt.refcount to determine whether the symbol was never referred to. (sh_elf_relocate_section): Use WILL_CALL_FINISH_DYNAMIC_SYMBOL. (sh_elf_gc_sweep_hook): Fill with the real sweep function. (sh_elf_check_relocs): Call create_got_section if the short-cut to .got is null. Increment reference counters only instead of allocating space on dynamic sections here. Don't conditionalize uninitialized got.offset value when marking the symbol as a global offset table entry. Keep relocations for symbols satisfied by a dynamic library to avoid copy relocations for the symbol. Set dynobj field of an elf hash table if needed. (sh_elf_finish_dynamic_sections): Handle null section pointer correctly. (elf_backend_copy_indirect_symbol): Defined. (elf_backend_can_refcount): Defined.
2002-08-23 * elf32-sh.c (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le): CopyAlan Modra1-5/+9
contents of .got.plt[2] to tr0, not address of .got.plt. (sh_elf_finish_dynamic_symbol): Do not apply GOT_BIAS when patching absolute plt entry. For shmedia plt entry, set bottom bit of branch to plt0 as this is a branch to an shmedia instruction. * elf64-sh64.c (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le): Copy contents of .got.plt[2] to tr0, not address of .got.plt. (elf_sh64_plt_entry_be, elf_sh64_plt_entry_le): Use ptrel to branch to plt0. (sh64_elf64_finish_dynamic_symbol): Do not apply GOT_BIAS when patching absolute plt entry. For shmedia plt entry, branch to plt0 is now ptrel, so use relative offset. Set bottom bit of branch target as it is a branch to an shmedia instruction.
2002-08-23 * elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INITAlan Modra1-0/+22
value if .init is an SHmedia function. Similarly for DT_FINI. * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise.