aboutsummaryrefslogtreecommitdiff
path: root/bfd/bfd-in2.h
AgeCommit message (Collapse)AuthorFilesLines
2009-03-11[bfd/ChangeLog]Chris Demetriou1-0/+5
2009-03-11 Chris Demetriou <cgd@google.com> * bfd.c (BFD_DETERMINISTIC_OUTPUT): New flag. * bfd-in2.h: Regenerate. * archive.c (bfd_ar_hdr_from_filesystem): If BFD_DETERMINISTIC_OUTPUT flag is set, use 0 for uid, gid, and timestamp, and use 0644 for file mode. (bsd_write_armap): Likewise. (_bfd_archive_bsd_update_armap_timestamp): If BFD_DETERMINISTIC_OUTPUT flag is set, do nothing. (coff_write_armap): If BFD_DETERMINISTIC_OUTPUT flag is set, use 0 for timestamp. [binutils/ChangeLog] 2009-03-11 Chris Demetriou <cgd@google.com> * ar.c (deterministic): New global variable. (main): Recognize new 'D' option, which enables 'deterministic mode'. (usage): Document new 'D' option. (write_archive): Set BFD_DETERMINISTIC_OUTPUT in output archive's flags if deterministic mode was requested. * doc/binutils.texi (ar): Document deterministic mode ('D' option). [binutils/testsuite/ChangeLog] 2009-03-11 Chris Demetriou <cgd@google.com> * binutils-all/ar.exp (deterministic_archive): New test.
2009-03-04include/elf/Alan Modra1-4/+9
* ppc.h (R_PPC_TLSGD, R_PPC_TLSLD): Add new relocs. * ppc64.h (R_PPC64_TLSGD, R_PPC64_TLSLD): Add new relocs. bfd/ * reloc.c (BFD_RELOC_PPC_TLSGD, BFD_RELOC_PPC_TLSLD): New. * section.c (struct bfd_section): Add has_tls_get_addr_call. (BFD_FAKE_SECTION): Init new flag. * ecoff.c (bfd_debug_section): Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_TLSGD and R_PPC_TLSLD. (ppc_elf_reloc_type_lookup): Handle new relocs. (ppc_elf_check_relocs): Set has_tls_get_addr_call on finding such without marker relocs. (ppc_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs if section has no old-style calls. (ppc_elf_relocate_section): Set tls_mask for non-tls relocs too. Don't try to optimize new-style __tls_get_addr call when handling arg setup relocs. Instead do so for R_PPC_TLSGD and R_PPC_TLSLD relocs. * elf64-ppc.c (ppc64_elf_howto_raw): Add R_PPC64_TLSGD, R_PPC64_TLSLD. (ppc64_elf_reloc_type_lookup): Handle new relocs. (ppc64_elf_check_relocs): Set has_tls_get_addr_call on finding such without marker relocs. (ppc64_elf_tls_optimize): Allow out-of-order __tls_get_addr relocs if section has no old-style calls. Set toc_ref for new relocs as appropriate. (ppc64_elf_relocate_section): Set tls_mask for non-tls relocs too. Don't try to optimize new-style __tls_get_addr call when handling arg setup relocs. Instead do so for R_PPC_TLSGD and R_PPC_TLSLD relocs. gas/ * config/tc-ppc.c (ppc_elf_suffix): Error if ppc32 tls got relocs have non-zero addend. (md_assemble): Parse args of __tls_get_addr calls. (md_apply_fix): Handle BFD_RELOC_PPC_TLSGD and BFD_RELOC_PPC_TLSLD. ld/testsuite/ * ld-powerpc/tlsmark.s, * ld-powerpc/tlsmark.d: New test. * ld-powerpc/tlsmark32.s, * ld-powerpc/tlsmark32.d: New test. * ld-powerpc/powerpc.exp: Run them.
2009-03-02Add support for Score7 architecture.Nick Clifton1-4/+13
2009-02-232009-02-23 Tristan Gingold <gingold@adacore.com>Tristan Gingold1-0/+16
* vms.h: Update copyright year, fix comments, reorder declarations. (_bfd_save_vms_section): Remove the prototype. (EGPS_S_V_NO_SHIFT): New constant. (bfd_vms_set_section_flags): New prototype. (EGPS_S_B_ALIGN, EGPS_S_W_FLAGS, EGPS_S_L_ALLOC, EGPS_S_B_NAMLNG): New constants. (EGSY_S_W_FLAGS): Ditto. (EGSY_S_V_QUAD_VAL): Ditto. (ESDF_S_L_VALUE, ESDF_S_L_PSINDX, ESDF_S_B_NAMLNG): Ditto. (EGST_S_W_FLAGS, EGST_S_Q_LP_1, EGST_S_Q_LP_2, EGST_S_L_PSINDX, EGST_S_B_NAMLNG): Ditto. (ESRF_S_B_NAMLNG): Ditto. (ETIR_S_C_HEADER_SIZE): Ditto. (EGPS_S_V_ALLOC_64BIT): Ditto. (DST_S_C_EPILOG): Ditto. (DST_S_C_SRC_SETLNUM_L, DST_S_C_SRC_SETLNUM_W) : Ditto. (DST_S_C_SRC_INCRLNUM_B): Ditto. (DST_S_B_PCLINE_UNSBYTE, DST_S_W_PCLINE_UNSWORD): Ditto. (DST_S_L_PCLINE_UNSLONG): Ditto. (DST_S_B_MODBEG_NAME, DST_S_L_RTNBEG_ADDRESS) : Ditto (DST_S_B_RTNBEG_NAME, DST_S_L_RTNEND_SIZE): Ditto (DST_S_C_SOURCE_HEADER_SIZE): Ditto. (DST_S_B_SRC_DF_LENGTH, DST_S_W_SRC_DF_FILEID): Ditto. (DST_S_B_SRC_DF_FILENAME, DST_S_B_SRC_UNSBYTE): Ditto. (DST_S_B_SRC_UNSBYTE): Ditto. (DST_S_W_SRC_UNSWORD, DST_S_L_SRC_UNSLONG): Ditto. Add prototypes. (vms_section, vms_reloc): Remove types. (hdr_struc): Replaced by ... (hdr_struct): ... new type. (EMH_S_W_HDRTYP, EMH_S_B_STRLVL, EMH_S_L_ARCH1): New constants. (EMH_S_L_ARCH2, EMH_S_L_RECSIZ, EMH_S_B_NAMLNG): Ditto. (EMH_DATE_LENGTH): Ditto. (eom_struc): Replaced by ... (eom_struct): ... new type. (EEOM_S_L_TOTAL_LPS, EEOM_S_W_COMCOD, EEOM_S_B_TFRFLG): New constants. (EEOM_S_L_PSINDX, EEOM_S_L_TFRADR): Ditto. (EIHD_S_K_MAJORID, EIHD_S_K_MINORID, EIHD_S_K_EXE): Ditto. (EIHD_S_L_SIZE, EIHD_S_L_ISDOFF, EIHD_S_L_SYMDBGOFF): Ditto. (EIHD_S_Q_SYMVVA, EIHD_S_L_IMGTYPE): Ditto. (EISD_S_L_EISDSIZE, EISD_S_L_SECSIZE, EISD_S_Q_VIR_ADDR): Ditto. (EISD_S_L_FLAGS, EISD_S_L_VBN, EISD_S_R_CONTROL): Ditto. (EISD_S_L_IDENT, EISD_S_T_GBLNAM): Ditto. (EISD_S_M_GBL, EISD_S_M_CRF, EISD_S_M_DZRO, EISD_S_M_WRT): Ditto. (EISD_S_M_INITALCODE, EISD_S_M_BASED, EISD_S_M_FIXUPVEC): Ditto. (EISD_S_M_RESIDENT, EISD_S_M_VECTOR, EISD_S_M_PROTECT): Ditto. (EISD_S_M_LASTCLU, EISD_S_M_EXE, EISD_S_M_NONSHRADR): Ditto. (EISD_S_M_QUAD_LENGTH, EISD_S_M_ALLOC_64BIT): Ditto. (EIHS_S_L_DSTVBN, EIHS_S_L_DSTSIZE, EIHS_S_L_GSTVBN): Ditto. (EIHS_S_L_GSTSIZE, EIHS_S_L_DMTVBN, EIHS_S_L_DMTBYTES): Ditto. (DBG_S_L_DMT_MODBEG, DBG_S_L_DST_SIZE): Ditto. (DBG_S_W_DMT_PSECT_COUNT, DBG_S_C_DMT_HEADER_SIZE): Ditto. (DBG_S_L_DMT_PSECT_START, DBG_S_L_DMT_PSECT_LENGTH) (DBG_S_C_DMT_PSECT_SIZE): Ditto. (enum file_type_enum): New type. (struct location_struct): Removed. (struct fileinfo, struct srecinfo, struct lineinfo): New types. (struct funcinfo, struct module): Ditto. (struct vms_private_data_struct): Update fields. (struct vms_section_data_struct): New type. * vms.c: Update copyright year, fix comments, Fix includes for DECC, add prototypes. (vms_initialize): Use bfd_alloc instead of bfd_zalloc and remove some initializers. Use flavour to set is_vax, location_stack is removed. (struct pair): Declare. (fill_section_ptr): Initialize variables at declaration. Add guard to set SECTION_SYM flag, handlde und section. (vms_fixup_sections): Use struct pair for fill_section_ptr argument. (_bfd_vms_slurp_object_records): New function, replaces previous vms_object_p. (vms_slurp_module): New function. (vms_slurp_image): Ditto. (vms_object_p): Complete rewrite. (vms_mkobject): Use is_vax field to slect architecture. (free_reloc_stream): New function. (vms_convert_to_var): Ditto. (vms_convert_to_var_1): Ditto. (vms_convert_to_var_unix_filename): Ditto. (vms_close_and_cleanup): Call free_reloc_stream, convert file to VAR format on VMS. (vms_new_section_hook): Set alignment to 0, allocate private data. (vms_get_section_contents): Load content. (vms_get_symbol_info): Handle undefined section. (vms_find_nearest_line): Handle. (alloc_reloc_stream): New function. (vms_slurp_reloc_table): Ditto. (vms_get_reloc_upper_bound): Make it real. (vms_canonicalize_reloc): Do the real work. (alpha_howto_table): Add ALPHA_R_NOP, ALPHA_R_BSR, ALPHA_R_LDA, ALPHA_R_BOH. (vms_bfd_reloc_type_lookup): Handle NOP, BSR, LDA and BOH. (vms_set_arch_mach): Check arch. (vms_set_section_contents): Copy the content after allocation. (vms_alpha_vec): Update object flags. * vms-tir.c: Update copyright year, fix comments, add prototypes for new functions. (dst_define_location): New function. (dst_restore_location): New function. (dst_retrieve_location): New function. (dst_check_allocation): New function. (image_dump): Call dst_check_allocation. (image_write_b): Ditto. (image_write_w): Ditto. (image_write_l): Ditto. (image_write_q): Ditto. (cmd_name): Handle STA_LW, STA_QW, STO_OFF, STO_IMM, STO_IMMR, STO_LW, STO_QW, OPR_ADD, CTL_SETRB, STC_LP_PSB, CTL_DFLOC, CTL_STLOC, CTL_STKDL. Call error handler instead of abort if name is not known. (etir_sta): Add quarter_relocs argument and set it. Fix cast. (etir_sto): Ditto. (etir_opr): Ditto, return FALSE in case of error. (etir_ctl): Add quarter_relocs argument and set it, fix cast. Fix CTL_DFLOC, CTL_STLOC, CTL_STKDL. (etir_stc): Add quarter_relocs argument and set it, fix cast. Fix STC_LP, STC_LP_PSB, STC_GBL and STC_CGA. Handle STC_LP_PSB, STC_BSR_GBL, STC_LDA_GBL, STC_BOH_GBL. Move STC_NOP_PS, STC_BSR_PS, STC_LDA_PS, STC_BOH_PS, STC_NBH_PS. Return FALSE in case of error. (tir_sta): Change sign of psect. (tir_ctl): Ditto. (tir_cmd): Fix cast. Makes tir_table static const. (etir_cmd): Add quarter_relocs argument, makes etir_table const, add argument to explain. (analyze_etir): Initialize maxptr, add quarter_relocs declaration, move some declarations into inner scopes. Handle quarter_relocs and STO_IMM. (_bfd_vms_slurp_tir): Use constant instead of hard-coded values. (_bfd_vms_slurp_relocs): New function. (_bfd_vms_decode_relocs): New function. (sto_imm): Rewritten. (start_first_etbt_record): New function. (start_another_etbt_record): Ditto. (etir_output_check): Ditto. (defer_reloc_p): Ditto. (_bfd_vms_write_tir): Remove nextoffset, convert a while-loop to a for-loop. Correctly deals with contents, deals with .vmsdebug, rewritte relocations handling. (_bfd_vms_write_tbt): Removed. (_bfd_vms_write_dbg): Ditto. * vms-misc.c: Update copyright year, Fix comments. (_bfd_vms_get_header_values): Use 'size' instead of 'length'. (maybe_adjust_record_pointer_for_object): New function. (_bfd_vms_get_first_record): New function, replaces ... (_bfd_vms_get_record): .. removed. (_bfd_vms_get_object_record): New function. (_bfd_vms_get_object_record): New function. (vms_get_remaining_object_record): New function, replaces ... (_bfd_vms_get_next_record): ... removed. (add_new_contents): Removed. (_bfd_save_vms_section): Removed. (_bfd_get_vms_section): Removed. (_bfd_vms_output_flush): Write in VAR format. (new_symbol): Don't make UND section. * vms-hdr.c: Update copyright year, update list of record handled. (_bfd_vms_slurp_hdr): rec_length renamed to rec_size. (_bfd_vms_write_hdr): Strip vms and unix patches, add comments, truncate module name at 31 characters, use constants instead of hard-coded value, write BFD version instead of a fixed string. (_bfd_vms_slurp_ihd): New function. (_bfd_vms_slurp_isd): Ditto. (_bfd_vms_slurp_ihs): Ditto. (new_module): Ditto. (parse_module): Ditto (build_module_list): Ditto. (module_find_nearest_line): Ditto. (_bfd_vms_find_nearest_dst_line): Ditto. (vms_slurp_debug): Ditto. (_bfd_vms_slurp_dbg): Ditto. (_bfd_vms_slurp_tbt): Ditto. (_bfd_vms_write_dbg): Ditto. (_bfd_vms_write_tbt): Ditto. * vms-gsd.c: Update copyright year, update list of records handled. (EVAX_LITERALS_NAME): New macro. (evax_section_flags): Add an entry for EVAX_LITERALS_NAME. (gpsflagdesc, gsyflagdesc): Moved out of _bfd_vms_slurp_gsd. (register_universal_symbol): New function and prototype. (_bfd_vms_slurp_gsd): Fix indentations and casts, improve debug messages, use constants instead of hard-coded value, fix missing endianness conversion, handle global symbol (SYMG). (bfd_vms_set_section_flags): New function. (_bfd_vms_write_gsd): Don't write .vmsdebug section, handle section literals, fix indentation, handle section bfd and vms flags, don't output LIB$INITIALIZE symbol, fix handling of weak symbols, fix evax vs vax procedure descriptor, handle absolute symbols. * reloc.c (BFD_RELOC_ALPHA_NOP, BFD_RELOC_ALPHA_BSR, BFD_RELOC_ALPHA_LDA, BFD_RELOC_ALPHA_BOH): New relocations. * makefile.vms (DEFS): Fix flags for VMS. * bfdio.c (real_fopen): Handle multiple VMS fopen attributes. * bfd-in2.h: Regenerated. * libbfd.h: Regenerated.
2009-02-03bfd:Joseph Myers1-0/+1
2009-02-03 Sandip Matte <sandip@rmicorp.com> * aoutx.h (NAME (aout, machine_type)): Handle bfd_mach_mips_xlr. * archures.c (bfd_mach_mips_xlr): Define. * bfd-in2.h: Regenerate. * cpu-mips.c (I_xlr): Define. (arch_info_struct): Add XLR entry. * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_XLR. (mips_set_isa_flags): Handle bfd_mach_mips_xlr (mips_mach_extensions): Add XLR entry. binutils: 2009-02-03 Sandip Matte <sandip@rmicorp.com> * readelf.c (get_machine_flags): Handle E_MIPS_MACH_XLR. gas: 2009-02-03 Sandip Matte <sandip@rmicorp.com> * config/tc-mips.c (macro): Handle M_MSGSND, M_MSGLD, M_MSGLD_T, M_MSGWAIT and M_MSGWAIT_T. (mips_cpu_info_table): Add XLR entry. * doc/c-mips.texi (-march): Document xlr. gas/testsuite: 2009-02-03 Sandip Matte <sandip@rmicorp.com> * gas/mips/mips.exp (xlr): New architecture. (xlr-ext): Run test. * gas/mips/xlr-ext.d, gas/mips/xlr-ext.s: New. include/elf: 2009-02-03 Sandip Matte <sandip@rmicorp.com> * mips.h (E_MIPS_MACH_XLR): Define. include/opcode: 2009-02-03 Sandip Matte <sandip@rmicorp.com> * mips.h (INSN_XLR): Define. (INSN_CHIP_MASK): Update. (CPU_XLR): Define. (OPCODE_IS_MEMBER): Update. (M_MSGSND, M_MSGLD, M_MSGLD_T, M_MSGWAIT, M_MSGWAIT_T): Define. opcodes: 2009-02-03 Sandip Matte <sandip@rmicorp.com> * mips-dis.c (mips_cp0_names_xlr, mips_cp0sel_names_xlr): Define. (mips_arch_choices): Add XLR entry. * mips-opc.c (XLR): Define. (mips_builtin_opcodes): Add XLR instructions.
2009-02-03 M68K TLS support.Nick Clifton1-0/+15
ld/testsuite/ * ld-m68k/got-multigot-12-13-14-34-35-ok.d: Update. * ld-m68k/got-multigot-14-ok.d: Update. * ld-m68k/m68k-got.exp: Update. * ld-m68k/got-negative-12-13-14-34-ok.d: Update. * ld-m68k/got-negative-14-ok.d: Update. * ld-m68k/tls-gd-1.d, ld-m68k/tls-gd-2.d: New tests. * ld-m68k/tls-gd-ie-1.d, ld-m68k/tls-ie-1.d: New tests. * ld-m68k/tls-ld-1.d, ld-m68k/tls-ld-2.d: New tests. * ld-m68k/tls-ld-1.s, ld-m68k/tls-ld-2.s, ld-m68k/tls-le-1.s: New test sources. * ld-m68k/tls-no-1.s, ld-m68k/tls-gd-ie-1.s, ld-m68k/tls-gd-1.s: New test sources. * ld-m68k/tls-gd-2.s, ld-m68k/tls-ie-1.s: New test sources. * ld-m68k/m68k.exp: Run new tests. (merge isa-a isa-a:nodiv): Fix. gas/testsuite/ * gas/m68k/tls-gd-3.d, gas/m68k/tls-gd-3.s: New test. * gas/m68k/all.exp: Run it. gas/ * config/m68k-parse.h (enum pic_relocation): Add values for TLS relocations. * config/m68k-parse.y (yylex): Parse TLS relocations. * config/tc-m68k.c (m68k_elf_cons): New static function. (md_pseudo_table): Use it. (get_reloc_code, tc_m68k_fix_adjustable, tc_gen_reloc): Handle TLS relocations. (md_apply_fix): Fix to set thread local flag. (m68k_elf_suffix): New static function; helper for m68k_elf_cons. include/elf/ * m68k.h: Map TLS relocations to numbers. bfd/ * bfd-in2.h: Regenerate. * elf32-m68k.c: Handle 2-slot GOT entries. Rename variables and fields from n_entries to n_slots where appropriate, update comments. (HOWTO): Add TLS relocations. (reloc_map): Map BFD_RELOC_68K_TLS_* to R_68K_TLS_*. (enum elf_m68k_got_offset_size): New enum. (struct elf_m68k_got_entry.type): Move field to ... (struct elf_m68k_got_entry_key): ... here. Update all uses. (elf_m68k_reloc_got_type, elf_m68k_reloc_got_offset_size): New static functions. (elf_m68k_reloc_got_n_entries, elf_m68k_reloc_tls_p): New static functions. (struct elf_m68k_got): merge rel_8o_n_entries and rel_8o_16o_n_entries fields into n_entries array. Update comments. (elf_m68k_init_got): Simplify, update all uses. (elf_m68k_init_got_entry_key): Handle R_68K_TLS_LDM32 reloc, update. (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT): Adjust to handle 2-slot GOT entries; update name, update all uses. (ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): Ditto. (elf_m68k_get_got_entry): Update. (elf_m68k_update_got_entry_type): Rewrite to handle TLS GOT entries, simplify. (elf_m68k_remove_got_entry_type): Simplify. (elf_m68k_add_entry_to_got, elf_m68k_can_merge_gots_1): Update. (elf_m68k_can_merge_gots): Update. (elf_m68k_merge_gots_1, elf_m68k_merge_gots): Update. (struct elf_m68k_finalize_got_offsets_arg): Rewrite to handle 2-slot GOT entries, simplify. (elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Same. (struct elf_m68k_partition_multi_got_arg): Add slots_relas_diff field, remove obsoleted local_n_entries field. (elf_m68k_partition_multi_got_2): New static function. (elf_m68k_partition_multi_got_1, elf_m68k_partition_multi_got): Use it; update. (elf_m68k_remove_got_entry_type): Update. (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions. (elf_m68k_check_relocs): Handle TLS relocations. Remove unnecessary update of sgot->size and srelgot->size. (elf_m68k_gc_sweep_hook): Update. (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions. (elf_m68k_relocate_section, elf_m68k_finish_dynamic_symbol): Handle TLS relocations. * reloc.c (BFD_RELOC_68K_TLS_*): Declare TLS relocations. * libbfd.h (bfd_reloc_code_real_names): Add BFD_RELOC_68K_TLS_*.
2008-12-23Add LM32 port.Nick Clifton1-0/+13
2008-12-23Remove STT_IFUNC support.Nick Clifton1-7/+0
2008-12-20 * elf32-cris.c (cris_elf_howto_table): Add entry for R_CRIS_32_IE.Hans-Peter Nilsson1-0/+1
(cris_reloc_map): Similarly. (cris_elf_relocate_section, cris_elf_gc_sweep_hook) (cris_elf_check_relocs): Handle R_CRIS_32_IE. * reloc.c (bfd_reloc_code_type): Add entry for R_CRIS_32_IE. * bfd-in2.h, libbfd.h: Regenerate.
2008-12-03include/elf/Nick Clifton1-27/+31
* common.h (STT_IFUNC): Define. elfcpp/ * elfcpp.h (enum STT): Add STT_IFUNC. bfd/ * syms.c (struct bfd_symbol): Add new flag BSF_INDIRECT_FUNCTION. Remove redundant flag BFD_FORT_COMM_DEFAULT_VALUE. Renumber flags to remove gaps. (bfd_print_symbol_vandf): Return 'i' for BSF_INDIRECT_FUNCTION. (bfd_decode_symclass): Likewise. * elf.c (swap_out_syms): Translate BSF_INDIRECT_FUNCTION into STT_IFUNC. (elf_find_function): Treat STT_IFUNC in the same way as STT_FUNC. (_bfd_elf_is_function_type): Likewise. * elf32-arm.c (arm_elf_find_function): Likewise. (elf32_arm_adjust_dynamic_symbol): Likewise. (elf32_arm_swap_symbol_in): Likewise. (elf32_arm_additional_program_headers): Likewise. * elf32-i386.c (is_indirect_symbol): New function. (elf_i386_check_relocs): Also generate dynamic relocs for relocations against STT_IFUNC symbols. (allocate_dynrelocs): Likewise. (elf_i386_relocate_section): Likewise. * elf64-x86-64.c (is_indirect_symbol): New function. (elf64_x86_64_check_relocs): Also generate dynamic relocs for relocations against STT_IFUNC symbols. (allocate_dynrelocs): Likewise. (elf64_x86_64_relocate_section): Likewise. * elfcode.h (elf_slurp_symbol_table): Translate STT_IFUNC into BSF_INDIRECT_FUNCTION. * elflink.c (_bfd_elf_adjust_dynamic_reloc_section): Add support for STT_IFUNC symbols. (get_ifunc_reloc_section_name): New function. (_bfd_elf_make_ifunc_reloc_section): New function. * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs field. * bfd-in2.h: Regenerate. gas/ * config/obj-elf.c (obj_elf_type): Add support for STT_IFUNC type. * doc/as.texinfo: Document new feature. * NEWS: Mention new feature. gas/testsuite/ * gas/elf/type.s: Add test of STT_IFUNC symbol type. * gas/elf/type.e: Update expected disassembly. * gas/elf/elf.exp: Update grep of symbol types. ld/ * NEWS: Mention new feature. * pe-dll.c (process_def_file): Replace use of redundant BFD_FORT_COMM_DEFAULT_VALUE with 0. * scripttempl/elf.sc: Add .rel.ifunc.dyn and .rela.ifunc.dyn sections. ld/testsuite/ * ld-mips-elf/reloc-1-n32.d: Updated expected output for reloc descriptions. * ld-mips-elf/reloc-1-n64.d: Likewise. * ld-i386/ifunc.d: New test. * ld-i386/ifunc.s: Source file for the new test. * ld-i386/i386.exp: Run the new test.
2008-11-28 * aoutx.h (NAME): Add case statements for bfd_mach_mips14000,Thiemo Seufer1-0/+2
bfd_mach_mips16000. * archures.c (bfd_architecture): Add .#defines for bfd_mach_mips14000, bfd_mach_mips16000. * bfd-in2.h: Regenerate. * cpu-mips.c: Add enums I_mips14000, I_mips16000. (arch_info_struct): Add refs to R14000, R16000. * elfxx-mips.c (mips_set_isa_flags): Handle bfd_mach_mips14000, bfd_mach_mips16000. (mips_mach_extensions): Map R14000, R16000 to R10000. * config/tc-mips.c (hilo_interlocks): Handle CPU_R14000, CPU_R16000. (mips_cpu_info_table): Add r14000, r16000. * doc/c-mips.texi: Add entries for 14000, 16000. * mips-dis.c (mips_arch_choices): Add r14000, r16000. * mips.h: Define CPU_R14000, CPU_R16000. (OPCODE_IS_MEMBER): Include R14000, R16000 in test.
2008-11-27 * Add PIC support for CR16 target.M R Swami Reddy1-0/+7
* elf32-cr16.c (R_CR16_GOT_REGREL20, R_CR16_GOTC_REGREL20 and R_CR16_GLOB_DAT): New macros (cr16_elf_howto_table): Add entries for for R_CR16_GOT_REGREL20, R_CR16_GOTC_REGREL20 and R_CR16_GLOB_DAT. (cr16_reloc_map): Ditto (_bfd_cr16_elf_create_got_section): New function to create GOT section. (_bfd_cr16_elf_create_dynamic_sections): New function to create dynamic section. (_bfd_cr16_elf_adjust_dynamic_symbol): New function to adjust symbol defined by dynamic object. (_bfd_cr16_elf_size_dynamic_sections): New function to find the size of dynamic section. (_bfd_cr16_elf_finish_dynamic_symbol): New function to handle dynamic symbols. (_bfd_cr16_elf_finish_dynamic_symbol): New function to handle dynamic sections. (bfd_cr16_elf32_create_embedded_relocs): New function to create embedded relocs in .emreloc section in memory for .data.rel section. (_bfd_cr16_elf_reloc_type_class): New function for classify reloc types. (cr16_elf_check_relocs): New function for checking reloc types in first phase. (cr16_elf_final_link_relocate): Update for handling the new reloc types R_CR16_GOT_REGREL20 and R_CR16_GOTC_REGREL20. (elf32_cr16_relax_section): Update relax implementation. * reloc.c (bfd_reloc_code_type): Add entries for R_CR16_GOT_REGREL20, R_CR16_GOTC_REGREL20 and R_CR16_GLOB_DAT. * bfd-in.h (bfd_boolean bfd_cr16_elf32_create_embedded_relocs): Declared * libbfd.h, bfd-in2.h: Regenerate.
2008-10-04 * elf32-cris.c (TLSHOWTO32, TLSHOWTO16): New macros.Hans-Peter Nilsson1-0/+13
(cris_elf_howto_table): Add entries for R_CRIS_32_GOT_GD, R_CRIS_16_GOT_GD, R_CRIS_32_GD, R_CRIS_DTP, R_CRIS_32_DTPREL, R_CRIS_16_DTPREL, R_CRIS_DTPMOD, R_CRIS_32_GOT_TPREL, R_CRIS_16_GOT_TPREL, R_CRIS_32_TPREL, R_CRIS_16_TPREL. (cris_reloc_map): Similarly. * reloc.c (bfd_reloc_code_type): Add entries for BFD_RELOC_CRIS_32_GOT_GD, BFD_RELOC_CRIS_16_GOT_GD, BFD_RELOC_CRIS_32_GD, BFD_RELOC_CRIS_DTP, BFD_RELOC_CRIS_32_DTPREL, BFD_RELOC_CRIS_16_DTPREL, BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_GOT_TPREL, BFD_RELOC_CRIS_16_GOT_TPREL, BFD_RELOC_CRIS_32_TPREL, BFD_RELOC_CRIS_16_TPREL. * libbfd.h, bfd-in2.h: Regenerate.
2008-08-202008-08-20 Bob Wilson <bob.wilson@acm.org>Bob Wilson1-0/+9
bfd/ * elf-bfd.h (elf_object_id): Add XTENSA_ELF_TDATA. * elf32-xtensa.c (elf_howto_table): Add TLS relocations. (elf_xtensa_reloc_type_lookup): Likewise. (TCB_SIZE): Define. (elf_xtensa_link_hash_entry): New. (GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE, GOT_TLS_ANY): Define. (elf_xtensa_hash_entry): Define. (elf_xtensa_obj_tdata): New. (elf_xtensa_tdata): Define. (elf_xtensa_local_got_tls_type): Define. (elf_xtensa_local_tlsfunc_refcounts): Define. (is_xtensa_elf): Define. (elf_xtensa_mkobject): New. (elf_xtensa_link_hash_table): Add tlsbase field. (elf_xtensa_link_hash_newfunc): New. (elf_xtensa_link_hash_table_create): Use elf_xtensa_link_hash_newfunc. Create an entry for "_TLS_MODULE_BASE_" and save it in tlsbase field. (elf_xtensa_copy_indirect_symbol): New. (elf_xtensa_check_relocs): Rewrite to handle TLS relocations. (elf_xtensa_gc_sweep_hook): Likewise. (elf_xtensa_allocate_dynrelocs): Optimize away GOT entries for TLSDESC_FN relocations when an IE reference is seen. (elf_xtensa_allocate_local_got_size): Likewise. (elf_xtensa_always_size_sections): New. (dtpoff_base, tpoff): New. (elf_xtensa_do_reloc): Handle TLS relocations. (replace_tls_insn): New. (IS_XTENSA_TLS_RELOC): Define. (elf_xtensa_relocate_section): Handle TLS relocations. (get_indirect_call_dest_reg): New. (bfd_elf32_mkobject): Define. (elf_backend_always_size_sections): New. (elf_backend_copy_indirect_symbol): New. * reloc.c (BFD_RELOC_XTENSA_TLSDESC_FN, BFD_RELOC_XTENSA_TLSDESC_ARG) (BFD_RELOC_XTENSA_TLS_DTPOFF, BFD_RELOC_XTENSA_TLS_TPOFF) (BFD_RELOC_XTENSA_TLS_FUNC, BFD_RELOC_XTENSA_TLS_ARG) (BFD_RELOC_XTENSA_TLS_CALL): New. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. gas/ * config/tc-xtensa.c (O_tlsfunc, O_tlsarg, O_tlscall): Define. (O_tpoff, O_dtpoff): Define. (suffix_relocs): Add entries for TLS suffixes. (xtensa_elf_cons): Check for invalid use of TLS relocations. (map_operator_to_reloc): Add is_literal parameter and use it to control translating TLS instruction relocations to the corresponding literal relocations. (xg_valid_literal_expression): Allow TLS operators. (xg_build_to_insn): Copy TLS operators from pseudo-instruction operands to generated literals. (xg_assemble_literal): Handle TLS operators. Update call to map_operator_to_reloc. (md_assemble): Handle CALLXn.TLS pseudo-instruction. (md_apply_fix): Handle TLS relocations. (emit_single_op): Handle TLS operators. (convert_frag_immed): Update call to map_operator_to_reloc. (vinsn_to_insnbuf): Emit relocations for TLS-related instructions. * config/xtensa-istack.h (tinsn_struct): Add tls_reloc field. * config/xtensa-relax.c (append_literal_op): Add src_op parameter to initialize the op_data field of the BuildOp. (build_transition): Use it here to record the source operand corresponding to a generated literal. * config/xtensa-relax.h (build_op): Comment op_data use for literals. include/elf/ * xtensa.h (R_XTENSA_TLSDESC_FN, R_XTENSA_TLSDESC_ARG) (R_XTENSA_TLS_DTPOFF, R_XTENSA_TLS_TPOFF, R_XTENSA_TLS_FUNC) (R_XTENSA_TLS_ARG, R_XTENSA_TLS_CALL): New. ld/testsuite/ * ld-xtensa/tlsbin.dd, ld-xtensa/tlsbin.rd, ld-xtensa/tlsbin.s, ld-xtensa/tlsbin.sd, ld-xtensa/tlsbin.td, ld-xtensa/tlslib.s, ld-xtensa/tlspic.dd, ld-xtensa/tlspic.rd, ld-xtensa/tlspic.sd, ld-xtensa/tlspic.td, ld-xtensa/tlspic1.s, ld-xtensa/tlspic2.s: New. * ld-xtensa/xtensa.exp: Run them.
2008-08-17bfd/Alan Modra1-1/+2
* bfd.c (struct _bfd): Correct outsymbols comment. * bfd-in2.h: Regenerate. * linker.c (bfd_generic_link_read_symbols): Renamed from.. (generic_link_read_symbols): ..this, and made global. include/ * bfdlink.h (bfd_generic_link_read_symbols): Declare. ld/ PR 6478 * ldcref.c (check_local_sym_xref): Use bfd_generic_link_read_symbols. Don't free symbol pointer array. (check_refs): Likewise. * ldmain.c (warning_callback): Likewise. * ldmisc.c (vfinfo): Likewise. * pe-dll.c (process_def_file): Likewise. (pe_walk_relocs_of_symbol, generate_reloc): Likewise. * emultempl/pe.em (pe_find_data_imports): Likewise. (gld_${EMULATION_NAME}_after_open): Likewise. * emultempl/pep.em (pep_find_data_imports): Likewise. (gld_${EMULATION_NAME}_after_open): Likewise. * ldlang.h (lang_input_statement_type): Delete asymbols, symbol_count, passive_position, closed. * ldlang.c (new_afile): Don't set asymbols and symbol_count. * ldmain.c (add_archive_element): xcalloc lang_input_statement_type.
2008-08-09Add AVR architectures avr25, avr31, avr35, and avr51 to match GCC.Eric B. Weddington1-0/+4
bfd/ * archures.c (bfd_mach_avr25, bfd_mach_avr31, bfd_mach_avr35, bfd_mach_avr51): New. * bfd-in2.h: Regenerate. * cpu-avr.c (arch_info_struct): Add avr25, avr31, avr35, and avr51 architectures. Change comments to match architecture comments in GCC. (compatible): Add test for new AVR architectures. * elf32-avr.c (bfd_elf_avr_final_write_processing): Recognize bfd_mach_avr25, bfd_mach_avr31, bfd_mach_avr35 and bfd_mach_avr51. (elf32_avr_object_p): Recognize E_AVR_MACH_AVR25, E_AVR_MACH_AVR31, E_AVR_MACH_AVR35 and E_AVR_MACH_AVR51. gas/ * config/tc-avr.c (mcu_types): Add avr25, avr31, avr35, and avr51 architectures. Reorganize list to put mcu types in correct architectures and to order list same as in GCC. Use new ISA definitions in include/opcode/avr.h. * doc/c-avr.texi: Add avr25, avr31, avr35, and avr51 architecture descriptions. Reorganize descriptions to put mcu types in correct architectures and to order lists same as in GCC. include/ * elf/avr.h (E_AVR_MACH_AVR25, E_AVR_MACH_AVR31, E_AVR_MACH_AVR35, E_AVR_MACH_AVR51): Define. (EF_AVR_MACH): Redefine to 0x7F. * opcode/avr.h (AVR_ISA_TINY3, AVR_ISA_ALL, AVR_ISA_USB162): Remove. (AVR_ISA_AVR3): Redefine. (AVR_ISA_AVR1, AVR_ISA_AVR2, AVR_ISA_AVR31, AVR_ISA_AVR35, AVR_ISA_AVR3_ALL, AVR_ISA_AVR4, AVR_ISA_AVR5, AVR_ISA_AVR51, AVR_ISA_AVR6): Define. ld/ * Makefile.am (ALL_EMULATIONS): Add eavr25.o, eavr31.o, eavr35.o, and eavr51.o. Add rules for eavr25.c, eavr31.c, eavr35.c, eavr51.c. * Makefile.in: Regenerate. * configure.tgt (avr-*-*, targ_extra_emuls): Add avr25, avr31, avr35 and avr51. * emulparams/avr25.sh: New file. * emulparams/avr31.sh: New file. * emulparams/avr35.sh: New file. * emulparams/avr51.sh: New file.
2008-08-082008-08-08 Richard Sandiford <rdsandiford@googlemail.com>Daniel Jacobowitz1-1/+1
Daniel Jacobowitz <dan@codesourcery.com> Catherine Moore <clm@codesourcery.com> Mark Shinwell <shinwell@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com> * elf32-mips.c (mips_vxworks_copy_howto_rela): Replace with... (elf_mips_copy_howto): ...this howto. Clear the size fields. (mips_vxworks_jump_slot_howto_rela): Replace with... (elf_mips_jump_slot_howto): ...this howto. (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY and BFD_RELOC_MIPS_JUMP_SLOT. (bfd_elf32_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and "R_MIPS_JUMP_SLOT". (mips_elf32_rtype_to_howto): Handle R_MIPS_COPY and R_MIPS_JUMP_SLOT. (elf_backend_plt_readonly): Define. (elf_backend_plt_sym_val): Define for non-VxWorks targets. (mips_vxworks_bfd_reloc_type_lookup): Delete. (mips_vxworks_bfd_reloc_name_lookup): Likewise. (mips_vxworks_rtype_to_howto): Likewise. (elf_backend_want_dynbss): Don't define for VxWorks. (elf_backend_plt_readonly): Likewise. (bfd_elf32_bfd_reloc_type_lookup): Likewise. (bfd_elf32_bfd_reloc_name_lookup): Likewise. (elf_backend_mips_rtype_to_howto): Likewise. (elf_backend_adjust_dynamic_symbol): Likewise. (elf_backend_got_symbol_offset): Don't define. * elfn32-mips.c (elf_mips_copy_howto, elf_mips_jump_slot_howto): New. (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY and BFD_RELOC_MIPS_JUMP_SLOT. (bfd_elf32_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and "R_MIPS_JUMP_SLOT". (mips_elf32_n32_rtype_to_howto): Handle R_MIPS_COPY and R_MIPS_JUMP_SLOT. (elf_backend_rela_plts_and_copies_p, elf_backend_plt_readonly) (elf_backend_plt_sym_val): Define. * elf64-mips.c (elf_mips_copy_howto, elf_mips_jump_slot_howto): New. (bfd_elf64_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY and BFD_RELOC_MIPS_JUMP_SLOT. (bfd_elf64_bfd_reloc_name_lookup): Handle "R_MIPS_COPY" and "R_MIPS_JUMP_SLOT". (mips_elf64_rtype_to_howto): Handle R_MIPS_COPY and R_MIPS_JUMP_SLOT. (elf_backend_rela_plts_and_copies_p, elf_backend_plt_readonly) (elf_backend_plt_sym_val): Define. * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Delete. (_bfd_mips_elf_use_plts_and_copy_relocs, _bfd_mips_elf_init_stubs) (_bfd_mips_elf_plt_sym_val, _bfd_mips_post_process_headers): Declare. * elfxx-mips.c (mips_elf_la25_stub): New structure. (LA25_LUI, LA25_J, LA25_ADDIU): New macros. (mips_elf_link_hash_entry): Add "la25_stubs", "has_static_relocs" and "has_nonpic_branches" fields. Remove "is_relocation_target" and "is_branch_target". (mips_elf_link_hash_table): Add blank lines. Add "use_plts_and_copy_relocs", "reserved_gotno", "strampoline", "la25_stubs" and "add_stub_section" fields. (mips_htab_traverse_info): New structure. (PIC_OBJECT_P, MIPS_ELF_LOAD_WORD): New macros. (MIPS_RESERVED_GOTNO): Delete. (mips_o32_exec_plt0_entry, mips_n32_exec_plt0_entry) (mips_n64_exec_plt0_entry, mips_exec_plt_entry): New tables. (mips_elf_link_hash_newfunc): Update after the changes to mips_elf_link_hash_entry. (mips_elf_check_mips16_stubs): Replace the DATA parameter with an INFO parameter. Don't look through warnings symbols here; do it in mips_elf_check_symbols instead. (mips_elf_create_stub_symbol): New function. (mips_elf_la25_stub_hash, mips_elf_la25_stub_eq): New functions. (_bfd_mips_elf_init_stubs, mips_elf_local_pic_function_p): Likewise. (mips_elf_add_la25_intro, mips_elf_add_la25_trampoline): Likewise. (mips_elf_add_la25_stub, mips_elf_check_symbols): New functions. (mips_elf_gotplt_index): Check for VxWorks. (mips_elf_output_dynamic_relocation): Take the relocation index as an extra parameter. Do not increment reloc_count here. (mips_elf_initialize_tls_slots): Update the calls to mips_elf_output_dynamic_relocation accordingly. (mips_elf_multi_got): Use htab->reserved_gotno instead of MIPS_RESERVED_GOTNO. (mips_elf_create_got_section): Don't allocate reserved GOT entries here. Unconditionally create .got.plt, but don't set its alignment here. (mips_elf_relocation_needs_la25_stub): New function. (mips_elf_calculate_relocation): Redirect branches and jumps to a non-PIC stub if one exists. Check !h->has_static_relocs instead of !htab->is_vxworks when deciding whether to create dynamic relocations for R_MIPS_32, R_MIPS_REL32 and R_MIPS_64. (_bfd_mips_elf_create_dynamic_sections): Unconditionally call _bfd_elf_create_dynamic_sections. Unconditionally set up htab->splt and htab->sdynbss. Set htab->srelplt to ".rel.plt" if !htab->is_vxworks. Add non-VxWorks values of htab->plt_header_size and htab->plt_entry_size. (_bfd_mips_elf_check_relocs): Set pointer_equality_needed for non-branch static relocations. Set has_nonpic_branches when an la25 stub might be required. Set can_make_dynamic_p to TRUE if R_MIPS_32, R_MIPS_REL32 and R_MIPS_64 relocations can be made dynamic, rather than duplicating the condition. Do not make them dynamic for read-only sections in non-PIC executable objects. Do not protect this code with dynobj == NULL || htab->sgot == NULL; handle each group of cases separately. Add a default case that sets has_static_relocs for non-GOT relocations that cannot be made dynamic. Don't set is_relocation_target and is_branch_target. Reject non-PIC static relocations in shared objects. (_bfd_mips_vxworks_adjust_dynamic_symbol): Fold into... (_bfd_mips_elf_adjust_dynamic_symbol): ...here, using htab->use_plts_and_copy_relocs instead of htab->is_vxworks to select PLT and copy-reloc handling. Set the alignment of .plt and .got.plt when allocating the first entry. Generalize code to handle REL as well as RELA sections and 64-bit as well as 32-bit GOT entries. Complain if we find a static-only reloc against an externally-defined symbol and if we cannot create dynamic relocations for it. Allocate copy relocs using mips_elf_allocate_dynamic_relocations on non-VxWorks targets. Set possibly_dynamic_relocs to 0 when using PLTs or copy relocs. Skip reserved .got.plt entries. (_bfd_mips_elf_always_size_sections): Use mips_elf_check_symbols instead of mips_elf_check_mips16_stubs to process each symbol. Do the traversal for relocatable objects too. (mips_elf_lay_out_got): Use htab->reserved_gotno instead of MIPS_RESERVED_GOTNO. (_bfd_mips_elf_size_dynamic_sections): Exclude sdynbss if it is empty. Extend the DT_PLTREL, DT_JMPREL and DT_PLTRELSZ handling to non-VxWorks targets. Only add DT_REL{,A}, DT_REL{,A}SZ and DT_REL{,A}ENT if .rel.dyn is nonempty. Create a symbol for the PLT. Allocate a nop at the end of the PLT. Allocate DT_MIPS_PLTGOT. (mips_elf_create_la25_stub_info): New function. (_bfd_mips_elf_finish_dynamic_symbol): Write out PLT entries and copy relocs where necessary. Check pointer_equality_needed. (mips_finish_exec_plt): New function. (_bfd_mips_elf_finish_dynamic_sections): Always set DT_PLTGOT to the beginning of htab->sgot. Use htab->reserved_gotno instead of MIPS_RESERVED_GOTNO. Assert htab->use_plts_and_copy_relocs instead of htab->is_vxworks for DT_PLTREL, DT_PLTRELSZ and DT_JMPREL. Set DT_PLTREL to DT_REL instead of DT_RELA on non-VxWorks targets. Use mips_finish_exec_plt to create non-VxWorks PLT headers. Set DT_MIPS_PLTGOT. (_bfd_mips_elf_copy_indirect_symbol): Copy has_static_relocs from the indirect symbol to the direct symbol. Also copy has_nonpic_branches for indirect symbols. (_bfd_mips_elf_get_target_dtag): Handle DT_MIPS_PLTGOT and DT_MIPS_RWPLT. (_bfd_mips_elf_link_hash_table_create): Initialize the new mips_elf_link_hash_table fields. (_bfd_mips_vxworks_link_hash_table_create): Set use_plts_and_copy_relocs to TRUE. Use TRUE rather than 1 when setting is_vxworks. (_bfd_mips_elf_use_plts_and_copy_relocs): New function. (_bfd_mips_elf_final_link): Call mips_elf_create_la25_stub for each la25_stub. (_bfd_mips_elf_merge_private_bfd_data): Treat dynamic objects as PIC. Generalize message about linking PIC and non-PIC. (_bfd_mips_elf_plt_sym_val, _bfd_mips_post_process_headers): New functions. * reloc.c: Update comment near BFD_RELOC_MIPS_JUMP_SLOT. * bfd-in2.h: Regenerated. 2008-08-08 Richard Sandiford <rdsandiford@googlemail.com> Daniel Jacobowitz <dan@codesourcery.com> Catherine Moore <clm@codesourcery.com> Mark Shinwell <shinwell@codesourcery.com> * readelf.c (get_mips_symbol_other): Handle STO_MIPS_PLT and STO_MIPS_PIC. (slurp_rela_relocs, slurp_rel_relocs): Handle MIPS ELF64 here. (dump_relocations, debug_apply_relocations): Don't handle it here. (get_mips_dynamic_type): Handle DT_MIPS_PLTGOT and DT_MIPS_RWPLT. (print_mips_pltgot_entry): New function. (process_mips_specific): Dump the PLT GOT. 2008-08-08 Richard Sandiford <rdsandiford@googlemail.com> Daniel Jacobowitz <dan@codesourcery.com> * config/tc-mips.c (OPTION_CALL_NONPIC): New macro. (OPTION_NON_SHARED, OPTION_XGOT, OPTION_MABI, OPTION_32) (OPTION_N32, OPTION_64, OPTION_MDEBUG, OPTION_NO_MDEBUG) (OPTION_PDR, OPTION_NO_PDR, OPTION_MVXWORKS_PIC): Bump by 1. (md_longopts): Add -call_nonpic. (md_parse_option): Handle OPTION_CALL_NONPIC. (md_show_usage): Add -call_nonpic. 2008-08-08 Richard Sandiford <rdsandiford@googlemail.com> * gas/mips/call-nonpic-1.s, gas/mips/call-nonpic-1.d: New test. * gas/mips/mips.exp: Run it. 2008-08-08 Richard Sandiford <rdsandiford@googlemail.com> Daniel Jacobowitz <dan@codesourcery.com> Catherine Moore <clm@codesourcery.com> Mark Shinwell <shinwell@codesourcery.com> * mips.h (STO_MIPS_PLT, ELF_ST_IS_MIPS_PLT, ELF_ST_SET_MIPS_PLT) (STO_MIPS_PIC, DT_MIPS_PLTGOT, DT_MIPS_RWPLT): New macros. 2008-08-08 Richard Sandiford <rdsandiford@googlemail.com> Daniel Jacobowitz <dan@codesourcery.com> * emulparams/elf32bmip.sh (GOT): Define, moving .got.plt to... (OTHER_RELRO_SECTIONS, OTHER_READWRITE_SECTIONS): ...one of these two variables. * emulparams/elf32bmipn32-defs.sh: Likewise. * emultempl/mipself.em: Include ldctor.h, elf/mips.h and elfxx-mips.h. (is_mips_elf): New macro. (stub_file, stub_bfd): New variables. (hook_stub_info): New structure. (hook_in_stub): New function. (mips_add_stub_section): Likewise. (mips_create_output_section_statements): Likewise. (mips_before_allocation): Likewise. (real_func): New variable. (mips_for_each_input_file_wrapper): New function. (mips_lang_for_each_input_file): Likewise. (lang_for_each_input_file): Define. (LDEMUL_BEFORE_ALLOCATION): Likewise. (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Likewise. 2008-08-08 Richard Sandiford <rdsandiford@googlemail.com> Daniel Jacobowitz <dan@codesourcery.com> * ld-mips-elf/mips16-pic-3a.s, ld-mips-elf/mips16-pic-3b.s, ld-mips-elf/mips16-pic-3.dd, ld-mips-elf/mips16-pic-3.gd, ld-mips-elf/mips16-pic-3.rd, ld-mips-elf/mips16-pic-3.inc, ld-mips-elf/pic-and-nonpic-1a.s, ld-mips-elf/pic-and-nonpic-1b.s, ld-mips-elf/pic-and-nonpic-1.ld, ld-mips-elf/pic-and-nonpic-1.dd, ld-mips-elf/pic-and-nonpic-1.nd, ld-mips-elf/pic-and-nonpic-1-rel.dd, ld-mips-elf/pic-and-nonpic-1-rel.nd, ld-mips-elf/pic-and-nonpic-2a.s, ld-mips-elf/pic-and-nonpic-2b.s, ld-mips-elf/pic-and-nonpic-2.d, ld-mips-elf/pic-and-nonpic-3a.s, ld-mips-elf/pic-and-nonpic-3a.ld, ld-mips-elf/pic-and-nonpic-3a.dd, ld-mips-elf/pic-and-nonpic-3a.gd, ld-mips-elf/pic-and-nonpic-3a.sd, ld-mips-elf/pic-and-nonpic-3b.s, ld-mips-elf/pic-and-nonpic-3b.ld, ld-mips-elf/pic-and-nonpic-3b.ad, ld-mips-elf/pic-and-nonpic-3b.dd, ld-mips-elf/pic-and-nonpic-3b.gd, ld-mips-elf/pic-and-nonpic-3b.nd, ld-mips-elf/pic-and-nonpic-3b.pd, ld-mips-elf/pic-and-nonpic-3b.rd, ld-mips-elf/pic-and-nonpic-3b.sd, ld-mips-elf/pic-and-nonpic-3-error.d, ld-mips-elf/pic-and-nonpic-4a.s, ld-mips-elf/pic-and-nonpic-4b.s, ld-mips-elf/pic-and-nonpic-4b.ld, ld-mips-elf/pic-and-nonpic-4b.ad, ld-mips-elf/pic-and-nonpic-4b.dd, ld-mips-elf/pic-and-nonpic-4b.gd, ld-mips-elf/pic-and-nonpic-4b.nd, ld-mips-elf/pic-and-nonpic-4b.rd, ld-mips-elf/pic-and-nonpic-4b.sd, ld-mips-elf/pic-and-nonpic-4-error.d, ld-mips-elf/pic-and-nonpic-5a.s, ld-mips-elf/pic-and-nonpic-5b.s, ld-mips-elf/pic-and-nonpic-5b.ld, ld-mips-elf/pic-and-nonpic-5b.ad, ld-mips-elf/pic-and-nonpic-5b.dd, ld-mips-elf/pic-and-nonpic-5b.gd, ld-mips-elf/pic-and-nonpic-5b.nd, ld-mips-elf/pic-and-nonpic-5b.rd, ld-mips-elf/pic-and-nonpic-5b.sd, ld-mips-elf/pic-and-nonpic-5b.pd, ld-mips-elf/pic-and-nonpic-6.ld, ld-mips-elf/pic-and-nonpic-6-o32a.s, ld-mips-elf/pic-and-nonpic-6-o32b.s, ld-mips-elf/pic-and-nonpic-6-o32c.s, ld-mips-elf/pic-and-nonpic-6-o32.ad, ld-mips-elf/pic-and-nonpic-6-o32.dd, ld-mips-elf/pic-and-nonpic-6-o32.gd, ld-mips-elf/pic-and-nonpic-6-o32.nd, ld-mips-elf/pic-and-nonpic-6-o32.pd, ld-mips-elf/pic-and-nonpic-6-o32.rd, ld-mips-elf/pic-and-nonpic-6-o32.sd, ld-mips-elf/pic-and-nonpic-6-n32a.s, ld-mips-elf/pic-and-nonpic-6-n32b.s, ld-mips-elf/pic-and-nonpic-6-n32c.s, ld-mips-elf/pic-and-nonpic-6-n32.ad, ld-mips-elf/pic-and-nonpic-6-n32.dd, ld-mips-elf/pic-and-nonpic-6-n32.gd, ld-mips-elf/pic-and-nonpic-6-n32.nd, ld-mips-elf/pic-and-nonpic-6-n32.pd, ld-mips-elf/pic-and-nonpic-6-n32.rd, ld-mips-elf/pic-and-nonpic-6-n32.sd, ld-mips-elf/pic-and-nonpic-6-n64a.s, ld-mips-elf/pic-and-nonpic-6-n64b.s, ld-mips-elf/pic-and-nonpic-6-n64c.s, ld-mips-elf/pic-and-nonpic-6-n64.ad, ld-mips-elf/pic-and-nonpic-6-n64.dd, ld-mips-elf/pic-and-nonpic-6-n64.gd, ld-mips-elf/pic-and-nonpic-6-n64.nd, ld-mips-elf/pic-and-nonpic-6-n64.pd, ld-mips-elf/pic-and-nonpic-6-n64.rd, ld-mips-elf/pic-and-nonpic-6-n64.sd: New tests. * ld-mips-elf/mips-elf.exp: Run them.
2008-08-06bfd/Richard Sandiford1-0/+5
* reloc.c (BFD_RELOC_MIPS16_GOT16, BFD_RELOC_MIPS16_CALL16): Declare. * libbfd.h, bfd-in2.h: Regenerate. * elf32-mips.c (elf_mips16_howto_table_rel): Fill in reserved R_MIPS16_GOT16 and R_MIPS16_CALL16 entries. (mips16_reloc_map): Add mappings. * elf64-mips.c (mips16_elf64_howto_table_rel): Fill in reserved R_MIPS16_GOT16 and R_MIPS16_CALL16 entries. (mips16_elf64_howto_table_rela): Likewise. (mips16_reloc_map): Add mappings. * elfn32-mips.c (elf_mips16_howto_table_rel): Fill in reserved R_MIPS16_GOT16 and R_MIPS16_CALL16 entries. (elf_mips16_howto_table_rela): Likewise. (mips16_reloc_map): Add mappings. * elfxx-mips.c (mips_elf_create_shadow_symbol): New function. (section_allows_mips16_refs_p): Likewise. (mips16_stub_symndx): Likewise. (mips_elf_check_mips16_stubs): Treat the data argument as a bfd_link_info. Mark every dynamic symbol as needing MIPS16 stubs and create a "shadow" symbol for the original MIPS16 definition. (mips16_reloc_p, got16_reloc_p, call16_reloc_p, hi16_reloc_p) (lo16_reloc_p, mips16_call_reloc_p): New functions. (_bfd_mips16_elf_reloc_unshuffle): Use mips16_reloc_p to generalize relocation checks. (_bfd_mips16_elf_reloc_shuffle): Likewise. (_bfd_mips_elf_lo16_reloc): Handle R_MIPS16_GOT16. (mips_elf_got16_entry): Add comment. (mips_elf_calculate_relocation): Use hi16_reloc_p, lo16_reloc_p, mips16_call_reloc_p, call16_reloc_p and got16_reloc_p to generalize relocation checks. Use section_allows_mips16_refs_p instead of mips16_stub_section_p. Handle R_MIPS16_CALL16 and R_MIPS16_GOT16, allowing the former to refer directly to a MIPS16 function if its stub is not needed. (mips16_stub_section_p): Delete. (_bfd_mips_elf_symbol_processing): Convert odd-valued function symbols into even MIPS16 symbols. (mips_elf_add_lo16_rel_addend): Use mips16_reloc_p to generalize a relocation check. (_bfd_mips_elf_check_relocs): Calculate "bed" and "rel_end" earlier in the function. Use mips16_stub_symndx to identify the target function. Avoid out-of-bounds accesses when the stub has no relocations; report an error instead. Use section_allows_mips16_refs_p instead of mips16_stub_section_p. Use mips16_call_reloc_p and got16_reloc_p to generalize relocation checks. Handle R_MIPS16_CALL16 and R_MIPS16_GOT16. Don't create dynamic relocations for absolute references to __gnu_local_gp. (_bfd_mips_elf_always_size_sections): Pass a bfd_link_info as the argument to mips_elf_check_mips16_stubs. Generalize comment. (_bfd_mips_elf_relocate_section): Use hi16_reloc_p and got16_reloc_p to generalize relocation checks. (_bfd_mips_elf_finish_dynamic_symbol): If a dynamic MIPS16 function symbol has a non-MIPS16 stub, redirect the symbol to the stub. Fix an overly long line. Don't give dynamic symbols type STO_MIPS16. (_bfd_mips_elf_gc_sweep_hook): Handle R_MIPS16_CALL16 and R_MIPS16_GOT16. gas/ * config/tc-mips.c (mips16_reloc_p, got16_reloc_p, hi16_reloc_p) (lo16_reloc_p): New functions. (reloc_needs_lo_p): Use hi16_reloc_p and got16_reloc_p to generalize relocation checks. (matching_lo_reloc): New function. (fixup_has_matching_lo_p): Use it. (mips16_mark_labels): Don't clobber a symbol's visibility. (append_insn): Use hi16_reloc_p and lo16_reloc_p. (mips16_ip): Handle BFD_RELOC_MIPS16_GOT16 and BFD_RELOC_MIPS16_CALL16. (md_apply_fix): Likewise. (mips16_percent_op): Add %got and %call16. (mips_frob_file): Use got16_reloc_p to generalize relocation checks. Use matching_lo_reloc. (mips_force_relocation): Use hi16_reloc_p and lo16_reloc_p to generalize relocation checks. (mips_fix_adjustable): Use lo16_reloc_p to generalize relocation checks. gas/testsuite/ * gas/mips/elf-rel8-mips16.d, gas/mips/elf-rel8-mips16.s, * gas/mips/elf-rel9-mips16.d, gas/mips/elf-rel9-mips16.s, * gas/mips/elf-rel13-mips16.d, gas/mips/elf-rel13-mips16.s: New tests. * gas/mips/mips.exp: Run them. ld/testsuite/ * ld-mips-elf/mips16-local-stubs-1.d: Remove stub_for_h3, which was only referenced by the .pdr section, and was not actually needed by code. * ld-mips-elf/mips16-intermix.d: Remove unused static function stubs. * ld-mips-elf/mips16-pic-1a.s, ld-mips-elf/mips16-pic-1b.s, ld-mips-elf/mips16-pic-1-dummy.s, ld-mips-elf/mips16-pic-1.dd, ld-mips-elf/mips16-pic-1.gd, ld-mips-elf/mips16-pic-1.inc, ld-mips-elf/mips16-pic-1.ld, ld-mips-elf/mips16-pic-2a.s, ld-mips-elf/mips16-pic-2b.s, ld-mips-elf/mips16-pic-2.ad, ld-mips-elf/mips16-pic-2.dd, ld-mips-elf/mips16-pic-2.gd, ld-mips-elf/mips16-pic-2.nd, ld-mips-elf/mips16-pic-2.rd: New tests. * ld-mips-elf/mips-elf.exp: Run them.
2008-07-28bfd/Alan Modra1-19/+11
PR 6769 * bfd-in.h (BFD_VMA_FMT): Define. (printf_vma, sprintf_vma): Use the above. (_bfd_int64_low, _bfd_int64_high): Delete. * bfd-in2.h: Regenerate. binutils/ PR 6769 * readelf.c (print_dec_vma, print_hex_vma): Delete. (print_vma): Use BFD_VMA_FMT. * size.c (size_number, rprint_number): Likewise.
2008-07-18bfd:Joseph Myers1-1/+1
* bfd-in.h (bfd_elf32_arm_set_target_relocs): Add new parameter. * bfd-in2.h: Regenerate. * elf32-arm.c (struct elf_arm_obj_tdata): Add field no_wchar_size_warning. (bfd_elf32_arm_set_target_relocs): Add new parameter no_wchar_warn. (elf32_arm_merge_eabi_attributes): Give a warning, not an error, for conflicting wchar_t attributes. Do not warn if --no-wchar-size-warning. Make diagnostic text more specific. ld: * ld.texinfo (--no-wchar-size-warning): Document new ARM option. * emultempl/armelf.em (no_wchar_size_warning): New. (arm_elf_create_output_section_statements): Pass no_wchar_size_warning to arm_elf_create_output_section_statements. (OPTION_NO_WCHAR_SIZE_WARNING): New. (PARSE_AND_LIST_LONGOPTS): Add no-wchar-size-warning. (PARSE_AND_LIST_OPTIONS): List --no-wchar-size-warning. (PARSE_AND_LIST_ARGS_CASES): Handle --no-wchar-size-warning. ld/testsuite: * ld-arm/attr-merge-wchar-0.s,ld-arm/attr-merge-wchar-2.s, ld-arm/attr-merge-wchar-4.s, ld-arm/attr-merge-wchar-00-nowarn.d, ld-arm/attr-merge-wchar-00.d, ld-arm/attr-merge-wchar-02-nowarn.d, ld-arm/attr-merge-wchar-02.d, ld-arm/attr-merge-wchar-04-nowarn.d, ld-arm/attr-merge-wchar-04.d, ld-arm/attr-merge-wchar-20-nowarn.d, ld-arm/attr-merge-wchar-20.d, ld-arm/attr-merge-wchar-22-nowarn.d, ld-arm/attr-merge-wchar-22.d, ld-arm/attr-merge-wchar-24-nowarn.d, ld-arm/attr-merge-wchar-24.d, ld-arm/attr-merge-wchar-40-nowarn.d, ld-arm/attr-merge-wchar-40.d, ld-arm/attr-merge-wchar-42-nowarn.d, ld-arm/attr-merge-wchar-42.d, ld-arm/attr-merge-wchar-44-nowarn.d, ld-arm/attr-merge-wchar-44.d: New. * ld-arm/arm-elf.exp: Run new tests.
2008-07-10bfd/Craig Silverstein1-1/+5
* Makefile.am (BFD32_LIBS): Add compress.lo. (BFD32_LIBS_CFILES): Add compress.c. (BFD_H_FILES): Likewise. * Makefile.in: Regenerate. * bfd-in2.h: Regenerate. * config.in: Add HAVE_ZLIB_H * configure.in: Add test for libz and zlib.h * configure: Regenerate. * dwarf2.c (read_section): New function. (read_indirect_string): Call new function read_section. (read_abbrevs): Likewise. (decode_line_info): Likewise. (read_debug_ranges): Likewise. (find_line): Call new function read_section when just one .zdebug_info section is found, otherwise read and compress multiple sections. (_bfd_dwarf2_cleanup_debug_info): Free sec_info_ptr. * elf.c (_bfd_elf_make_section_from_shdr): Add zdebug prefix. (special_sections_z): New struct. (special_sections): Refer to special_sections_z. * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Recognize sections named .zdebug_*. (_bfd_mips_elf_fake_sections): Likewise. * compress.c: New file. (bfd_uncompress_section_contents): New function. bfd/doc/ * Makefile.am (BFD_H_DEP): Add ../compress.c. * Makefile.in: Regenerate. binutils/ * config.in: Add HAVE_ZLIB_H * configure.in: Add test for libz and zlib.h * configure: Regenerate. * dwarf.c (debug_displays): Add .zdebug_* strings. * dwarf.h (struct dwarf_section): Add fields uncompressed_namd and compressed_name. * objdump.c (load_debug_section): Call bfd_uncompress_section_contents when loading a compressed section. (dump_dwarf_section): Recognize compressed section name. (mach_o_dwarf_sections): Rename as mach_o_uncompressed_dwarf_sections. (mach_o_compressed_dwarf_sections): New variable. (generic_dwarf_section): Rename as generic_uncompressed_dwarf_sections. (generic_compressed_dwarf_sections): New variable. (check_mach_o_dwarf): Save and restore mach_o_compressed_dwarf_sections. * readelf.c: Add #include for config.h and zlib.h (process_section_headers): Recognize compressed section name. (uncompress_section_contents): New function. (load_debug_section): Call uncompress_section_contents when loading a compressed section. (display_debug_section): Recognize compressed section name. binutils/testsuite: * binutils-all/objdump.exp: Add test for objdump -s on a file with a compressed debug section. Add test for objdump -W on a file that contains a compressed debug section. * binutils-all/readelf.exp: Call readelf_compressed_wa_test. (readelf_compressed_wa_test): New function. * binutils-all/dw2-compressed.S: New file. * binutils-all/objdump.W: New file. * binutils-all/objdump.s: New file. * binutils-all/readelf.wa: New file.
2008-06-30bfd/Richard Sandiford1-1/+7
* syms.c (BSF_SYNTHETIC): New flag. * elf.c (_bfd_elf_get_synthetic_symtab): Set it. * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Likewise. * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise. * bfd-in.h (bfd_asymbol_flavour): Return bfd_target_unknown_flavour for synthetic symbols. * bfd-in2.h: Regenerate. opcodes/ * mips-dis.c (_print_insn_mips): Use bfd_asymbol_flavour to check for ELF symbols.
2008-05-21 Multi-GOT support for m68k.Nick Clifton1-0/+2
bfd/ * elf32-m68k.c (struct elf_m68k_link_hash_entry: got_entry_key, glist): New fields. (struct elf_m68k_got_entry_key, struct elf_m68k_got_entry, struct elf_m68k_got, struct elf_m68k_bfd2got_entry, struct elf_m68k_multi_got): New data structures. (struct elf_m68k_link_hash_table: local_gp_p, use_neg_got_offsets_p, allow_multigot_p, multi_got_): New fields. (elf_m68k_multi_got): New macro. (elf_m68k_link_hash_newfunc): Initialize new fields of struct elf_m68k_link_hash_entry. (elf_m68k_link_hash_table_create): Initialize new fields of struct elf_m68k_link_hash_table. (elf_m68k_link_hash_table_free): New static function implementing hook. (elf_m68k_init_got, elf_m68k_clear_got, elf_m68k_create_empty_got): New static functions for struct elf_m68k_got. (elf_m68k_init_got_entry_key, elf_m68k_got_entry_hash, elf_m68k_got_entry_eq): New static functions for struct elf_m68k_got_entry. (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT, ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): New macros. (enum elf_m68k_get_entry_howto): New enum. (elf_m68k_get_got_entry, elf_m68k_update_got_entry_type, elf_m68k_remove_got_entry_type): New static functions for struct elf_m68k_got_entry. (elf_m68k_add_entry_to_got): New static function. (elf_m68k_bfd2got_entry_hash, elf_m68k_bfd2got_entry_eq, elf_m68k_bfd2got_entry_del, elf_m68k_get_bfd2got_entry): New static functions for struct elf_m68k_bfd2got_entry. (struct elf_m68k_can_merge_gots_arg, elf_m68k_can_merge_gots_1, elf_m68k_can_merge_gots): New traversal. (struct elf_m68k_merge_gots_arg, elf_m68k_merge_gots_1, elf_m68k_merge_gots): Ditto. (struct elf_m68k_finalize_got_offsets_arg, elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Ditto. (struct elf_m68k_partition_multi_got_arg, elf_m68k_partition_multi_got_1, elf_m68k_init_symndx2h_1, elf_m68k_partition_multi_got): Ditto. (elf_m68k_find_got_entry_ptr, elf_m68k_remove_got_entry): New static functions. (elf_m68k_copy_indirect_symbol): New static function implementing a hook. (elf_m68k_check_relocs): Update to add entries to multi-GOT. (elf_m68k_gc_sweep_hook): Update to remove entries from multi-GOT. (elf_m68k_always_size_sections): Assign BFDs to GOTs. (elf_m68k_relocate_section): Update to properly handle GOT relocations. (elf_m68k_finish_dynamic_symbol): Update to traverse all GOT entries of a global symbol. (bfd_elf_m68k_set_target_options): New function. (bfd_elf32_bfd_link_hash_table_free): Define hook. (bfd_elf32_bfd_final_link): Change expansion to bfd_elf_final_link to skip generic calculation of GOT offsets. (elf_backend_copy_indirect_symbol): Define hook. * bfd-in.h (bfd_elf_m68k_set_target_options): Declare function. * bfd-in2.h: Regenerate. ld/ * configure.in (--enable-got): New option. Handle it. * configure: Regenerate. * config.in: Regenerate. * emultempl/m68kelf.em: (got_handling_target_default): New shell variable. (GOT_HANDLING_TARGET_DEFAULT): New macro. (GOT_HANDLING_DEFAULT): New macro. Initialize it from configure option if one was given. (got_handling): New static variable. (elf_m68k_create_output_section_statements): New static function implementing hook. (PARSE_AND_LIST_PROLOGUE): Define shell variable. (OPTION_GOT): New macro. (PARSE_AND_LIST_LONGOPTS): Define shell variable. Specify --got option. (got): New linker option. (PARSE_AND_LIST_OPTIONS): Define shell variable. Print help string for --got option. (PARSE_AND_LIST_ARGS_CASES): Define shell variable. Handle --got option. * ld.texinfo: Document --got=<type> option. * gen-doc.texi: Add M68K. * NEWS: Mention the new feature. ld/testsuite/ * ld-m68k/got-12.s: New file. * ld-m68k/got-13.s: New file. * ld-m68k/got-14.s: New file. * ld-m68k/got-15.s: New file. * ld-m68k/got-34.s: New file. * ld-m68k/got-35.s: New file. * ld-m68k/got-single-12-ok.d: New dump test. * ld-m68k/got-single-13-er.d: New dump test. * ld-m68k/got-negative-14-ok.d: New dump test. * ld-m68k/got-negative-15-er.d: New dump test. * ld-m68k/got-negative-12-13-14-34-ok.d: New dump test. * ld-m68k/got-negative-12-13-14-35-er.d: New dump test. * ld-m68k/got-multigot-14-ok.d: New dump test. * ld-m68k/got-multigot-15-er.d: New dump test. * ld-m68k/got-multigot-12-13-14-34-35-ok.d: New dump test. * ld-m68k/xgot-15.s: New source. * ld-m68k/got-xgot-15-ok.d: New test. * ld-m68k/got-xgot-12-13-14-15-34-35-ok.d: New test. * ld-m68k/m68k.exp: Run new tests.
2008-05-15 bfd/Nick Clifton1-0/+11
* elf32-arm.c (THM2_MAX_FWD_BRANCH_OFFSET): Define. (THM2_MAX_BWD_BRANCH_OFFSET): Define. (ARM_MAX_FWD_BRANCH_OFFSET): Define. (ARM_MAX_BWD_BRANCH_OFFSET): Define. (THM_MAX_FWD_BRANCH_OFFSET): Define. (THM_MAX_BWD_BRANCH_OFFSET): Define. (arm_long_branch_stub): Define. (arm_pic_long_branch_stub): Define. (arm_thumb_v4t_long_branch_stub): Define. (arm_thumb_thumb_long_branch_stub): Define. (arm_thumb_arm_v4t_long_branch_stub): Define. (STUB_SUFFIX): Define. (elf32_arm_stub_type): Define. (elf32_arm_stub_hash_entry): Define. (elf32_arm_link_hash_entry): Add stub_cache field. (arm_stub_hash_lookup): Define. (elf32_arm_link_hash_table): Add stub_hash_table, stub_bfd, add_stub_section, layout_sections_again, stub_group, bfd_count, top_index, input_list fields. (elf32_arm_link_hash_newfunc): Init new field. (stub_hash_newfunc): New function. (elf32_arm_link_hash_table_create): Init stub_hash_table. (elf32_arm_hash_table_free): New function. (arm_type_of_stub): New function. (elf32_arm_stub_name): New function. (elf32_arm_get_stub_entry): New function. (elf32_arm_stub_add_mapping_symbol): New function. (elf32_arm_add_stub): New function. (arm_build_one_stub): New function. (arm_size_one_stub): New function. (elf32_arm_setup_section_lists): New function. (elf32_arm_next_input_section): New function. (group_sections): New function. (elf32_arm_size_stubs): New function. (elf32_arm_build_stubs): New function. (bfd_elf32_arm_add_glue_sections_to_bfd): Skip stub sections. (bfd_elf32_arm_process_before_allocation): No longer handle R_ARM_CALL and R_ARM_THM_CALL. (using_thumb_only): New function. (elf32_arm_final_link_relocate): Redirect calls to stub if range exceeds encoding capabilities. (bfd_elf32_bfd_link_hash_table_free): Define. * bfd-in.h (R_ARM_max): Fix value to 130. (elf32_arm_setup_section_lists): Protype. (elf32_arm_next_input_section): Protype. (elf32_arm_size_stubs): Protype. (elf32_arm_build_stubs): Protype. ld/ * emultempl/armelf.em (build_section_lists): New function. (stub_file): Define. (need_laying_out): Define. (group_size): Define. (hook_stub_info): Define. (hook_in_stub): New function. (elf32_arm_add_stub_section): New function. (gldarm_layout_sections_again): New function. (gld${EMULATION_NAME}_finish): Replace arm_elf_finish(). Generate stubs for long calls if needed. (arm_elf_create_output_section_statements): create stub_file bfd. (arm_for_each_input_file_wrapper): New function. (arm_lang_for_each_input_file): New function. (lang_for_each_input_file): Define. (PARSE_AND_LIST_PROLOGUE): Add option token OPTION_STUBGROUP_SIZE. (PARSE_AND_LIST_LONGOPTS): Add option stub-group-size. (PARSE_AND_LIST_OPTIONS): Add option stub-group-size. (PARSE_AND_LIST_ARGS_CASES): Add OPTION_STUBGROUP_SIZE case. (LDEMUL_FINISH): Update to gld${EMULATION_NAME}_finish. * ld/lang.c (print_input_statement): Skip if bfd has BFD_LINKER_CREATED. ld/testsuite * ld-arm/arm-elf.exp (armelftests): Add farcall-arm-arm, farcall-arm-arm-pic-veneer, farcall-arm-arm-be8 farcall-arm-thumb, farcall-arm-thumb-blx, farcall-arm-thumb-pic-veneer, farcall-arm-thumb-blx-pic-veneer, farcall-thumb-thumb, farcall-thumb-thumb-pic-veneer, farcall-thumb-thumb-blx, farcall-thumb-thumb-m, farcall-thumb-thumb-m-pic-veneer, farcall-thumb-thumb-blx-pic-veneer, farcall-thumb-arm, farcall-thumb-arm-pic-veneer, farcall-thumb-arm-blx, farcall-thumb-arm-blx-pic-veneer. Change thumb2-bl-as-thumb1-bad, thumb2-bl-bad. * ld-arm/thumb2-bl-as-thumb1-bad.d: Reflects farcall stub generation. * ld-arm/thumb2-bl-bad.d: Likewise. * ld-arm/thumb2-bl-as-thumb1-bad.s: Update comments. * ld-arm/thumb2-bl-bad.s: Likewise.
2008-04-16bfd/David S. Miller1-0/+5
* reloc.c (BFD_RELOC_SPARC_GOTDATA_HIX22, BFD_RELOC_SPARC_GOTDATA_LOX10, BFD_RELOC_SPARC_GOTDATA_OP_HIX22, BFD_RELOC_SPARC_GOTDATA_OP_LOX10, BFD_RELOC_SPARC_GOTDATA_OP): New. * libbfd.h: Regnerate. * bfd-in2.h: Regenerate. * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Add entries for GOTDATA relocations. (sparc_reloc_map): Likewise. (_bfd_sparc_elf_check_relocs): Handle R_SPARC_GOTDATA_* like R_SPARC_GOT*. (_bfd_sparc_elf_gc_sweep_hook): Likewise. (_bfd_sparc_elf_relocate_section): Transform R_SPARC_GOTDATA_HIX22, R_SPARC_GOTDATA_LOX10, R_SPARC_GOTDATA_OP_HIX22, and R_SPARC_GOTDATA_OP_LOX10 into the equivalent R_SPARC_GOT* reloc. Simply ignore R_SPARC_GOTDATA_OP relocations. gas/ * config/tc-sparc.c (sparc_ip): Add support for gotdata mnemonics and relocation generation. (tc_gen_reloc): Likewise. gas/testsuite/ * gas/sparc/gotops32.d: New. * gas/sparc/gotops32.s: Likewise. * gas/sparc/gotops64.d: Likewise. * gas/sparc/gotops64.s: Likewise. * gas/sparc/sparc.exp: Run new gotdata tests. ld/testsuite/ * ld-sparc/gotop32.dd: New. * ld-sparc/gotop32.rd: Likewise. * ld-sparc/gotop32.s: Likewise. * ld-sparc/gotop32.sd: Likewise. * ld-sparc/gotop32.td: Likewise. * ld-sparc/gotop64.dd: Likewise. * ld-sparc/gotop64.rd: Likewise. * ld-sparc/gotop64.s: Likewise. * ld-sparc/gotop64.sd: Likewise. * ld-sparc/gotop64.td: Likewise. * ld-sparc/sparc.exp: Run new gotdata tests.
2008-04-14ppc e500mc supportAlan Modra1-0/+1
2008-03-28Add support for thin archives.Nick Clifton1-0/+13
* bfd/archive.c (_bfd_find_nested_archive): New function. (get_extended_arelt_filename): Add origin parameter. (_bfd_generic_read_ar_hdr_mag): Deal with extended name combined with a file offset. (append_relative_path): New function. (_bfd_get_elt_at_filepos): Deal with external members and nested archives. (bfd_generic_openr_next_archived_file): Thin archives. (bfd_generic_archive_p): Recognize new magic string. (adjust_relative_path): New function. (_bfd_construct_extended_name_table): Construct extended names for thin archive members. (_bfd_write_archive_contents): Emit new magic string, skip copying files for thin archives. * bfd/bfd-in.h (bfd_is_thin_archive): New macro. * bfd/bfd.c (struct bfd): New fields for thin archives. * bfd/libbfd-in.h (struct areltdata): New field for thin archives. * bfd/opncls.c (bfd_close): Delete BFDs for nested archives. * binutils/ar.c (make_thin_archive): New global flag. (map_over_members): Deal with full pathnames in thin archives. (usage, main): Add 'T' option for building thin archives. (replace_members): Pass thin archive flag to ar_emul_append. * binutils/arsup.c (ar_open): Initialize new flag. * binutils/binemul.c (ar_emul_append): Add new parameter for flattening nested archives. (do_ar_emul_default_append): New function. (ar_emul_default_append): Factored out recursive code. * binutils/binemul.h (ar_emul_default_append): Add new parameter. (struct bin_emulation_xfer_struct): New parameter for ar_append. * binutils/dlltool.c (gen_lib_file): Initialize thin archive flag. * binutils/emul_aix.c (ar_emul_aix_internal): Add new flatten parameter, currently unimplemented. All callers changed. * binutils/objcopy.c (copy_archive): Preserve thin archive flag. * binutils/doc/binutils.texi: Update ar documentation. * binutils/testsuite/binutils-all/ar.exp: Add thin archive tests. * include/aout/ar.h (ARMAGT): New magic string for thin archives.
2008-03-162008-03-15 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-88/+90
* bfd-in.h (BFD_NO_FLAGS, HAS_RELOC, EXEC_P, HAS_LINENO, HAS_DEBUG, HAS_SYMS, HAS_LOCALS, DYNAMIC, WP_TEXT, D_PAGED, BFD_IS_RELAXABLE, BFD_TRADITIONAL_FORMAT, BFD_IN_MEMORY, HAS_LOAD_PAGE, BFD_LINKER_CREATED): Moved to ... * bfd.c: Here. * bfd.c (bfd): Change cacheable, target_defaulted, opened_once, mtime_set, no_export, output_has_begun and has_armap to bit field. * bfd-in2.h: Regenerated.
2008-02-202008-02-20 Paul Brook <paul@codesourcery.com>Paul Brook1-0/+3
ld/ * emultempl/armelf.em (OPTION_FIX_V4BX_INTERWORKING): Define. (PARSE_AND_LIST_LONGOPTS): Add fix-v4bx-interworking. (PARSE_AND_LIST_OPTIONS): Ditto. (PARSE_AND_LIST_ARGS_CASES): Handle OPTION_FIX_V4BX_INTERWORKING. * emulparams/armelf.sh (OTHER_TEXT_SECTIONS): Add .v4_bx. * emulparams/armelf_linux.sh (OTHER_TEXT_SECTIONS): Ditto. * emulparams/armnto.sh (OTHER_TEXT_SECTIONS): Ditto. * ld.texinfo: Document --fix-v4bx-interworking. ld/testsuite/ * ld-arm/armv4-bx.d: New test. * ld-arm/armv4-bx.s: New test. * ld-arm/arm.ld: Add .v4bx. * ld-arm/arm-elf.exp: Add armv4-bx. gas/testsuite/ * gas/arm/thumb.d: Exclude EABI targets. * gas/arm/arch4t.d: Exclude EABI targts. * gas/arm/v4bx.d: New test. * gas/arm/v4bx.s: New test. * gas/arm/thumb-eabi.d: New test. * gas/arm/arch4t-eabi.d: New test. gas/ * config/tc-arm.c (fix_v4bx): New variable. (do_bx): Generate V4BX relocations. (md_assemble): Allow bx on v4 codes when fix_v4bx. (md_apply_fix): Handle BFD_RELOC_ARM_V4BX. (tc_gen_reloc): Ditto. (OPTION_FIX_V4BX): Define. (md_longopts): Add fix-v4bx. (md_parse_option): Handle OPTION_FIX_V4BX. (md_show_usage): Document --fix-v4bx. * doc/c-arm.texi: Document --fix-v4bx. bfd/ * reloc.c: Add BFD_RELOC_ARM_V4BX. * elf32-arm.c (elf32_arm_reloc_map): Add BFD_RELOC_ARM_V4BX. (ARM_BX_GLUE_SECTION_NAME, ARM_BX_GLUE_SECTION_NAME): Define. (elf32_arm_link_hash_table): Add bx_glue_size and bx_glue_offset. Update comment for fix_v4bx. (elf32_arm_link_hash_table_create): Zero bx_glue_size and bx_glue_offset. (ARM_BX_VENEER_SIZE, armbx1_tst_insn, armbx2_moveq_insn, armbx3_bx_insn): New. (bfd_elf32_arm_allocate_interworking_sections): Allocate BX veneer section. (bfd_elf32_arm_add_glue_sections_to_bfd): Ditto. (bfd_elf32_arm_process_before_allocation): Record BX veneers. (record_arm_bx_glue, elf32_arm_bx_glue): New functions. (elf32_arm_final_link_relocate): Handle BX veneers. (elf32_arm_output_arch_local_syms): Output mapping symbol for .v4_bx. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate.
2008-02-15 PR 5765Alan Modra1-13/+13
* section.c (SEC_LINK_DUPLICATES): Correct. Renumber following flags. * bfd-in2.h: Regenerate.
2008-02-04 * archures.c: Update copyright.Adam Nemet1-1/+2
(bfd_mach_mips_octeon): New macro. * bfd-in2.h: Regenerate. * elfxx-mips.c (_bfd_elf_mips_mach): Handle Octeon. (mips_set_isa_flags): Likewise. (mips_mach_extensions): Add Octeon. * cpu-mips.c: Update copyright. (I_mipsocteon): New enum constant. (arch_info_struct): Add Octeon.
2008-01-25Add mingw I64 support for printing long and long long valuesNick Clifton1-0/+5
2008-01-15 * bfd-in.h (BFD_HOST_LONG_LONG): Delete.Alan Modra1-1/+0
* bfd-in2.h: Regenerate.
2007-12-18 * section.c (BFD_FAKE_SECTION): Update.Daniel Jacobowitz1-2/+2
* bfd-in2.h: Regenerate.
2007-12-18 * bfd-in2.h: Regenerate.Daniel Jacobowitz1-2/+1
2007-11-29 bfd/Mark Shinwell1-0/+2
* archures.c (bfd_mach_mips_loongson_2e): New. (bfd_mach_mips_loongson_2f): New. * bfd-in2.h (bfd_mach_mips_loongson_2e): New. (bfd_mach_mips_loongson_2f): New. * cpu-mips.c: Add I_loongson_2e and I_loongson_2f to anonymous enum. (arch_info_struct): Add Loongson-2E and Loongson-2F entries. * elfxx-mips.c (_bfd_elf_mips_mach): Handle Loongson-2E and Loongson-2F flags. (mips_set_isa_flags): Likewise. (mips_mach_extensions): Add Loongson-2E and Loongson-2F entries. binutils/ * readelf.c (get_machine_flags): Handle Loongson-2E and -2F flags. gas/ * config/tc-mips.c (mips_cpu_info_table): Add loongson2e and loongson2f entries. * doc/c-mips.texi: Document -march=loongson{2e,2f} options. gas/testsuite/ * gas/mips/mips.exp: Add loongson-2e and -2f tests. * gas/mips/loongson-2e.d: New. * gas/mips/loongson-2e.s: New. * gas/mips/loongson-2f.d: New. * gas/mips/loongson-2f.s: New. include/elf/ * mips.h (E_MIPS_MACH_LS2E): New. (E_MIPS_MACH_LS2F): New. include/opcode/ * mips.h (INSN_LOONGSON_2E): New. (INSN_LOONGSON_2F): New. (CPU_LOONGSON_2E): New. (CPU_LOONGSON_2F): New. (OPCODE_IS_MEMBER): Update for Loongson-2E and -2F flags. opcodes/ * mips-dis.c (mips_arch_choices): Add Loongson-2E and -2F entries. * mips-opc.c (IL2E): New. (IL2F): New. (mips_builtin_opcodes): Add Loongson-2E and -2F instructions. Allow movz and movn for Loongson-2E and -2F. Add movnz entry. Move coprocessor encodings to the end of the table. Allow certain MIPS V .ps instructions on the Loongson-2E and -2F.
2007-10-30* mn10300.h (R_MN10300_ALIGN): Define.Nick Clifton1-0/+5
* reloc.c (BFD_RELOC_MN10300_ALIGN): Add. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elf-m10300.h: Handle R_MN10300_ALIGN relocs. * mn10300_elf_relax_delete_bytes): Honour R_MN10300_ALIGN relocs. Re-fix off by one error in comparisons. * config/tc-mn10300.c (tc_gen_reloc): Fix test that decides when sym_diff relocs should be generated. (md_apply_fix): Skip R_MN10300_ALIGN relocs. (mn10300_fix_adjustable): Do not adjust R_MN10300_ALIGN relocs. (mn10300_handle_align): New function. Generate R_MN10300_ALIGN relocs to record alignment requests. * config/tc-mn10300.h (TC_FORCE_RELOCATION_SUB_SAME): Also force R_MN10300_ALIGN relocs. (HANDLE_ALIGN): Define. Call mn10300_handle_align. * gas/all/gas.exp: Do not run diff1.s test for mn10300. * ld-mn10300/mn10300.exp: Run new tests. Skip i126256 test if a compiler is not available. * ld-mn10300/i112045-3.s: New test. * ld-mn10300/i112045-3.d: Expected disassembly. * ld-mn10300/i135409.s: Rename to i135409-1.s. * ld-mn10300/i135409.d: Rename to i135409-1.d * ld-mn10300/i135409-2.s: New test. * ld-mn10300/i135409-2.d: Expected symbol table. * ld-mn10300/i36434.d: Adjust expected disassembly.
2007-10-25 bfd/Pedro Alves1-3/+2
* bfd-in.h (STRING_COMMA_LEN): Don't handle NULL STR case. * bfd-in2.h: Regenerate. ld/ * pe-dll.c (autofilter_symbollist_generic) (autofilter_symbollist_i386, autofilter_liblist) (autofilter_objlist, autofilter_symbolprefixlist) (autofilter_symbolsuffixlist): Don't use STRING_COMMA_LEN with NULL.
2007-10-19Add MN10300 linker relaxation support for symbol differencesNick Clifton1-0/+5
2007-10-16 * section.c (struct bfd_section): Clarify comment for rawsize field.Bob Wilson1-7/+7
* bfd-in2.h: Regenerate.
2007-10-01Various CR16 fixesNick Clifton1-0/+3
2007-09-19 * bfd-in.h (bfd_hash_insert): Declare.Alan Modra1-0/+4
* bfd-in2.h: Regenerate. * hash.c (bfd_hash_insert): New function. Split out from.. (bfd_hash_lookup): ..here. * merge.c (sec_merge_hash_lookup): Use bfd_hash_insert.
2007-09-11bfd/Kazu Hirata1-0/+3
* archures.c: Add bfd_mach_mcf_isa_c_nodiv, bfd_mach_mcf_isa_c_nodiv_mac & bfd_mach_mcf_isa_c_nodiv_emac. * ieee.c (ieee_write_processor): Update coldfire architecture list. * bfd-in2.h: Rebuilt. * cpu-m68k.c (arch_info_struct): Add isa_c nodiv architectures. (m68k_arch_features): Likewise. * elf32-m68k.c (elf32_m68k_object_p): Add EF_M68K_CF_ISA_C_NODIV. (elf32_m68k_print_private_bfd_data): Likewise. gas/ * config/tc-m68k.c (m68k_ip): Add mcfisa_c case. (m68k_elf_final_processing): Add EF_M68K_CF_ISA_C_NODIV. include/elf/ * m68k.h (EF_M68K_CF_ISA_C_NODIV): New.
2007-07-12Add support for building on a 64-bit Windows host.Nick Clifton1-0/+8
2007-07-03Switch sources over to use the GPL version 3Nick Clifton1-1/+1
2007-06-29New port: National Semiconductor's CR16Nick Clifton1-0/+31
2007-06-27bfd/Alan Modra1-1/+1
* bfd.c (struct bfd): Rename "next" to "archive_next". * archive.c: Rename uses throughout file. * archive64.c: Likewise. * coff-rs6000.c: Likewise. * ecoff.c: Likewise. * som.c: Likewise. * bfd-in2.h: Regenerate. binutils/ * ar.c: Rename uses of bfd.next to bfd.archive_next throughout. * arsup.c: Likewise. * binemul.c: Likewise. * objcopy.c: Likewise. * dlltool.c: Likewise. ld/ * pe-dll.c: Rename uses of bfd.next to bfd.archive_next throughout.
2007-05-11include/elf/Alan Modra1-0/+2
* spu.h (R_SPU_PPU32, R_SPU_PPU64): Define. bfd/ * reloc.c (BFD_RELOC_SPU_PPU32, BFD_RELOC_SPU_PPU64): Define. * elf-bfd.h (struct elf_backend_data): Change return type of elf_backend_relocate_section to int. * elf32-spu.c (elf_howto_table): Add howtos for R_SPU_PPU32 and R_SPU_PPU64. (spu_elf_bfd_to_reloc_type): Convert new relocs. (spu_elf_count_relocs): New function. (elf_backend_count_relocs): Define. (spu_elf_relocate_section): Arrange to emit R_SPU_PPU32 and R_SPU_PPU64 relocs. * elflink.c (elf_link_input_bfd): Emit relocs if relocate_section returns 2. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. gas/ * config/tc-spu.c (md_pseudo_table): Add int, long, quad. Call spu_cons for word. (md_assemble): Tidy use of insn.flag. (get_imm): Likewise. Handle uppercase input too. (spu_cons): New function. * config/tc-spu.h (tc_fix_adjustable): Don't adjust SPU_PPU relocs. (TC_FORCE_RELOCATION): Don't resolve them either. binutils/ * embedspu.sh (find_prog): Prefer prog in same dir as embedspu over one found on the users path. (main): Generate .reloc for each R_SPU_PPU* reloc.
2007-04-23 gas/testsuite/Nathan Sidwell1-0/+3
* gas/m68k/br-isaa.s: New. * gas/m68k/br-isaa.d: New. * gas/m68k/br-isab.s: New. * gas/m68k/br-isab.d: New. * gas/m68k/br-isac.s: New. * gas/m68k/br-isac.d: New. * gas/m68k/all.exp: Adjust. gas/ * config/tc-m68k.c (mcf54455_ctrl): New. (HAVE_LONG_DISP, HAVE_LONG_CALL, HAVE_LONG_COND): New. (m68k_archs): Add isac. (m68k_cpus): Add 54455 family. (m68k_ip): Split Bg into Bb, Bs, Bg. (m68k_elf_final_processing): Add ISA_C. * doc/c-m68k.texi (M680x0 Options): Add isac. include/opcode/ * m68k.h (mcfisa_c): New. (mcfusp, mcf_mask): Adjust. bfd/ * archures.c (bfd_mach_mcf_isa_c, bfd_mach_mcf_isa_c_mac, bfd_mach_mcf_isa_c_emac): New. * elf32-m68k.c (ISAC_PLT_ENTRY_SIZE, elf_isac_plt0_entry, elf_isac_plt_entry, elf_isac_plt_info): New. (elf32_m68k_object_p): Add ISA_C. (elf32_m68k_print_private_bfd_data): Print ISA_C. (elf32_m68k_get_plt_info): Detect ISA_C. * cpu-m68k.c (arch_info): Add ISAC. (m68k_arch_features): Likewise, (bfd_m68k_compatible): ISAs B & C are not compatible. opcodes/ * m68k-opc.c: Mark mcfisa_c instructions.
2007-04-19 * bfd.c (bfd_demangle): New function.Alan Modra1-0/+2
* Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. * bfd-in2.h: Regenerate.