aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
AgeCommit message (Collapse)AuthorFilesLines
2009-09-29bfdNick Clifton1-0/+64
* Makefile.am (ALL_MACHINES): Add cpu-rx.lo. (ALL_MACHINES_CFILES): Add cpu-rx.c. (BFD32_BACKENDS): Add elf32-rx.lo. (BFD32_BACKENDS_CFILES): Add elf32-rx.c. * archures.c (bfd_architecture): Add bfd_arch_rx and bfd_mach_rx. Export bfd_rx_arch. (bfd_archures_list): Add bfd_rx_arch. * config.bfd: Add entry for rx-*-elf. * configure.in: Add entries for bfd_elf32_rx_le_vec and bfd_elf32_rx_be_vec. * reloc.c: Add RX relocations. * targets.c: Add RX target vectors. * Makefile.in: Regenerate. * bfd-in2.h: Regenerate. * configure: Regenerate. * libbfd.h: Regenerate. * cpu-rx.c: New file. * elf32-rx.c: New file. binutils * readelf.c: Add support for RX target. * MAINTAINERS: Add DJ and NickC as maintainers for RX. gas * Makefile.am: Add RX target. * configure.in: Likewise. * configure.tgt: Likewise. * read.c (do_repeat_with_expander): New function. * read.h: Provide a prototype for do_repeat_with_expander. * doc/Makefile.am: Add RX target documentation. * doc/all.texi: Likewise. * doc/as.texinfo: Likewise. * Makefile.in: Regenerate. * NEWS: Mention support for RX architecture. * configure: Regenerate. * doc/Makefile.in: Regenerate. * config/rx-defs.h: New file. * config/rx-parse.y: New file. * config/tc-rx.h: New file. * config/tc-rx.c: New file. * doc/c-rx.texi: New file. gas/testsuite * gas/rx: New directory. * gas/rx/*: New set of test cases. * gas/elf/section2.e-rx: New expected output file. * gas/all/gas.exp: Add support for RX target. * gas/elf/elf.exp: Likewise. * gas/lns/lns.exp: Likewise. * gas/macros/macros.exp: Likewise. include * dis-asm.h: Add prototype for print_insn_rx. include/elf * rx.h: New file. include/opcode * rx.h: New file. ld * Makefile.am: Add rules to build RX emulation. * configure.tgt: Likewise. * NEWS: Mention support for RX architecture. * Makefile.in: Regenerate. * emulparams/elf32rx.sh: New file. * emultempl/rxelf.em: New file. opcodes * Makefile.am: Add RX files. * configure.in: Add support for RX target. * disassemble.c: Likewise. * Makefile.in: Regenerate. * configure: Regenerate. * opc2c.c: New file. * rx-decode.c: New file. * rx-decode.opc: New file. * rx-dis.c: New file.
2009-09-25 Update soruces to make alpha, arc and arm targets compile cleanlyNick Clifton1-3/+4
with -Wc++-compat: * config/tc-alpha.c: Add casts. (extended_bfd_reloc_code_real_type): New type. Used to avoid enumeration conversion warnings. (struct alpha_fixup, void assemble_insn, assemble_insn) (assemble_tokens): Use new type. * ecoff.c: Add casts. (mark_stabs): Use enumeration names. * config/obj-elf.c: Add cast * config/tc-arc.c: Add casts. * config/obj-aout.h (text_section,data_section,bss_section): Make extern. * config/obj-elf.c: Add cast. * config/tc-arm.c: Add casts. (X, TxCE, TxCE, TxC3, TxC3w, TxCM_, TxCM, TUE, TUF, CE, CL, cCE) (cCL, C3E, xCM_, nUF, nCE_tag): Change input format to avoid the need for keywords as arguments. * ecoff.c: Add casts. * ecofflink.c: Add casts. * elf64-alpha.c: Add casts. (struct alpha_elf_got_entry, struct alpha_elf_reloc_entry): Move to top level. (SKIP_HOWTO): Use enum name. * elf32-arm.c: Add casts. (elf32_arm_vxworks_bed): Update code to avoid multiple declarations. (struct map_stub): Move to top level. * arc-dis.c Fix casts. * arc-ext.c: Add casts. * arm-dis.c (enum opcode_sentinel_enum): Gave name to anonymous enum. * emultempl/armelf.em: Add casts.
2009-09-23bfd/Alan Modra1-2/+91
* bfd-in.h (bfd_elf_size_dynamic_sections): Add audit and depaudit arguments. * elflink.c (bfd_elf_size_dynamic_sections): Generate DT_AUDIT, DT_DEPAUDIT from audit/depaudit arguments. (elf_finalize_dynstr): Finalize DT_AUDIT and DT_DEPAUDIT strtab entries. (elf_link_add_object_symbols): Set dt_audit target data when finding a DT_AUDIT. * bfd-in2.h: Regenerate. * bfd-elf.h: Add dt_audit to elf_obj_tdata, and elf_dt_audit macro. ld/ * emultempl/elf32.em (gld${EMULATION_NAME}_add_options): Add --audit, --depaudit, and -P options. (gld${EULATION_NAME}_handle_options): Ditto. (gld${EULATION_NAME}_list_options): Ditto. (gld${EMULATION_NAME}_append_to_separated_string): New function for handling rpath-like colon separated strings. (gld${EMULATION_NAME}_before_allocation): Pass the audit and depaudit libs to bfd. Propagate DT_AUDIT from needed libs to depaudit. * ld.texinfo: Document new options. ld/testsuite/ * ld-elf/audit.exp: New. * ld-elf/audit.rd: New. * ld-elf/depaudit.rd: New. * ld-elf/depaudit2.rd: New.
2009-09-21include/elf/Alan Modra2-7/+28
* ppc.h (DT_PPC_TLSOPT): Define. * ppc64.h (DT_PPC64_TLSOPT): Define. bfd/ * elf32-ppc.c (TLS_GET_ADDR_GLINK_SIZE): Define. (ADD_3_12_2, BEQLR, CMPWI_11_0, LWZ_11_3, LWZ_12_3): Define. (MR_0_3, MR_3_0): Define. (struct ppc_elf_link_hash_table): Add no_tls_get_addr_opt. (ppc_elf_select_plt_layout): Save emit_stub_syms param earlier. (ppc_elf_tls_setup): Add no_tls_get_addr_opt param and save to hash table. Check for presense of __tls_get_addr_opt (allocate_dynrelocs): Increase glink entry size for __tls_get_addr. (ppc_elf_size_dynamic_sections): Add DT_PPC_TLS_OPT tag. (write_glink_stub): Add param p. (ppc_elf_relocate_section): Adjust write_glink_stub call. (ppc_elf_finish_dynamic_symbol): Emit special glink call stub for __tls_get_addr. * elf32-ppc.h (ppc_elf_tls_setup): Update prototype. * elf64-ppc.c (struct ppc_link_hash_table): Add no_tls_get_addr_opt. (ppc64_elf_tls_setup): Add no_tls_get_addr_opt param and save to hash table. Check for presense of __tls_get_addr_opt. (ppc64_elf_size_dynamic_sections): Add DT_PPC64_TLS_OPT tag. (LD_R11_0R3, LD_R12_0R3, MR_R0_R3, CMPDI_R11_0, ADD_R3_R12_R13, BEQLR, MR_R3_R0, MFLR_R11, STD_R11_0R1, BCTRL, LD_R11_0R1, LD_R2_0R1, MTLR_R11): Define. (build_tls_get_addr_stub): New function. (ppc_build_one_stub): Call it. (ppc_size_one_stub): Add extra size for __tls_get_addr stub. (ppc64_elf_relocate_section): Don't change nop to ld 2,40(1) for __tls_get_addr plt call. * elf64-ppc.h (ppc64_elf_tls_setup): Update prototype. binutils/ * readelf.c (get_ppc_dynamic_type): Add TLSOPT. (get_ppc64_dynamic_type): Likewise. ld/ * emultempl/ppc32elf.em (no_tls_get_addr_opt): New var. (ppc_before_allocation): Pass to ppc_elf_tls_setup. (OPTION_NO_TLS_GET_ADDR_OPT): Define. Redefine other options in terms of previous option. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add --no-tls-get-addr-optimize. (PARSE_AND_LIST_ARGS_CASES): Handle it. * emultempl/ppc64elf.em (no_tls_get_addr_opt): New var. (ppc_before_allocation): Pass to ppc64_elf_tls_setup. (OPTION_NO_TLS_GET_ADDR_OPT): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add --no-tls-get-addr-optimize. (PARSE_AND_LIST_ARGS_CASES): Handle it. ld/testsuite/ * ld-powerpc/tlslib.s: Delete dot-symbol entry syms. Add __tls_get_addr_opt. * ld-powerpc/tlslib32.s: Add __tls_get_addr_opt. * ld-powerpc/oldtlslib.s: New file, old-abi version of tlslib.s. * ld-powerpc/powerpc.exp: Build old-abi library and use it in two new link tests. * ld-powerpc/tlsexe.d: Update for new __tls_get_addr stub. * ld-powerpc/tlsexe.g, * ld-powerpc/tlsexe.r, *ld-powerpc/tlsexe32.d, * ld-powerpc/tlsexe32.g, * ld-powerpc/tlsexe32.r, * ld-powerpc/tlsexetoc.d, * ld-powerpc/tlsexetoc.g, * ld-powerpc/tlsexetoc.r: Likewise.
2009-09-13 PR ld/6766Alan Modra7-35/+17
* lexsup.c (parse_args <-e>): Revert 2009-03-18 change. * ldemul.c (after_parse_default): Add entry symbol as undef. * emultempl/alphaelf.em (alpha_after_parse): Call after_parse_default. * emultempl/cr16elf.em (cr16elf_after_parse): Likewise. * emultempl/crxelf.em (crxelf_after_parse): Likewise. * emultempl/hppaelf.em (hppaelf_after_parse): Likewise. * emultempl/ia64elf.em (gld${EMULATION_NAME}_after_parse): Likewise. * emultempl/pe.em (gld_${EMULATION_NAME}_after_parse): Call after_parse_default and delete now duplicate code. * emultempl/pep.em (gld_${EMULATION_NAME}_after_parse): Likewise. * scripttempl/elf32cr16.sc: No need to make entry extern. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32xc16xs.sc: Only provide ENTRY on final link.
2009-09-11 * po/bfd.pot: Updated by the Translation project.Nick Clifton1-7/+9
* po/binutils.pot: Updated by the Translation project. * po/gold.pot: Updated by the Translation project. * po/gold.pot: Updated by the Translation project. * po/gprof.pot: Updated by the Translation project. * po/sv.po: Updated Swedish translation. * po/ld.pot: Updated by the Translation project. * po/fi.po: Updated Finnish translation. * po/ld.pot: Updated by the Translation project. * po/fi.po: Updated Finnish translation. Updated sources to compile cleanly with -Wc++-compat: * basic_blocks.c: Add casts. * cg_dfn.c: Add cast. * corefile.c: Add casts. * gmon_io.c: Add casts. * hist.c: Add cast. * source.c: Add cast. * sym_ids.c (struct match): Moved to top level. Updated soruces in ld/* to compile cleanly with -Wc++-compat: * ld.h (enum endian_enum,enum symbolic_enum,enum dynamic_list_enum): Move to top level. * ldcref.c: Add casts. * ldctor.c: Add casts. * ldexp.c * ldexp.h (enum node_tree_enum,enum phase_enum): Move to top level. * ldlang.c: Add casts. (lang_insert_orphan): Use enum name instead of integer. * ldlang.h (enum statement_enum): Move to top level. * ldmain.c: Add casts. * ldwrite.c: Add casts. * lexsup.c: Add casts. (enum control_enum): Move to top level. * mri.c: Add casts. (mri_draw_tree): Use enum name instead of integer. Updated sources to compile cleanly with -Wc++-compat: * basic_blocks.c: Add casts. * cg_dfn.c: Add cast. * corefile.c: Add casts. * gmon_io.c: Add casts. * hist.c: Add cast. * source.c: Add cast. * sym_ids.c (struct match): Moved to top level. * as.c (main): Call dwarf2_init. * config/obj-elf.c (struct group_list): New field. (build_group_lists): Use hash lookup. (free_section_idx): New function. (elf_frob_file): Adjust. * dwarf2dbg.c (all_segs_hash, last_seg_ptr): New variables. (get_line_subseg): Adjust. (dwarf2_init): New function. * dwarf2dbg.h (dwarf2_init): New declaration.
2009-09-05 * bfd/coff-arm.c (coff_arm_relocate_section)Nick Clifton1-9/+9
(record_thumb_to_arm_glue, bfd_arm_process_before_allocation): Change member name class to symbol_class. * bfd/coff-i960.c (coff_i960_relocate_section) Rename variable class to class_val. Change member name class to symbol_class. * bfd/coff-rs6000.c (_bfd_xcoff_swap_aux_in) (_bfd_xcoff_swap_aux_out): Rename arguments class to in_class. * bfd/coff-stgo32.c (adjust_aux_in_post) (adjust_aux_out_pre, adjust_aux_out_post): Rename arguments class to in_class. * bfd/coff64-rs6000.c (_bfd_xcoff64_swap_aux_in) (_bfd_xcoff64_swap_aux_out): Rename arguments class to in_class. * bfd/coffcode.h (coff_pointerize_aux_hook): Rename variable class to n_sclass. * bfd/coffgen.c (coff_write_symbol, coff_pointerize_aux): Rename variables named class to n_sclass. (coff_write_symbols): Rename variable class to sym_class. (bfd_coff_set_symbol_class): Rename argument class to symbol_class. * bfd/cofflink.c (_bfd_coff_link_hash_newfunc) (coff_link_add_symbols, _bfd_coff_link_input_bfd) (_bfd_coff_write_global_sym, _bfd_coff_generic_relocate_section): Update code to use renamed members. * bfd/coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Rename argument class to in_class. * bfd/libcoff-in.h (struct coff_link_hash_entry, struct coff_debug_merge_type) Renamed members class to symbol_class and type_class. * bfd/libcoff.h Regenerated. * bfd/peXXigen.c: (_bfd_XXi_swap_aux_in, _bfd_XXi_swap_aux_out): Rename argument class to in_class. * bfd/pef.c (bfd_pef_parse_imported_symbol): Update code to use renamed members. * bfd/pef.h (struct bfd_pef_imported_symbol): Changed name of member class to symbol_class. * binutils/ieee.c (ieee_read_cxx_misc, ieee_read_cxx_class) (ieee_read_reference): Rename variables named class to cxxclass. * gas/config/tc-arc.c (struct syntax_classes): Rename member class to s_class. (arc_extinst): Rename variable class to s_class. Update code to use renamed members. * gas/config/tc-mips.c (insn_uses_reg): Rename argument class to regclass. * gas/config/tc-ppc.c (ppc_csect, ppc_change_csect, ppc_function) (ppc_tc, ppc_is_toc_sym, ppc_symbol_new_hook, ppc_frob_label) (ppc_fix_adjustable, md_apply_fix): Update code to use renamed members. * gas/config/tc-ppc.h (struct ppc_tc_sy): Change name of member from class to symbol_class. (OBJ_COPY_SYMBOL_ATTRIBUTES): Update code to use renamed members. * gas/config/tc-score.c (s3_adjust_paritybit): Rename argument class to i_class. * gas/config/tc-score7.c (s7_adjust_paritybit): Rename argument class to i_class. * gprof/corefile.c (core_create_function_syms): Rename variable class to cxxclass. * include/coff/ti.h (GET_LNSZ_SIZE, PUT_LNSZ_SIZE): Updated name of class variable to in_class to match changes in function that use this macro. * include/opcode/ia64.h (struct ia64_operand): Renamed member class to op_class * ld/emultempl/elf32.em (gld${EMULATION_NAME}_load_symbols) (gld${EMULATION_NAME}_try_needed): Rename variable class to link_class * opcodes/ia64-dis.c (print_insn_ia64): Update code to use renamed member. * opcodes/m88k-dis.c (m88kdis): Rename variable class to in_class. * opcodes/tic80-opc.c (tic80_symbol_to_value) (tic80_value_to_symbol): Rename argument class to symbol_class.
2009-09-02update copyright datesAlan Modra29-30/+33
2009-08-30 PR ld/10569Alan Modra1-5/+0
* ldexp.c (fold_name <MAXPAGESIZE>): Return config.maxpagesize. (fold_name <COMMONPAGESIZE>): Similarly. * ldlang.c (output_target): Make global. * ldlang.h (output_target): Declare. * ldmain.c (main): Set config.maxpagesize from bfd_emul_get_maxpagesize. Similarly for config.commonpagesize. * ldemul.c (set_output_arch_default): Call bfd_emul_set_maxpagesize and bfd_emul_set_commonpagesize. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Don't call bfd_emul_set_maxpagesize or bfd_emul_set_commonpagesize here.
2009-08-26 PR ld/10555Nick Clifton1-21/+32
* emultempl/elf32.em (_after_open): Do not create a .note.gnu-build-id section if there are no input files.
2009-08-10 PR 10474Alan Modra14-129/+99
* ldemul.c (after_allocation_default): Run lang_relax_sections. * ldlang.h (lang_relax_sections): Declare. * ldlang.c (relax_sections): Delete. (lang_relax_sections): New function. (lang_process): Don't relax directly from here. * emultempl/alphaelf.em (alpha_finish): Call finish_default. * emultempl/armelf.em (arm_elf_after_allocation): Delete. Move body.. (gld${EMULATION_NAME}_finish): ..to here. Move existing code.. (gld${EMULATION_NAME}_after_allocation): ..to here. New function. (LDEMUL_AFTER_ALLOCATION): Update. * emultempl/avrelf.em (avr_elf_finish, LDEMUL_FINISH): Delete. (avr_elf_after_allocation): New function. (LDEMUL_AFTER_ALLOCATION): Define. * emultempl/elf-generic.em (gld${EMULATION_NAME}_map_segments): Call lang_relax_sections. * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Delete. Move.. (gld${EMULATION_NAME}_after_allocation): ..code to here. New function. (LDEMUL_AFTER_ALLOCATION, LDEMUL_FINISH): Update. * emultempl/genelf.em (gld${EMULATION_NAME}_finish): Delete. Move.. (gld${EMULATION_NAME}_after_allocation): ..code to here. New function. (LDEMUL_FINISH): Delete. (LDEMUL_AFTER_ALLOCATION): Define. * emultempl/hppaelf.em (gld${EMULATION_NAME}_finish): Delete. Move.. (gld${EMULATION_NAME}_after_allocation): ..to here. New function. (LDEMUL_FINISH): Delete. (LDEMUL_AFTER_ALLOCATION): Define. * emultempl/m68hc1xelf.em (m68hc11elf_finish): Delete. Move.. (m68hc11elf_after_allocation): ..to here. New function. (LDEMUL_FINISH): Delete. (LDEMUL_AFTER_ALLOCATION): Define. * emultempl/m68kelf.em (m68k_elf_after_allocation): Call gld${EMULATION_NAME}_after_allocation. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Call gld${EMULATION_NAME}_after_allocation. * emultempl/mmo.em (mmo_finish): Delete. Move body.. (gld${EMULATION_NAME}_after_allocation): ..to here. New function. (LDEMUL_FINISH): Define. * emultempl/ppc64elf.em (ppc_layout_sections_again): Set elf_gp. (gld${EMULATION_NAME}_finish): Move code sizing sections.. (gld${EMULATION_NAME}_after_allocation): ..to here. * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_after_allocation): Call gld${EMULATION_NAME}_after_allocation. * emultempl/spuelf.em (gld${EMULATION_NAME}_finish): Delete bfd_elf_discard_info and map_segments call.
2009-08-05bfd/Trevor Smigiel1-1/+11
* elf32-spu.h (spu_elf_params): Add member emit_fixups. (spu_elf_size_sections): Declare prototype. * elf32-spu.c (spu_link_hash_table): Add member sfixup. (FIXUP_RECORD_SIZE, FIXUP_GET, FIXUP_PUT): New macros. (spu_elf_emit_fixup): New function. (spu_elf_relocate_section): Emit fixup for each SPU_ADDR32. (spu_elf_size_sections): New function. ld/ * emulparams/elf32_spu.sh (OTHER_READONLY_SECTIONS): Add .fixup section and __fixup_start symbol. * emultempl/spuelf.em (params): Initialize emit_fixups member. (spu_before_allocation): Call spu_elf_size_sections. (OPTION_SPU_EMIT_FIXUPS): Define. (PARSE_AND_LIST_LONGOPTS): Add --emit-fixups. (PARSE_AND_LIST_ARGS_CASES): Handle --emit-fixups. * ld.texinfo (--emit-fixups): Document. ld/testsuite/ * ld-spu/fixup.d: New. * ld-spu/fixup.s: New.
2009-08-04 PR 10474Alan Modra1-3/+3
* emultempl/ppc32elf.em (ppc_before_allocation): Test rawsize, not size, after lang_reset_memory_regions.
2009-07-10 * emultempl/ppc32elf.em (ppc_before_allocation): Turn onAlan Modra1-0/+33
linker relaxation if it might be necessary.
2009-06-122009-06-10 Philip Blundell <philb@gnu.org>Phil Blundell1-0/+1
* emultempl/armelf.em (gld${EMULATION_NAME}_finish): Avoid crash if section has no ELF data.
2009-05-22 ld/Julian Brown1-1/+18
* emultempl/armelf.em (fix_cortex_a8): New. (arm_elf_before_allocation): Call bfd_elf32_arm_set_cortex_a8_fix. (arm_elf_create_output_section_statements): Add fix_cortex_a8 to bfd_elf32_arm_set_target_relocs. (OPTION_FIX_CORTEX_A8, OPTION_NO_FIX_CORTEX_A8): New. (PARSE_AND_LIST_LONGOPTS): Add [no-]fix-cortex-a8 options. (PARSE_AND_LIST_OPTIONS): Add [no-]fix-cortex-a8 options. (PARSE_AND_LIST_ARGS_CASES): Handle OPTION_[NO_]FIX_CORTEX_A8. * ld.texinfo (--[no-]fix-cortex-a8): Briefly document new options. bfd/ * elf32-arm.c (THUMB16_BCOND_INSN, THUMB32_INSN, THUMB32_B_INSN): New macros. (elf32_arm_stub_a8_veneer_b_cond, elf32_arm_stub_a8_veneer_b) (elf32_arm_stub_a8_veneer_blx): New stub sequences. (elf32_arm_stub_type): Add arm_stub_a8_veneer_b_cond, arm_stub_a8_veneer_b and arm_stub_a8_veneer_blx. (elf32_arm_stub_hash_entry): Add target_addend, orig_insn fields. (a8_erratum_fix, a8_erratum_reloc): New structs. (elf32_arm_link_hash_table): Add a8_erratum_fixes, num_a8_erratum_fixes, fix_cortex_a8 fields. (elf32_arm_link_hash_table_create): Zero fix_cortex_a8. (elf32_arm_add_stub): Split into two parts, creating... (elf32_arm_create_or_find_stub_sec): New function. (elf32_arm_final_link_relocate): Add forward declaration. (arm_build_one_stub): Add support for THUMB32_TYPE, Thumb-2 relocations, multiple relocations per stub. (find_stub_size_and_template): New (using parts of arm_size_one_stub). (arm_size_one_stub): Use find_stub_size_and_template. (a8_reloc_compare): New. (find_thumb_glue): Add forward declaration. (cortex_a8_erratum_scan): New. (elf32_arm_size_stubs): Add Cortex-A8 erratum workaround support. (bfd_elf32_arm_set_cortex_a8_fix): New. (bfd_elf32_arm_set_target_relocs): Add fix_cortex_a8 argument. (arm_map_one_stub): Add THUMB32_TYPE support. (a8_branch_to_stub_data): New. (make_branch_to_a8_stub): New. (elf32_arm_write_section): Add Cortex-A8 erratum workaround support. * bfd-in.h (bfd_elf32_arm_set_cortex_a8_fix): New. (bfd_elf32_arm_set_target_relocs): Add argument for controlling Cortex-A8 erratum workaround. * bfd-in2.h: Regenerate. ld/testsuite/ * ld-arm/cortex-a8-arm-target.s: New. * ld-arm/cortex-a8-thumb-target.s: New. * ld-arm/cortex-a8-fix-b-rel.s: New. * ld-arm/cortex-a8-fix-b-rel-arm.d: New. * ld-arm/cortex-a8-fix-b-rel-thumb.d: New. * ld-arm/cortex-a8-fix-b.s: New. * ld-arm/cortex-a8-fix-b.d: New. * ld-arm/cortex-a8-fix-bl-rel.s: New. * ld-arm/cortex-a8-fix-bl-rel-arm.d: New. * ld-arm/cortex-a8-fix-bl-rel-thumb.d: New. * ld-arm/cortex-a8-fix-bl.s: New. * ld-arm/cortex-a8-fix-bl.d: New. * ld-arm/cortex-a8-fix-bcc-rel.s: New. * ld-arm/cortex-a8-fix-bcc-rel-thumb.d: New. * ld-arm/cortex-a8-fix-bcc.s: New. * ld-arm/cortex-a8-fix-bcc.d: New. * ld-arm/cortex-a8-fix-blx-rel.s: New. * ld-arm/cortex-a8-fix-blx-rel-arm.d: New. * ld-arm/cortex-a8-fix-blx-rel-thumb.d: New. * ld-arm/cortex-a8-fix-blx.s: New. * ld-arm/cortex-a8-fix-blx.d: New. * ld-arm/arm-elf.exp: Add new tests.
2009-05-15ld/Alan Modra3-71/+113
* ldlang.c (lang_output_section_statement_lookup): Add function comment. Make "name" non-const. Ensure duplicate entries use the same string, allowing simple comparison in hash bucket loop. Tweak constraint check. (next_matching_output_section_statement): New function. * ldlang.h (lang_output_section_statement_lookup): Update. (next_matching_output_section_statement): Declare. * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't combine orphan sections when input sections flags differ in alloc or load. * emultempl/pe.em: Formatting throughout. (gld${EMULATION_NAME}_place_orphan): As for elf32.em. * emultempl/pep.em: Formatting throughout. (gld${EMULATION_NAME}_place_orphan): As for elf32.em. ld/testsuite/ * ld-elf/orphan3.d, * ld-elf/orphan3a.s, * ld-elf/orphan3b.s, * ld-elf/orphan3c.s, * ld-elf/orphan3d.s, * ld-elf/orphan3e.s, * ld-elf/orphan3f.s: New test. * ld-pe/orphan.d, * ld-pe/orphana.s, * ld-pe/orphanb.s, * ld-pe/orphand.s, * ld-pe/orphane.s: New test. * ld-pe/direct.exp: Use is_pecoff_format. * ld-pe/longsecn.exp: Delete. * ld-pe/pe.exp: Run new test and longsecn tests.
2009-05-14bfd/Ulrich Weigand1-0/+2
* elf32-spu.c (build_stub): Always build "compact" sofware i-cache stubs. ld/ * emultempl/spuelf.em (PARSE_AND_LIST_ARGS_CASES): Always use compact stubs with software i-cache. ld/testsuite/ * ld-spu/icache1.d: Update for compact stubs.
2009-05-14bfd/Alan Modra1-0/+2
* elf32-spu.c (spu_elf_size_stubs): Split out section placement to.. (spu_elf_place_overlay_data): ..here. New function. * elf32-spu.h (spu_elf_place_overlay_data): Declare. ld/ * emultempl/spuelf.em (spu_before_allocation): Call spu_elf_place_overlay_data. ld/testsuite/ * ld-spu/icache1.d: Update for changed overlay manager placement. * ld-spu/ovl.d: Likewise. * ld-spu/ovl2.d: Likewise.
2009-05-14 * ldlang.c (lang_insert_orphan): Add __start_<section> symbolAlan Modra2-74/+40
assignment inside output section statement. Ensure only one set of symbols per output section. * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Add non- dollar sections before dollar sections. Correct add_child list insertion. * emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
2009-05-052009-05-05 Paul Brook <paul@codesourcery.com>Paul Brook1-0/+68
bfd/ * bfd-in.h (elf32_arm_fix_exidx_coverage): Add prototype. * bfd-in2.h: Regenerate. * elf32-arm.c (arm_unwind_edit_type, arm_unwind_table_edit): Define. (_arm_elf_section_data): Add text and exidx fields. (add_unwind_table_edit, get_arm_elf_section_data, adjust_exidx_size, insert_cantunwind_after, elf32_arm_fix_exidx_coverage, offset_prel31, copy_exidx_entry): New functions. (elf32_arm_write_section): Fixup .ARM.exidx contents. ld/ * emultempl/armelf.em (compare_output_sec_vma): New function. (gld${EMULATION_NAME}_finish): Add exidx munging code. ld/testsuite/ * ld-arm/arm.ld: Add .ARM.exidx and .ARM.extab. * ld-arm/arm-elf.exp: Add unwind-[1-4]. * ld-arm/unwind-1.d: New test. * ld-arm/unwind-1.s: New test. * ld-arm/unwind-2.d: New test. * ld-arm/unwind-2.s: New test. * ld-arm/unwind-3.d: New test. * ld-arm/unwind-3.s: New test. * ld-arm/unwind-4.d: New test. * ld-arm/unwind-4.s: New test.
2009-04-21 bfd/Daniel Jacobowitz1-59/+8
* elf32-arm.c (INTERWORK_FLAG): Check BFD_LINKER_CREATED. (elf32_arm_write_section): Declare early. (elf32_arm_size_stubs): Skip non-stub sections in the stub BFD. (arm_allocate_glue_section_space): Exclude empty sections. (ARM_GLUE_SECTION_FLAGS): Add SEC_LINKER_CREATED. (bfd_elf32_arm_add_glue_sections_to_bfd): Do not skip the stub BFD. (elf32_arm_output_glue_section, elf32_arm_final_link): New. (elf32_arm_merge_eabi_attributes): Skip the stub BFD. (elf32_arm_size_dynamic_sections): Allocate interworking sections here. (bfd_elf32_bfd_final_link): Define. ld/ * emultempl/armelf.em (bfd_for_interwork, arm_elf_after_open) (arm_elf_set_bfd_for_interworking): Delete. (arm_elf_before_allocation): Do not set the interworking BFD. Move allocation inside not-dynamic block. (arm_elf_create_output_section_statements): Create glue sections and set the interworking BFD here. (LDEMUL_AFTER_OPEN): Delete. ld/testsuite/ * ld-arm/farcall-mix.d, ld-arm/farcall-mix2.d, ld-arm/farcall-group-size2.d, ld-arm/farcall-group.d, ld-arm/farcall-mixed-lib.d: Update for linker changes.
2009-04-09 * emultempl/spuelf.em (embedded_spu_file): Use pex_one in placeAlan Modra1-24/+15
of fork/execvp.
2009-04-02ld/ChangeLogDave Korn2-0/+12
PR ld/6744 * ld.texinfo (--export-dynamic): Mention --export-all-symbols. * emultempl/pe.em (gld_${EMULATION_NAME}_after_parse): Issue warning if --export-dynamic was passed on command-line. * emultempl/pep.em (gld_${EMULATION_NAME}_after_parse): Likewise. ld/testsuite/ChangeLog PR ld/6744 * ld-pe/export_dynamic_warning.d: New test control file. * ld-pe/export_dynamic_warning.s: New test source file. * ld-pe/pe.exp: Also run export_dynamic_warning dump test.
2009-04-01bfd/Richard Sandiford1-21/+32
* bfd-in.h (bfd_xcoff_split_import_path): Declare. (bfd_xcoff_set_archive_import_path): Likewise. * bfd-in2.h: Regenerate. * xcofflink.c: Include libiberty.h. (xcoff_archive_info): New structure. (xcoff_archive_info_hash): New function. (xcoff_archive_info_eq): Likewise. (xcoff_get_archive_info): Likewise. (_bfd_xcoff_bfd_link_hash_table_create): Initialize archive_info. (bfd_xcoff_split_import_path): New function. (bfd_xcoff_set_archive_import_path): Likewise. (xcoff_set_import_path): Move earlier in file. (xcoff_link_add_dynamic_symbols): Set the import path of a non-archive object to the the directory part of the bfd's filename. Get the import path and filename of an archive object from the archive's xcoff_tdata, initializing it if necessary. Update use of import_file_id. (bfd_link_input_bfd): Update use of import_file_id. (xcoff_write_global_symbol): Likewise. ld/ * emultempl/aix.em (gld${EMULATION_NAME}_open_dynamic_archive): New function. (ld_${EMULATION_NAME}_emulation): Use it.
2009-03-19bfd/Alan Modra1-2/+6
* elf32-spu.c (spu_elf_find_overlays): Separate error return from "no overlays" return. If there are overlays, create overlay manager entry symbols here, so that.. (spu_elf_build_stubs): ..we don't need to set them up here. Simplify entry symbol tests. * elf32-spu.h (spu_elf_find_overlays): Update prototype. ld/ * emultempl/spuelf.em (spu_before_allocation): Report errors from spu_elf_find_overlays.
2009-03-17bfd/Alan Modra3-32/+45
* elf32-spu.h (struct spu_elf_params): ovly_flavour now only 1 bit. Add compact_stub. (emum _ovly_flavour): Delete ovly_compact, ovly_none. * elf32-spu.c (struct spu_link_hash_table): Replace ovly_load and ovly_return fields with ovly_entry[2]. Adjust all users. (spu_elf_find_overlays): Set ovly_entry[1] from __icache_call_handler when soft-icache. (spu_elf_build_stubs): Likewise. (ovl_stub_size): Change arg to spu_elf_params pointer. Adjust for ovly_flavour changes. Update all callers. (ovl_stub_size_log2): New function. (build_stub): Handle compact icache stubs. Use different manager entry point for stubs in non-icache area. (spu_elf_size_stubs): Don't allocate space for indirect branch descriptors. (spu_elf_build_stubs): And don't built them. ld/ * emultempl/spu_icache.S: Add new entry to dummy handler. * emultempl/spu_icache.o_c: Regenerate. * emultempl/spuelf.em (params): Init new field. (no_overlays): New static var. (spu_before_allocation): Use it. (OPTION_SPU_COMPACT_STUBS): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add compact-stubs. (PARSE_AND_LIST_ARGS_CASES): Handle compact-stubs. Adjust no-overlays handling. ld/testsuite/ * ld-spu/icache1.d: Update for fixed set_id, new manager entry, and reduced data.
2009-03-14include/coff/Richard Sandiford1-2/+43
* xcoff.h (XCOFF_EXPALL, XCOFF_EXPFULL): New flags. (xcoff_loader_info): Add auto_export_flags. bfd/ * bfd-in.h (bfd_xcoff_size_dynamic_sections): Replace the bfd_boolean export_defineds parameter with an unsigned int auto_export_flags parameter. * bfd-in2.h: Regenerate. * xcofflink.c (xcoff_archive_contains_shared_object_p): New function, split out from xcoff_build_ldsyms. (xcoff_covered_by_expall_p): New function. (xcoff_auto_export_p): New function, split out from xcoff_build_ldsyms but with extra code to handle -bexpfull and -bexpall. (xcoff_mark_auto_exports): New function. (xcoff_build_ldsyms): Use xcoff_auto_export_p to decide whether a function should be automatically exported. (bfd_xcoff_size_dynamic_sections): Replace the export_defineds parameter with an auto_export_flags parameter. Update ldinfo accordingly. Use xcoff_mark_auto_exports to mark all automatically- exported symbols. ld/ * emultempl/aix.em (auto_export_flags): New variable. (explicit_auto_export_flags): Likewise. (OPTION_EXPALL, OPTION_EXPFULL): New enum values. (OPTION_NOEXPALL, OPTION_NOEXPFULL): Likewise. (gld${EMULATION_NAME}_add_options): Add -bexpall, -bexpfull, -bnoexpall and -bnoexpfull. (gld${EMULATION_NAME}_handle_option): Handle them. (gld${EMULATION_NAME}_before_allocation): Update the call to bfd_size_dynamic_sections. ld/testsuite/ * ld-powerpc/aix-export-1-all.dd, ld-powerpc/aix-export-1-full.dd, ld-powerpc/aix-export-1a.s, ld-powerpc/aix-export-1b.s: New tests. * ld-powerpc/aix52.exp: Run them.
2009-03-14include/coff/Richard Sandiford1-2/+4
* xcoff.h (XCOFF_CALLED, XCOFF_IMPORT): Update comments. (XCOFF_WAS_UNDEFINED): New flag. (xcoff_link_hash_table): Add an "rtld" field. bfd/ * coff-rs6000.c (xcoff_ppc_relocate_section): Report relocations against undefined symbols if the symbol's XCOFF_WAS_UNDEFINED flag is set. Assert that all undefined symbols are either imported or defined by a dynamic object. * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise. * xcofflink.c (xcoff_link_add_symbols): Extend function-symbol handling to all relocations. Only set XCOFF_CALLED for function symbols. (xcoff_find_function): New function, split out from... (bfd_xcoff_export_symbol) ...here. (xcoff_set_import_path): New function, split out from... (bfd_xcoff_import_symbol): ...here. Remove assertion for old meaning of XCOFF_CALLED. (xcoff_mark_symbol): If we mark an undefined and unimported symbol, find some way of defining it. If the symbol is a function descriptor, fill in its definition automatically. If the symbol is a function, mark its descriptor and allocate room for global linkage code. Otherwise mark the symbol as implicitly imported. Move the code for creating function descriptors from... (xcoff_build_ldsyms): ...here. Use XCOFF_WAS_UNDEFINED to check for symbols that were implicitly defined. (xcoff_mark): Don't count any dynamic relocations against function symbols. (bfd_xcoff_size_dynamic_sections): Save the rtld parameter in the xcoff link info. (xcoff_link_input_bfd): Remove handling of undefined and unexported symbols. ld/ * emultempl/aix.em (gld${EMULATION_NAME}_handle_option): Make -berok and -bernotok control link_info.unresolved_syms_in_objects and link_info.unresolved_syms_in_shared_libs instead of force_make_executable. ld/testsuite/ * ld-powerpc/aix-glink-1.ex, ld-powerpc/aix-glink-1.s, ld-powerpc/aix-glink-1-32.dd, ld-powerpc/aix-glink-1-64.dd, ld-powerpc/aix-glink-1-32.d, ld-powerpc/aix-glink-1-64.d: New tests. * ld-powerpc/aix52.exp: Run them.
2009-03-14ld/Richard Sandiford1-0/+1
* emultempl/aix.em (gld${EMULATION_NAME}_before_parse): Set config.dynamic_link to TRUE.
2009-03-14ld/Richard Sandiford1-1/+22
* emultempl/aix.em (gld${EMULATION_NAME}_before_allocation): Mark .text, .data and .bss output sections as SEC_KEEP. ld/testsuite/ * ld-powerpc/aix-core-sec-1.s, ld-powerpc/aix-core-sec-1.ex, ld-powerpc/aix-core-sec-1.hd, ld-powerpc/aix-core-sec-2.s, ld-powerpc/aix-core-sec-2.ex, ld-powerpc/aix-core-sec-2.hd, ld-powerpc/aix-core-sec-3.s, ld-powerpc/aix-core-sec-3.ex, ld-powerpc/aix-core-sec-3.hd: New tests. * ld-powerpc/aix52.exp: New harness.
2009-03-14include/ChangeLogDave Korn2-2/+116
2009-03-12 Dave Korn <dave.korn.cygwin@gmail.com> * coff/internal.h (struct internal_extra_pe_aouthdr): Correct type of DllCharacteristics flags field to unsigned. * coff/pe.h (IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLLCHARACTERISTICS_NO_ISOLATION, IMAGE_DLLCHARACTERISTICS_NO_SEH, IMAGE_DLLCHARACTERISTICS_NO_BIND, IMAGE_DLLCHARACTERISTICS_WDM_DRIVER, IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE): New macros to define flag bit values for DllCharacteristics field of PEAOUTHDR, PEPAOUTHDR. ld/ChangeLog 2009-03-12 Dave Korn <dave.korn.cygwin@gmail.com> Danny Smith <dannysmith@users.sourceforge.net> * emultmpl/pe.em (pe_dll_characteristics): New variable. (OPTION_DYNAMIC_BASE, OPTION_FORCE_INTEGRITY, OPTION_NX_COMPAT, OPTION_NO_ISOLATION. OPTION_NO_SEH, OPTION_NO_BIND, OPTION_WDM_DRIVER, OPTION_TERMINAL_SERVER_AWARE): New macros for options to set DllCharacteristics flag bits. (gld${EMULATION_NAME}_add_options): Add dynamicbase, forceinteg, nxcompat, no-isolation, no-seh, no-bind, wdmdriver, tsaware options. (init): Add DllCharacteristics field. (gld_${EMULATION_NAME}_list_options): List new options. (gld${EMULATION_NAME}_handle_option): Handle new options. * emultmpl/pep.em (pe_dll_characteristics): New variable. (OPTION_DYNAMIC_BASE, OPTION_FORCE_INTEGRITY, OPTION_NX_COMPAT, OPTION_NO_ISOLATION. OPTION_NO_SEH, OPTION_NO_BIND, OPTION_WDM_DRIVER, OPTION_TERMINAL_SERVER_AWARE): New macros for options to set DllCharacteristics flags. (gld${EMULATION_NAME}_add_options): Add dynamicbase, forceinteg, nxcompat,no-isolation, no-seh, no-bind, wdmdriver, tsaware options. (init): Add DllCharacteristics field. (gld_${EMULATION_NAME}_list_options): List new options. (gld${EMULATION_NAME}_handle_option): Handle new options. * ldtexinfo : Document dynamicbase, forceinteg, nxcompat, no-isolation, no-seh, no-bind, wdmdriver, tsaware options.
2009-03-03 * emultempl/pe.em (debug_section_p): New bfd_map_over_sections hook.Dave Korn2-0/+60
(gld_${EMULATION_NAME}_after_open): Use it to iterate all sections of all input BFDs, looking for debug info. Enable long section names if any found. * emultempl/pe.em (debug_section_p): Likewise. (gld_${EMULATION_NAME}_after_open): Likewise. * NEWS: Retrospectively adjust news announcement. * ld.texinfo: Update documentation to mention new behaviour.
2009-03-02Add support for Score7 architecture.Nick Clifton1-4/+17
2009-02-27ld/ChangeLogDave Korn1-1/+15
* emultempl/pe.em (gld_${EMULATION_NAME}_before_parse): Set default state of auto-import flag based on $target. ld/testsuite/ChangeLog * ld-pe/pe.exp: Disable auto-import when linking on Cygwin.
2009-02-242009-02-24 Joseph Myers <joseph@codesourcery.com>Daniel Jacobowitz1-5/+5
bfd/ * elf32-arm.c (PREV_SEC): Update comment. (group_sections): Rename argument to stubs_always_after_branch. Reverse the list and place stubs at the end of input sections. Undefine NEXT_SEC. (elf32_arm_size_stubs): Update to use stubs_always_after_branch. ld/ * ld.texinfo (ARM): Document changed meaning of --stub-group-size. * emultempl/armelf.em (hook_in_stub): Insert after the input section. (elf32_arm_add_stub_section): Update comment. (PARSE_AND_LIST_OPTIONS): Update help for --stub-group-size. 2009-02-24 Daniel Jacobowitz <dan@codesourcery.com> ld/testsuite/ * ld-arm/arm-elf.exp (armeabitests): Update duplicate test names. Use normal output files for big-endian. * ld-arm/farcall-arm-arm-be.d, ld-arm/farcall-thumb-arm-be.d: Delete. * ld-arm/farcall-arm-arm-be8.d, ld-arm/farcall-arm-arm-pic-veneer.d, ld-arm/farcall-arm-arm.d, ld-arm/farcall-arm-thumb-blx-pic-veneer.d, ld-arm/farcall-arm-thumb-blx.d, ld-arm/farcall-arm-thumb-pic-veneer.d, ld-arm/farcall-arm-thumb.d, ld-arm/farcall-group-size2.d, ld-arm/farcall-group.d, ld-arm/farcall-mix.d, ld-arm/farcall-mix2.d, ld-arm/farcall-thumb-arm-be8.d, ld-arm/farcall-thumb-arm-blx-pic-veneer.d, ld-arm/farcall-thumb-arm-blx.d, ld-arm/farcall-thumb-arm-short.d, ld-arm/farcall-thumb-arm.d, ld-arm/farcall-thumb-thumb-blx-pic-veneer.d, ld-arm/farcall-thumb-thumb-blx.d, ld-arm/farcall-thumb-thumb-m.d, ld-arm/farcall-thumb-thumb.d, ld-arm/thumb2-bl-as-thumb1-bad.d, ld-arm/thumb2-bl-bad.d: Update for moved stubs.
2009-02-18bfd/ChangeLogDave Korn2-2/+34
* coff-alpha.c (alpha_ecoff_backend_data): Initialise fields which control long section name handling with ECOFF_NO_LONG_SECTION_NAMES. * coff-mips.c (mips_ecoff_backend_data): Likewise. * coff-rs6000.c (bfd_xcoff_backend_data): Initialise fields which control long section name handling with XCOFF_NO_LONG_SECTION_NAMES. (bfd_pmac_xcoff_backend_data): Likewise. * coff64-rs6000.c (bfd_xcoff_backend_data): Likewise. (bfd_xcoff_aix5_backend_data): Likewise. (xcoff64_write_object_contents): Delete unused long_section_names local variable. * coff-sh.c (bfd_coff_small_swap_table): Initialise long section name members using COFF_DEFAULT_LONG_SECTION_NAMES and make entire struct non-const. * coffcode.h (documentation): Update to describe long section names. (COFFLONGSECTIONCATHELPER): New helper macro. (BLANKOR1TOODD): Likewise. (COFF_ENABLE_LONG_SECTION_NAMES): Likewise. (COFF_LONG_SECTION_NAMES_SETTER): Likewise. (COFF_DEFAULT_LONG_SECTION_NAMES): Likewise. (bfd_coff_set_long_section_names_allowed): New function. (bfd_coff_set_long_section_names_disallowed): Likewise. (struct bfd_coff_backend_data): Add new backend hook function pointer _bfd_coff_set_long_section_names. (bfd_coff_set_long_section_names): New backend hook. (coff_write_object_contents): Only generate long section names if bfd_coff_long_section_names() indicates they are currently enabled. (bfd_coff_std_swap_table): Make non-const, and initialise long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES. (ticoff0_swap_table): Likewise to both. (ticoff1_swap_table): Again, likewise to both. * coffgen.c (make_a_section_from_file): Allow long section names as inputs even if not currently allowed for outputs. * ecoff.c (_bfd_ecoff_no_long_sections): New function. * efi-app-ia32.c (COFF_LONG_SECTION_NAMES): Define to 0, not blank. * efi-app-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-app-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-bsdrv-ia32.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-bsdrv-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-bsdrv-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-rtdrv-ia32.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-rtdrv-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-rtdrv-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-arm.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-i386.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-mcore.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-mips.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-ppc.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-sh.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. * libcoff-in.h: Update copyright year to cause updated copyright year in generated libcoff.h, and fix typo. * libcoff.h: Regenerated. * libecoff.h (ECOFF_NO_LONG_SECTION_NAMES): New macro. (_bfd_ecoff_no_long_sections): Add prototype. * libxcoff.h (XCOFF_NO_LONG_SECTION_NAMES): New macro. * pe-mips.c (COFF_LONG_SECTION_NAMES): Define empty if not already defined by an including .c file. * ticoff.h (ticoff0_swap_table): Make non-const, and initialise long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES. (ticoff1_swap_table): Likewise to both. ld/ChangeLog * ld.texinfo: Update to mention long section name options. * NEWS: Mention new behaviour and command-line options. * pe-dll.c (pe_use_coff_long_section_names): New global variable. (pe_output_file_set_long_section_names): New function. (pe_dll_build_sections): Call it on output BFDs. (pe_exe_build_sections): Likewise. (pe_dll_fill_sections): Likewise. (pe_exe_fill_sections): Likewise. * pe-dll.h (pe_use_coff_long_section_names): Declare extern. (pe_output_file_set_long_section_names): Add prototype. * pep-dll.c (pe_use_coff_long_section_names): Define pep_ alias. (pe_output_file_set_long_section_names): Likewise. * pep-dll.h (pep_use_coff_long_section_names): Declare extern. (pep_output_file_set_long_section_names): Add prototype. * pe.em (OPTION_ENABLE_LONG_SECTION_NAMES): New getopt value macro. (OPTION_DISABLE_LONG_SECTION_NAMES): Likewise. (gld${EMULATION_NAME}_add_options): Add new options to xtra_long[]. (gld_${EMULATION_NAME}_list_options): Describe them. (gld${EMULATION_NAME}_handle_option): Set or clear global pe_use_coff_long_section_names flag when options recognised. (gld_${EMULATION_NAME}_after_open): En/disable long section names for main output bfd by calling pe_output_file_set_long_section_names. * pep.em (enum options): Extend enum with new getopt option values. (gld${EMULATION_NAME}_add_options): Add new options to xtra_long[]. (gld_${EMULATION_NAME}_list_options): Describe them. (gld${EMULATION_NAME}_handle_option): Set or clear global pe_use_coff_long_section_names flag when options recognised. (gld_${EMULATION_NAME}_after_open): En/disable long section names for main output bfd by calling pep_output_file_set_long_section_names. ld/testsuite/ChangeLog * ld-pe/longsecn-1.d: New test file. * ld-pe/longsecn-2.d: Likewise. * ld-pe/longsecn-3.d: Likewise. * ld-pe/longsecn-4.d: Likewise. * ld-pe/longsecn-5.d: Likewise. * ld-pe/longsecn.d: Likewise. * ld-pe/longsecn.exp: New test control script. * ld-pe/longsecn.s: New test source file.
2009-02-16 * emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Don't emitDave Korn1-2/+2
inadvertent .reloc sections caused by refactoring accident.
2009-02-16 * ldlang.c (push_stat_ptr, pop_stat_ptr): New functions.Alan Modra5-31/+16
(stat_save, stat_save_ptr): New variables. (lang_insert_orphan): Use push_stat_ptr and pop_stat_ptr. (load_symbols): Likewise. Delete dead "bad_load" code. (open_input_bfds): Warn on script containing output sections. (lang_enter_output_section_statement): Use push_stat_ptr. (lang_enter_group): Likewise. (lang_leave_output_section_statement): Use pop_stat_ptr. (lang_leave_group): Likewise. * ldlang.h (push_stat_ptr, pop_stat_ptr): Declare. * ldctor.c (ldctor_build_sets): Use push_stat_ptr and pop_stat_ptr. * emultempl/beos.em (gld_${EMULATION_NAME}_set_symbols): Likewise. * emultempl/pe.em (gld_${EMULATION_NAME}_set_symbols): Likewise. * emultempl/pep.em (gld_${EMULATION_NAME}_set_symbols): Likewise. * emultempl/spuelf.em (spu_place_special_section): Likewise. * emultempl/xtensaelf.em (ld_xtensa_insert_page_offsets): Likewise.
2009-02-04 * emultempl/spuelf.em (spu_after_open): Don't combine .text.ia.*Alan Modra1-0/+3
during relocatable link.
2009-01-292009-01-29 Andrew Jenner <andrew@codesourcery.com>Joseph Myers1-1/+1
* emultempl/armelf.em: Correct formatting of help text for --no-enum-size-warning option.
2009-01-21bfd/Alan Modra1-2/+9
* elf32-spu.h (struct spu_elf_params): Add non_ia_text. * elf32-spu.c (mark_overlay_section): Only include .text.ia.* sections in soft-icache lines unless non_ia_text. Don't add rodata if doing so would exceed line size. ld/ * emultempl/spuelf.em (params): Init new field. (OPTION_SPU_NON_IA_TEXT): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add --non-ia-text. (PARSE_AND_LIST_ARGS_CASES): Handle OPTION_SPU_NON_IA_TEXT.
2009-01-12really regenerate this timeAlan Modra1-0/+31
2009-01-12bfd/Alan Modra3-25/+146
* elf32-spu.c (struct spu_link_hash_table): Add init, line_size_log2, num_lines_log2. (struct got_entry): Add br_addr. (struct call_info): Add priority. (struct function_info): Add lr_store and sp_adjust. (spu_elf_setup): Init line_size_log2 and num_lines_log2. (spu_elf_find_overlays): For soft-icache, mark any section within cache area as an overlay, and check that no other overlays exist. Look up icache overlay manager entry sym. (BRA_STUBS, BRA, BRASL): Define. (enum _stub_type): Replace ovl_stub with call_ovl_stub and br*_ovl_stub. (needs_ovl_stub): Adjust for soft-icache. Return priority encoded in branch insn. (count_stub, build_stub): Support soft-icache. (build_spuear_stubs, process_stubs): Adjust build_stub call. (spu_elf_size_stubs): Size soft-icache stubs. (overlay_index): New function. (spu_elf_build_stubs): Make static. Support soft-icache. (spu_elf_check_vma): Don't turn off auto_overlay if soft-icache. (find_function_stack_adjust): Save lr store and stack adjust insn offsets. (maybe_insert_function): Adjust find_function_stack_adjust call. (mark_functions_via_relocs): Retrieve priority. (remove_cycles): Only warn about pruned arcs when stack_analysis. (sort_calls): Sort by priority first. (mark_overlay_section): Ignore .ovl.init. (sum_stack): Only print when stack_analysis. (print_one_overlay_section): New function, extracted from.. (spu_elf_auto_overlay): ..here. Support soft-icache overlays. (spu_elf_stack_analysis): Only print when htab->stack_analysis. (spu_elf_final_link): Call spu_elf_stack_analysis for lrlive analysis. Call spu_elf_build_stubs. (spu_elf_relocate_section): For soft-icache encode overlay index into addresses. (spu_elf_output_symbol_hook): Support soft-icache. (spu_elf_modify_program_headers: Likewise. * elf32-spu.h (struct spu_elf_params): Add lrlive_analysis. Rename num_regions to num_lines. Add line_size and max_branch. (enum _ovly_flavour): Add ovly_soft_icache. (spu_elf_build_stubs): Delete. gas/ * config/tc-spu.c (md_pseudo_table): Add "brinfo". (brinfo): New var. (md_assemble): Poke brinfo into branch instructions. (spu_brinfo): New function. (md_apply_fix): Don't assume insn fields start off at zero, mask them to remove possible brinfo. ld/ * emultempl/spuelf.em (params): Init new fields. (num_lines_set, line_size_set, icache_mgr, icache_mgr_stream): New vars. (spu_place_special_section): Adjust placement for soft-icache. Pad soft-icache section to a fixed size. Clear addr_tree. (spu_elf_load_ovl_mgr): Support soft-icache. Map overlay manager sections a little more intelligently. (gld${EMULATION_NAME}_finish): Don't call spu_elf_build_stubs. (OPTION_SPU_NUM_LINES): Rename from OPTION_SPU_NUM_REGIONS. (OPTION_SPU_SOFT_ICACHE, OPTION_SPU_LINE_SIZE): Define. (OPTION_SPU_LRLIVE): Define. (PARSE_AND_LIST_LONGOPTS): Add new soft-icache options. (PARSE_AND_LIST_OPTIONS): Likewise. (PARSE_AND_LIST_ARGS_CASES): Handle them. * emultempl/spu_icache.S: Dummy file. * emultempl/spu_icache.o_c: Regenerate. * Makefile.am (eelf32_spu.c): Depend on spu_icache.o_c. (spu_icache.o_c): Add rule to build. (CLEANFILES): Zap temp files. (EXTRA_DIST): Add spu_icache.o_c. * Makefile.in: Regenerate. ld/testsuite/ * ld-spu/ovl.d: Allow for absolute branches in stubs. * ld-spu/ovl2.d: Likewise.
2009-01-082009-01-08 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2-1/+14
* pe.em (OPTION_USE_NUL_PREFIXED_IMPORT_TABLES): New. (gld..._add_options): Add new option --use-nul-prefixed-import-tables. (gld..._handle_option): Likewise. * pep.em: Same as for pe.em. * ld.texinfo: Add new option documentation for --use-nul-prefixed-import-tables. * pe-dll.c (pe_use_nul_prefixed_import_tables): New. (make_head): Make prefix leading zero prefix element for idata$4 and idata$5 dependent to new flag. (make_import_fixup_entry): Remove idata4/5 prefix. * pe-dll.h (pe_use_nul_prefixed_import_tables): New. * pep-dll.c (pe_use_nul_prefixed_import_tables): New. * pep-dll.h (pep_use_nul_prefixed_import_tables): New. * NEWS: Add new option.
2009-01-052009-01-05 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2-11/+11
* emultempl/pe.em: Prefix dollar characters to be outputed in generated C file. * emultempl/pep.em: Likewise.
2009-01-03 * NEWS: Mention new feature --exclude-modules-for-implib.Dave Korn2-7/+24
* ld.texinfo: Document new --exclude-modules-for-implib option. * pe-dll.c (exclude_list_struct): Change type member from int to new enumeration exclude_type. (pe_dll_add_excludes): Accept exclude_type instead of int param. (auto_export): Replace magic constants by exclude_type values and handle new choice EXCLUDEFORIMPLIB. (pe_dll_generate_implib): Accept a pointer to the link_info and iterate all input BFDs looking for EXCLUDEFORIMPLIB modules; re-open fresh BFDs for any found and link into import lib archive chain. * pe-dll.h (exclude_type): Add new enumerated type to replace magic constants previously used for exclude_list_struct type member. (pe_dll_add_excludes, pe_dll_generate_implib): Update prototypes. * pep-dll.h (exclude_type, pe_dll_add_excludes, pe_dll_generate_implib): Likewise to all the above. * emultempl/pe.em (OPTION_EXCLUDE_MODULES_FOR_IMPLIB): Define new getopts long option code for new --exclude-modules-for-implib option. (gld${EMULATION_NAME}_add_options): Add new entry to xtra_long[]. (gld_${EMULATION_NAME}_list_options): List usage for it. (gld${EMULATION_NAME}_handle_option): Use exclude_type enumerated values when calling pe_dll_add_excludes, and handle EXCLUDEFORIMPLIB. (gld_${EMULATION_NAME}_finish): Pass pointer to link_info when calling pe_dll_generate_implib. * emultempl/pep.em (options): Define new enumerated value for getopts long option code for new --exclude-modules-for-implib option. (gld${EMULATION_NAME}_add_options, gld_${EMULATION_NAME}_list_options, gld${EMULATION_NAME}_handle_option, gld_${EMULATION_NAME}_finish): Again, likewise to all the above.
2008-12-10bfd/Alan Modra1-2/+15
* elf32-spu.h (struct spu_elf_params): Add num_regions. * elf32-spu.c (spu_elf_auto_overlay): Handle multiple overlay regions. ld/ * emultempl/spuelf.em (params): Init new field. (OPTION_SPU_NUM_REGIONS): Define. (PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS): Add --num-regions. (PARSE_AND_LIST_ARGS_CASES): Handle --num-regions.
2008-12-10bfd/Alan Modra1-81/+78
* elf32-spu.g (struct spu_elf_params, enum _ovly_flavour): New. (spu_elf_setup): Declare. (spu_elf_create_sections, spu_elf_size_stubs): Update prototype. (spu_elf_build_stubs, spu_elf_check_vma): Likewise. * elf32-spu.c (struct spu_link_hash_table): Add "params". Remove various other fields now in "params". Adjust code throughout. (struct call_info, struct function_info): Move earlier in file. (struct spu_elf_stack_info): Likewise. (spu_elf_setup): New function. (spu_elf_create_sections): Remove args other than "info". (spu_elf_size_stubs, spu_elf_build_stubs, spu_elf_check_vma): Likewise. (maybe_needs_stubs): Remove "output_bfd" arg. Adjust all calls. (interesting_section): Similarly with "obfd" arg. (needs_ovl_stub): Adjust output_section test. (allocate_spuear_stubs): Likewise. (OVL_STUB_SIZE): Don't define. (ovl_stub_size): New function, use in place of OVL_STUB_SIZE. (build_stub): Test params->ovly_flavour rather than OVL_STUB_SIZE. (spu_elf_auto_overlay): Remove args other than "info". Make use of size returned from spu_elf_load_ovl_mgr. (spu_elf_stack_analysis): Remove args other than "info". (spu_elf_relocate_section): Tidy setting of "ea". ld/ * emultempl/spuelf.em (params): New var, used instead of various others. Adjust use throughout file. (spu_after_open): Call spu_elf_setup. (spu_place_special_section): Tidy. (spu_elf_load_ovl_mgr): Return total size of sections loaded. Move code setting overlay section alignment to.. (spu_before_allocation): ..here.
2008-11-27 * emultempl/cr16elf.em (cr16_after_open): New function to handleM R Swami Reddy1-0/+114
CR16 ELF embedded reloc creation (ld --embedded-relocs). (check_sections): New function. (LDEMUL_AFTER_OPEN): Define. * emulparams/elf32cr16.sh (EMBEDDED): Define. * NEWS: Add comment on cr16 new feature.