Commit Graph

7653 Commits

Author SHA1 Message Date
H.J. Lu 3aa14d16c6 bfd/
2009-06-01  H.J. Lu  <hongjiu.lu@intel.com>

	* elf-bfd.h (struct bfd_elf_section_data): Remove indirect_relocs.
	(_bfd_elf_make_ifunc_reloc_section): Removed.
	(_bfd_elf_is_ifunc_symbol): Likewise.
	(_bfd_elf_create_static_ifunc_sections): New.

	* elflink.c (_bfd_elf_adjust_dynamic_symbol): Move STT_GNU_IFUNC
	symbol check to ...
	(elf_link_add_object_symbols): Here.
	(_bfd_elf_link_hash_hide_symbol): Don't clean plt on
	STT_GNU_IFUNC symbol.
	(elf_link_output_extsym): Call elf_backend_finish_dynamic_symbol
	if a STT_GNU_IFUNC symbol is referenced in a non-shared object.
	(IFUNC_INFIX): Removed.
	(get_ifunc_reloc_section_name): Likewise.
	(_bfd_elf_make_ifunc_reloc_section): Likewise.
	(_bfd_elf_is_ifunc_symbol): Likewise.
	(_bfd_elf_create_static_ifunc_sections): New.

ld/

2009-06-01  H.J. Lu  <hongjiu.lu@intel.com>

	* scripttempl/elf.sc (PLT): Add "*(.iplt)".
	(GOT): Add "*(.igot.plt)a" and "*(.igot)".
	(GOTPLT): Add "*(.igot)".
	(__rel_iplt_start): New.
	(__rel_iplt_end): Likewise.
	(__rela_iplt_start): Likewise.
	(__rela_iplt_end): Likewise.
2009-06-01 12:53:00 +00:00
Alan Modra f11461245f daily update 2009-06-01 00:00:09 +00:00
Alan Modra 4c153cddd3 daily update 2009-05-31 00:00:05 +00:00
Alan Modra e10ff88f27 daily update 2009-05-30 00:00:05 +00:00
H.J. Lu eb4ff4d67f 2009-05-29 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (link_hash_newfunc): Add elf_i386_ prefix.
	(create_got_section): Likewise.
	(allocate_dynrelocs): Likewise.
	(readonly_dynrelocs): Likewise.
	(set_tls_module_base): Likewise.
	(dtpoff_base): Likewise.
	(tpoff): Likewise.
	(elf_i386_link_hash_table_create): Updated.
	(elf_i386_create_dynamic_sections): Likewise.
	(elf_i386_check_relocs): Likewise.
	(elf_i386_size_dynamic_sections): Likewise.
	(elf_i386_relocate_section): Likewise.

	* elf64-x86-64.c (link_hash_newfunc): Add elf64_x86_64_ prefix.
	(create_got_section): Likewise.
	(allocate_dynrelocs): Likewise.
	(readonly_dynrelocs): Likewise.
	(set_tls_module_base): Likewise.
	(dtpoff_base): Likewise.
	(tpoff): Likewise.
	(elf64_x86_64_link_hash_table_create): Updated.
	(elf64_x86_64_create_dynamic_sections): Likewise.
	(elf64_x86_64_check_relocs): Likewise.
	(elf64_x86_64_size_dynamic_sections): Likewise.
	(elf64_x86_64_relocate_section): Likewise.
2009-05-29 18:30:30 +00:00
Alan Modra e69e4c63d7 daily update 2009-05-29 00:00:10 +00:00
Nick Clifton fc579192b4 2009-05-28 Nick Clifton <nickc@redhat.com>
* targets.c (_bfd_target_vector): Only include plugin target in
        all-targets build if BFD_SUPPORTS_PLUGINS is non-zero.

2009-05-27  Rafael Avila de Espindola  <espindola@google.com>

        * plugin.c (program_name): Remove.
        (plugin_program_name): New.
        (bfd_plugin_set_program_name): New.
        (try_load_plugin): Use plugin_program_name.
        * plugin.h (bfd_plugin_set_program_name): New.

2009-05-27  Rafael Avila de Espindola  <espindola@google.com>

        * ar.c (main): Call bfd_plugin_set_program_name.
        * nm.c (main): Call bfd_plugin_set_program_name.
2009-05-28 11:30:49 +00:00
Ulrich Weigand 5ebe285860 * elf32-spu.c (struct call_info): New member broken_cycle.
(remove_cycle): Instead of physically removing call_info structures
	to break call graph cycles, mark them using the broken_cycle flag.
	(mark_overlay_section): Respect broken_cycle flag.
	(unmark_overlay_section): Likewise.
	(collect_lib_sections): Likewise.
	(collect_overlays): Likewise.
	(sum_stack): Likewise.
2009-05-28 10:47:44 +00:00
Ulrich Weigand 34ad4cb0b5 * elf32-spu.c (insert_callee): Accumulate incoming callee->count.
(mark_functions_via_relocs): Initialize callee->count to 1.
	(pasted_function): Likewise.
	(spu_elf_auto_overlay): Honor call counts when determining number
	of stubs required in software i-cache mode.
2009-05-28 10:42:47 +00:00
Alan Modra 58683880f5 daily update 2009-05-28 00:00:08 +00:00
Nick Clifton 5691d22d50 * plugins.m4: New.
* aclocal.m4: Include ../config/plugins.m4.
        * configure.in: Use AC_PLUGINS.
        * configure: Regenerate.
        * Makefile.in: Regenerate.
        * doc/Makefile.in: Regenerate.
2009-05-27 16:29:55 +00:00
Nathan Sidwell c8a1f2548b bfd/
* elf32-ppc.c (ppc_elf_relax_section): Work with a partial
	link.
	* bout.c (b_out_bfd_relax_section): Reject relocatable links.
	* elf32-m10300.c (mn10300_elf_relax_section): Likewise.
	* elf32-avr.c (elf32_avr_relax_section): Likewise.
	* elf32-frv.c (elf32_avr_relax_section): Likewise.
	* elf32-xtensa.c (elf_xtensa_relax_section): Likewise.
	* elf64-mmix.c (mmix_elf_relax_section): Likewise.
	* elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_relax_section): Likewise.
	* reloc.c (bfd_generic_relax_section): Likewise.
	* reloc16.c (bfd_coff_reloc16_relax_section): Likewise.
	* vms.c (vms_bfd_relax_section): Likewise.

	ld/
	* ldmain.c (main): Don't reject --relax -r.
	* ld.texinfo (PowerPC ELF32): Document behaviour of relaxing
	partial links.

	ld/testsuite/
	* ld-powerpc/vxworks-relax-2.s: New.
	* ld-powerpc/vxworks-relax-2.rd: New.
	* ld-powerpc/powerpc.exp: Add it.
2009-05-27 13:31:24 +00:00
Alan Modra e155cf72f1 daily update 2009-05-27 00:00:05 +00:00
H.J. Lu 68d7e96a43 2009-05-26 H.J. Lu <hongjiu.lu@intel.com>
* elf-bfd.h (_bfd_elf_is_ifunc_symbol): New.

	* elf32-i386.c (is_indirect_symbol): Renamed to ...
	* elflink.c (_bfd_elf_is_ifunc_symbol): This.

	* elf32-i386.c (allocate_dynrelocs): Updated.
	(elf_i386_relocate_section): Likewise.
	* elf64-x86-64.c (allocate_dynrelocs): Likewise.
	(elf64_x86_64_relocate_section): Likewise.

	* elf64-x86-64.c (is_indirect_symbol): Removed.
2009-05-26 22:18:22 +00:00
Nick Clifton f12e7348b2 Update Indonesian translations.
Update translation templates.
2009-05-26 16:49:41 +00:00
Nick Clifton ce3c775b8f * Makefile.am: Run "make dep-am".
(AM_CPPFLAGS): New.
        (LIBDL): New.
        (ALL_MACHINES): Add cpu-plugin.lo.
        (ALL_MACHINES_CFILES): Add cpu-plugin.c.
        (BFD32_BACKENDS): Add plugin.lo.
        (BFD32_BACKENDS_CFILES): Add plugin.c.
        (libbfd_la_LIBADD): Add LIBDL
        * archures.c (bfd_architecture): Add bfd_arch_plugin.
        (bfd_plugin_arch): Declare.
        * bfd-in.h (BFD_SUPPORTS_PLUGINS): New.
        * bfd.c (bfd): Add plugin_data.
        * config.bfd: Handle the plugin target.
        * configure.in: Check for --enable-plugins.
        (LT_INIT): Use the dlopen option.
        * cpu-plugin.c: New.
        * plugin.c: New.
        * plugin.h: New.
        * targets.c (plugin_vec): Declare.
        (_bfd_target_vector): Add plugin_vec.
        * Makefile.in: Regenerate.
        * bfd-in2.h: Regenerate.
        * configure: Regenerate.
        * ar.c: Include plugin.h.
        (main): Handle the --plugin option.
        * nm.c: Include plugin.h.
        (OPTION_PLUGIN): New.
        (long_options): Add plugin.
        (main): Handle OPTION_PLUGIN.
        * NEWS: Mention  the new feature.
        * doc/binutils: Documement the new command line options.
        * configure.in: Check for --enable-plugins.
        * configure: Regenerate.
2009-05-26 14:12:03 +00:00
Alan Modra 9e097a72c9 * dep-in.sed: Don't modify .o to .lo here. Output one filename
per line with all lines having continuation backslash.  Prefix
	first line with "A", following lines with "B".
	* Makefile.am (DEP): Don't use dep.sed here.
	(DEP1): Run $MKDEP on single files, modify .o to .lo here.  Use
	dep.sed here on dependencies, sort and uniq.
	* Makefile.in: Regenerate.
2009-05-26 03:19:28 +00:00
Alan Modra 4379f3ec45 daily update 2009-05-26 00:00:04 +00:00
Tristan Gingold d5acff2fd3 2009-05-25 Tristan Gingold <gingold@adacore.com>
* makefile.vms: Add verilog.obj to object list OBJS.
2009-05-25 12:41:46 +00:00
Alan Modra 8dbc6e74e9 daily update 2009-05-25 00:00:09 +00:00
Alan Modra 5c93f09bed * bfdio.c (bfd_seek): Formatting. Ensure newly allocated memory
for BFD_IN_MEMORY is cleared.
       (bfd_bwrite): Zero excess memory allocated.
2009-05-24 11:47:27 +00:00
Alan Modra 6911cad6eb daily update 2009-05-24 00:00:04 +00:00
Alan Modra 3e13e920eb daily update 2009-05-23 00:00:05 +00:00
Julian Brown 48229727d8 ld/
* 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-22 11:58:45 +00:00
Alan Modra 2b3decb5e1 Run "make dep-am" and regenerate 2009-05-22 09:33:16 +00:00
Alan Modra 571ee0f66c daily update 2009-05-22 00:00:05 +00:00
Alan Modra 930e005c64 * elflink.c (elf_link_input_bfd): Correct *pindex change in last
commit.
2009-05-21 14:32:29 +00:00
Alan Modra 6e0b88f1b8 * elf-bfd.h (struct elf_backend_data
<elf_backend_link_output_symbol_hook>): Return an int.
	* elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop
	symbols on deleted .opd entries.
	* elflink.c (elf_link_output_sym): Return without outputting sym
	if output_symbol_hook returns 2.
	(elf_link_output_extsym): Don't assign h->indx when symbol discarded.
	Abort if we must not discard sym.
	(elf_link_input_bfd): Similarly, don't set finfo->indices for
	local syms.
	(bfd_elf_final_link): Adjust elf_link_output_sym calls.
	* elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for
	elf_backend_link_output_symbol_hook return type change.
	* elf32-arm.c (output_arch_syminfo): Likewise.
	(elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise.
	(elf32_arm_output_arch_local_syms): Likewise.
	* elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise.
	* elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise.
	(bfd_score_elf_link_output_symbol_hook): Likewise.
	* elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
	* elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
	* elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise.
	* elf32-spu.c (spu_elf_output_symbol_hook): Likewise.
	* elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise.
	* elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise.
	* elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise.
	* elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise.
	* elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise.
	* elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise.
2009-05-21 14:15:50 +00:00
Alan Modra 5ef11c0214 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't segfault on
out of range .opd symbols.
2009-05-21 13:49:11 +00:00
Dave Korn ebf12fbedc * coffgen.c (coff_print_symbol): Use bfd_fprintf_vma, not
fprintf_vma directly.
	* peXXigen.c (pe_print_edata):  Likewise.
	(pe_print_pdata):  Likewise.
	(_bfd_XX_print_ce_compressed_pdata):  Likewise.
	(_bfd_XX_print_private_bfd_data_common):  Likewise.
2009-05-21 12:52:37 +00:00
Alan Modra 0c31bcda4b daily update 2009-05-21 00:00:05 +00:00
H.J. Lu 164e7efc23 Reformat. 2009-05-20 16:03:42 +00:00
Alan Modra 722c10d60d daily update 2009-05-20 00:00:09 +00:00
Dave Korn c1711530e6 ==> bfd/ChangeLog <==
2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>

	* cofflink.c (process_embedded_commands):  Ignore "-aligncomm".

==> gas/ChangeLog <==
2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>

	* NEWS:  Mention new feature.
	* config/obj-coff.c (obj_coff_common_parse):  New function.
	(obj_coff_comm):  Likewise.
	(coff_pseudo_table):  Override default ".comm" definition on PE.
	* doc/as.texinfo:  Document new feature.

==> gas/testsuite/ChangeLog <==
2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>

	* gas/pe/:  New directory for PE format-specific tests.
	* gas/pe/aligncomm-a.d:  New test pattern file.
	* gas/pe/aligncomm-a.s:  New test source file.
	* gas/pe/aligncomm-b.d:  New test pattern file.
	* gas/pe/aligncomm-b.s:  New test source file.
	* gas/pe/aligncomm-c.d:  New test pattern file.
	* gas/pe/aligncomm-c.s:  New test source file.
	* gas/pe/aligncomm-d.d:  New test pattern file.
	* gas/pe/aligncomm-d.s:  New test source file.
	* gas/pe/pe.exp:  New test control script.
	* lib/gas-defs.exp (is_pecoff_format):  New function.

==> ld/ChangeLog <==
2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>

	* NEWS:  Mention new feature.
	* deffile.h (def_file_aligncomm):  Add new struct definition.
	(def_file):  Add new def_file_aligncomm member.
	* deffilep.y (%token):  Add new ALIGNCOMM token.
	(command):  Add production rule for ALIGNCOMM.
	(def_file_free):  Free any chained def_file_aligncomm structs.
	(diropts[]):  Add entry for '-aligncomm' .drectve command.
	(def_aligncomm):  New grammar function.
	* ld.texinfo:  Document new feature.
	* pe-dll.c (process_def_file):  Rename from this ...
	(process_def_file_and_drectve):  ... to this, updating all callers,
	and process any aligncomms chained to the def file after scanning
	all .drectve sections.
	(generate_edata):  Updated to match.
	(pe_dll_build_sections):  Likewise.

==> ld/testsuite/ChangeLog <==
2009-05-19  Dave Korn  <dave.korn.cygwin@gmail.com>

	* ld-pe/aligncomm-1.c:  New test source file.
	* ld-pe/aligncomm-2.c:  Likewise.
	* ld-pe/aligncomm-3.c:  Likewise.
	* ld-pe/aligncomm-4.c:  Likewise.
	* ld-pe/aligncomm.d:  New test pattern file.

	* ld-pe/direct.exp:  Deleted, and content moved into ...
	* ld-pe/pe-run.exp:  ... New common file for all PE run tests.

	* ld-pe/vers-script.exp:  Deleted, and content merged into ...
	* ld-pe/pe-compile.exp:  ... New common file for PE tests needing
	a compiler, adding aligned common tests.

	* ld-pe/pe.exp:  Update header comment.
2009-05-19 16:08:08 +00:00
Alan Modra 5b47127c1f daily update 2009-05-19 00:00:05 +00:00
Alan Modra 0cedc38378 daily update 2009-05-18 00:00:05 +00:00
Alan Modra dfa1e52a45 daily update 2009-05-17 00:00:05 +00:00
Alan Modra 4cbf8f8684 daily update 2009-05-16 00:00:05 +00:00
Paul Brook 22a8f80ef5 2009-05-15 Andrew Stubbs <ams@codesourcery.com>
Paul Brook  <paul@codesourcery.com>

	bfd/
	* elf32-arm.c (elf32_arm_fix_exidx_coverage): Don't attempt to
	fix discarded sections.

	ld/testsuite/
	* ld-arm/arm-elf.exp: Add unwind-5.
	* ld-arm/discard-unwind.ld: New file.
	* ld-arm/unwind-5.d: New test.
	* ld-arm/unwind-5.s: New test.
2009-05-15 00:08:12 +00:00
Alan Modra 875ebf4431 daily update 2009-05-15 00:00:05 +00:00
Ulrich Weigand 335bd8f205 * elf32-spu.c (mark_overlay_section): Move .init and .fini
sections into the software icache.
2009-05-14 17:56:56 +00:00
Ulrich Weigand cdc83fba73 bfd/
* 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-14 16:56:09 +00:00
Ulrich Weigand 97fc8d845e bfd/
* elf32-spu.c (struct spu_link_hash_table): Add fromelem_size_log2.
	(spu_elf_setup): Initialize it.
	(spu_elf_size_stubs): Move .ovtab into .bss for software i-cache.
	Update to new-sytle cache manager data structures.
	(spu_elf_build_stubs): Generate new-style cache manager data
	structures and symbols.
	(spu_elf_auto_overlay): Update size computation.

ld/testsuite/
	* ld-spu/icache1.d: Update all addresses to accomodate icache
	buffer shifted down 0x800 bytes.
2009-05-14 16:04:02 +00:00
Ulrich Weigand 452de53c12 bfd/
* elf32-spu.c (spu_elf_modify_segment_map): Move all PF_OVERLAY
	segments first amongst the program headers.

ld/testsuite/
	* ld-spu/icache.d: Update file offsets.
	* ld-spu/ovl.d: Likewise.
	* ld-spu/ovl1.d: Likewise.
2009-05-14 15:26:36 +00:00
Ulrich Weigand d342a8b157 * elf32-spu.c (spu_elf_relocate_section): Only encode overlay index
into addresses for relocation types that look at high bits.  Remove
	special handling of relocation overflow warnings.
2009-05-14 14:42:36 +00:00
Ulrich Weigand cc210763ce * elf32-spu.c (mark_functions_via_relocs): Handle cycles in the
control flow graph between fragments of a function.
2009-05-14 14:40:57 +00:00
Ulrich Weigand c1ea05bbe8 * elf32-spu.c (spu_elf_size_stubs): Even in software i-cache mode,
generate only a 16-byte .toe section.
	(spu_elf_build_stubs, spu_elf_auto_overlay): Likewise.
2009-05-14 14:39:04 +00:00
Alan Modra bbb0fc04cc bfd/
* 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 04:30:03 +00:00
Alan Modra 20a73664f2 daily update 2009-05-14 00:00:04 +00:00
Andrew Jenner 6e6718a332 * elf32-arm.c: Move sysdep.h to start of file. 2009-05-13 16:46:42 +00:00
Alan Modra 1cf2dab730 daily update 2009-05-13 00:00:04 +00:00
Alan Modra 17f2d84375 daily update 2009-05-12 00:00:39 +00:00
Alan Modra 77ae44b0d3 * elf32-spu.c (spu_elf_find_overlays): Don't use .ovl.init lma as
start of overlays.
	(spu_elf_build_stubs): Don't define __icache_tagbase.  Define
	__icache_tag_array and __icache_tag_array_size.
2009-05-11 09:40:52 +00:00
Alan Modra dbf32564ef daily update 2009-05-11 00:00:05 +00:00
Alan Modra 51408ec215 Remove unnecessary ATTRIBUTE_UNUSED 2009-05-10 23:33:50 +00:00
Alan Modra bd518e6be4 daily update 2009-05-10 00:00:09 +00:00
Alan Modra b6c7d02acd daily update 2009-05-08 00:00:08 +00:00
Alan Modra bbd50cf775 daily update 2009-05-07 00:00:04 +00:00
Alan Modra 1b7693e93f daily update 2009-05-06 00:00:05 +00:00
Paul Brook 2468f9c95d 2009-05-05 Paul Brook <paul@codesourcery.com>
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-05-05 14:18:30 +00:00
Christophe Lyon 738a79f669 2009-05-05 Christophe lyon <christophe.lyon@st.com>
bfd/
	* elf32-arm.c (DEF_STUBS): New helper define.
	(DEF_STUB): Likewise.
	(stub_def): New type.
	(stub_definitions): New array, containing stub template pointers
	and sizes.
	(arm_size_one_stub): Make use of stub_definitions.
2009-05-05 13:16:56 +00:00
Alan Modra c94a1f1e40 daily update 2009-05-05 00:00:04 +00:00
Dave Korn 09e2aba432 bfd/ChangeLog
* elflink.c (find_version_for_sym):  Remove from here, ...
	* linker.c (bfd_find_version_for_sym):  ... rename, replace
	here, make public and update all callers.
	* bfd-in2.h:  Regenerate.

ld/ChangeLog

	* NEWS:  Mention new feature.
	* ld.texinfo (--version-script):  Document extent of PE support.
	(WIN32):  Mention --version-script.  Extend auto-export description.
	* pe-dll.c (process_def_file):  Use version script info to filter
	symbols from auto-export.
	* testsuite/ld-pe/vers-script-1.d:  New file.
	* testsuite/ld-pe/vers-script-2.d:  New file.
	* testsuite/ld-pe/vers-script-3.d:  New file.
	* testsuite/ld-pe/vers-script-4.d:  New file.
	* testsuite/ld-pe/vers-script-1.ver:  New file.
	* testsuite/ld-pe/vers-script-2.ver:  New file.
	* testsuite/ld-pe/vers-script-3.ver:  New file.
	* testsuite/ld-pe/vers-script-4.ver:  New file.
	* testsuite/ld-pe/vers-script-dll.c:  New file.
	* testsuite/ld-pe/vers-script.exp:  New test script.
2009-05-04 12:09:30 +00:00
Alan Modra d067a4028a daily update 2009-05-04 00:00:05 +00:00
Alan Modra 00dad67c89 daily update 2009-05-03 00:00:05 +00:00
Alan Modra 01a1456581 daily update 2009-05-02 00:00:05 +00:00
Alan Modra 1ec7823fec daily update 2009-05-01 00:00:05 +00:00
Nick Clifton d8045f234d include/elf
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * common.h (STT_GNU_IFUNC): Define.

elfcpp
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * (enum STT): Add STT_GNU_IFUNC.

gas
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * config/obj-elf.c (obj_elf_type): Add support for a
        gnu_indirect_function type.
        * config/tc-i386.c (tc_i386_fix_adjustable): Do not adjust fixups
        against indirect function symbols.
        * doc/as.texinfo (.type): Document the support for the
        gnu_indirect_function symbol type.
        * NEWS: Mention the new feature.

gas/testsuite
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * gas/elf/elf.exp: Extend type test to include an ifunc symbol.
        Provide an alternative test for targets which do not support ifunc
        symbols.
        (type.s): Add entry for an ifunc symbol.
        (type.e): Add ifunc entry to expected symbol dump.
        (section2.e-armelf): Add  entry for ifunc symbol.
        (type-noifunc.s): New file.
        (type-noifunc.e): New file.

bfd/
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs
        section pointer.
        (struct elf_obj_data): Add has_ifunc_symbols boolean.
        * elf.c (swap_out_syms): Convert BSF_GNU_INDIRECT_FUNCTION flags
        into a STT_GNU_IFUNC symbol type.
        (_bfd_elf_is_function_type): Accept STT_GNU_IFUNC as a function
        type.
        (_bfd_elf_set_osabi): Set the osasbi field to ELFOSABI_LINUX if
        the binary contains ifunc symbols.
        * elfcode.h (elf_slurp_symbol_table): Translate the STT_GNU_IFUNC
        symbol type into a BSF_GNU_INDIRECT_FUNCTION flag.
        * elf32-i386.c (is_indirect_function): New function.
        (elf_i386_check_relocs): Create an ifunc output section.
        (allocate_dynrelocs): Create dynamic relocs in the ifunc output
        section if necessary.
        (elf_i386_relocate_section): Emit a reloc against an ifunc symbol
        if necessary.
        (elf_i386_add_symbol_hook): New function. Set the
        has_ifunc_symbols field of the elf_obj_data structure if an ifunc
        symbol is encountered.
        (elf_backend_post_process_headers): Define.
        (elf_backend_add_symbol_hook): Define.
        (elf_i386_post_process_headers): Rename to
        elf_i388_fbsd_post_process_headers.
        * elf64-x86_64.c (IS_X86_64_PCREL_TYPE): New macro.
        (is_indirect_function): New function.
        (elf64_x86_64_check_relocs): Create an ifunc output section.
        (allocate_dynrelocs): Create dynamic relocs in the ifunc output
        section if necessary.
        (elf64_x86_64_relocate_section): Emit a reloc against an ifunc
        symbol if necessary.
        (elf_i386_add_symbol_hook): Set the has_ifunc_symbols field of the
        elf_obj_data structure if an ifunc symbol is encountered.
        (elf_backend_post_process_headers): Define.
        * elflink.c (_bfd_elf_adjust_dynamic_symbol): Always create a PLT
        if we have ifunc symbols to handle.
        (get_ifunc_reloc_section_name): New function.  Computes the name
        for an ifunc section.
        (_bfd_elf_make_ifunc_reloc_section): New function.  Creates a
        section to hold ifunc relocs.
        * syms.c (BSF_GNU_INDIRECT_FUNCTION): Define.
        (bfd_print_symbol_vandf): Handle ifunc symbols.
        (bfd_decode_symclass): Likewise.
        * bfd-in2.h: Regenerate.

binutils
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * readelf.c (dump_relocations): Display a relocation against an
        ifunc symbol as if it were a function invocation.
        (get_symbol_type): Handle STT_GNU_IFUNC.

ld
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * NEWS: Mention support for IFUNC symbols.

ld/testsuite
2009-04-30  Nick Clifton  <nickc@redhat.com>

        * ld-ifunc: New directory.
        * ld-ifunc/ifunc.exp: New file: Run the IFUNC tests.
        * ld-ifunc/prog.c: New file.
        * ld-ifunc/lib.c: New file.
2009-04-30 15:47:13 +00:00
Joseph Myers 96c23d5966 bfd:
* elf32-arm.c (elf32_arm_check_relocs): Give errors for absolute
	MOVW and MOVT relocations in a shared library link.

ld/testsuite:
	* ld-arm/movw-shared-1.d, ld-arm/movw-shared-1.s,
	ld-arm/movw-shared-2.d, ld-arm/movw-shared-2.s,
	ld-arm/movw-shared-3.d, ld-arm/movw-shared-3.s,
	ld-arm/movw-shared-4.d, ld-arm/movw-shared-4.s: New tests.
	* ld-arm/arm-elf.exp: Run these new tests.
2009-04-30 00:01:11 +00:00
Alan Modra c60836bc08 daily update 2009-04-30 00:00:05 +00:00
Alan Modra 459ca30a77 daily update 2009-04-29 00:00:08 +00:00
Alan Modra 956a12433c daily update 2009-04-28 00:00:08 +00:00
Nick Clifton c067354b06 * verilog.c: New file.
* Makefile.am (BFD32_LIBS): Add verilog.c.
        (BFD32_LIBS_CFILES): Add verilog.c.
        (verilog.lo): New build rule.
        * Makefile.in: Rebuilt.
        * targets.c: Add verilog support.
        * bfd.c (tdata union): Add Verilog private data field.
        * bfd-in2.h: Regenerate.

        * bfdint.texi (BFD target vector miscellaneous): Mention verilog
        flavour.

        * NEWS: Mention verilog support added to bfd.
2009-04-27 14:27:36 +00:00
H.J. Lu 325c681d94 bfd/
2009-04-27  H.J. Lu  <hongjiu.lu@intel.com>

	* peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Don't
	copy pe_opthdr.

binutils/

2009-04-27  H.J. Lu  <hongjiu.lu@intel.com>

	* objcopy.c (copy_object): Copy pe_opthdr before changing PE
	parameters.
2009-04-27 13:59:43 +00:00
Alan Modra 23ed14e8cd daily update 2009-04-27 00:00:04 +00:00
Alan Modra a7a3d7b806 daily update 2009-04-26 00:00:05 +00:00
Alan Modra dc62663dd5 daily update 2009-04-25 00:00:05 +00:00
H.J. Lu 2e28a5fcdd Remove bfd/. 2009-04-24 20:28:22 +00:00
Alan Modra 745207a558 daily update 2009-04-24 00:00:09 +00:00
Dave Korn ba7758981e 2009-04-23 Matthias Klose <doko@ubuntu.com>
* bfd/peXXigen.c (_bfd_XXi_swap_sym_in): Initialize `name'.
2009-04-23 13:36:43 +00:00
Alan Modra 99bf7bbe77 daily update 2009-04-23 00:00:10 +00:00
Christophe Lyon 155d87d738 2009-04-22 Christophe Lyon <christophe.lyon@st.com>
PR9743
	bfd/
	* elf32-arm.c (arm_type_of_stub): Handle R_ARM_THM_JUMP24,
	R_ARM_JUMP24 and R_ARM_PLT32 relocations.
	(elf32_arm_size_stubs): Likewise.
	(record_thumb_to_arm_glue): Deleted unused function.
	(bfd_elf32_arm_process_before_allocation): No longer handle
	R_ARM_THM_JUMP24, R_ARM_JUMP24 and R_ARM_PLT32 relocations here.
	(elf32_arm_final_link_relocate): Handle R_ARM_THM_JUMP24,
	R_ARM_JUMP24 and R_ARM_PLT32 relocations.

	testsuite/
	* ld-arm/arm-call.d: Update expected result.
	* ld-arm/arm-pic-veneer.d: Likewise.
	* ld-arm/thumb2-b-interwork.d: Likewise.
2009-04-22 14:01:31 +00:00
Alan Modra c8f5dc0dcb daily update 2009-04-22 00:00:04 +00:00
Daniel Jacobowitz 3e6b10420e bfd/
* 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-21 22:05:04 +00:00
H.J. Lu 4f3607846c 2009-04-21 H.J. Lu <hongjiu.lu@intel.com>
* coff-ia64.c (COFF_PAGE_SIZE): Changed to 8K.

	* coffcode.h (coff_compute_section_file_positions): Clear
	D_PAGED if PE section alignment is smaller than COFF_PAGE_SIZE.

	* libcoff-in.h (pe_tdata): Remove force_minimum_alignment and
	force_minimum_alignment.

	* libcoff.h: Regenerated.

	* pei-ia64.c (PEI_TARGET_SUBSYSTEM): Removed.
	(PEI_FORCE_MINIMUM_ALIGNMENT): Likewise.

	* peicode.h (pe_mkobject): Don't set force_minimum_alignment
	nor target_subsystem.

	* peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't check
	force_minimum_alignment nor target_subsystem.
2009-04-21 17:08:20 +00:00
Dave Korn e48570bbf8 bfd/ChangeLog
2009-04-21  Kai Tietz  <kai.tietz@onevision.com>

	* coff-x86_64.c (PEI_HEADERS): Protect includes.
	(bfd_pe_print_pdata): Remove #ifdef PE variation.
	* pei-x86_64.c (PEI_HEADERS): Define to prevent double
	include in coff-x86_64.c of headers.
	(PDATA_ROW_SIZE): New define.
	(pex_regs[]): New static array.
	(pex64_get_runtime_function): New static function.
	(pex64_get_unwind_info): Likewise.
	(pex64_get_scope_entry): Likewise.
	(pex64_xdata_print_uwd_codes): Likewise.
	(pep_get_section_by_rva): Likewise.
	(pex64_dump_xdata): Likewise.
	(pex64_bfd_print_pdata): Likewise.
	(bfd_pe_print_pdata): Define as pex64_bfd_print_pdata.
	* peXXigen.c (_bfd_pex64_print_pdata): Removed implementation.
	* libpei.h (_bfd_pex64_print_pdata): Removed declaration.

include/ChangeLog

2009-04-21  Kai Tietz  <kai.tietz@onevision.com>

	* coff/pe.h (pex64_runtime_function): New structure.
	(external_pex64_runtime_function): Likewise.
	(pex64_unwind_code): Likewise.
	(external_pex64_unwind_code): Likewise.
	(pex64_unwind_info): Likewise.
	(external_pex64_unwind_info): Likewise.
	(external_pex64_scope): Likewise.
	(pex64_scope): Likewise.
	(pex64_scope_entry):  Likewise.
	(external_pex64_scope_entry): Likewise.
	(PEX64_IS_RUNTIME_FUNCTION_CHAINED): New macro.
	(PEX64_GET_UNWINDDATA_UNIFIED_RVA): Likewise.
	(PEX64_UNWCODE_CODE): Likewise.
	(PEX64_UNWCODE_INFO): Likewise.
	(UWOP_...): Add defines for unwind code.
	(UNW_FLAG_...): Add defined for unwind info flags.
	(PEX64_SCOPE_ENTRY_SIZE): New macro.
	(PEX64_UWI_VERSION): Likewise.
	(PEX64_UWI_FLAGS): Likewise.
	(PEX64_UWI_FRAMEREG): Likewise.
	(PEX64_UWI_FRAMEOFF): Likewise.
	(PEX64_UWI_SIZEOF_UWCODE_ARRAY): Likewise.
	(PEX64_OFFSET_TO_UNWIND_CODE): Likewise.
	(PEX64_OFFSET_TO_HANDLER_RVA): Likewise.
	(PEX64_OFFSET_TO_SCOPE_COUNT): Likewise.
	(PEX64_SCOPE_ENTRY): Likewise.
2009-04-21 02:13:48 +00:00
Alan Modra bc7cff159d daily update 2009-04-21 00:00:04 +00:00
Alan Modra 383c383f84 2009-04-19 Peter O'Gorman <binutils@mlists.thewrittenword.com>
Alan Modra  <amodra@bigpond.net.au>
            Dave Korn  <dave.korn.cygwin@gmail.com>

	* peXXigen.c (_bfd_XXi_swap_sym_in): Fix name handling w.r.t
	long names and non-NUL-terminated strings.
2009-04-20 01:09:43 +00:00
Alan Modra 4483bce5a9 daily update 2009-04-20 00:00:04 +00:00
Alan Modra be2af7510d daily update 2009-04-19 00:00:05 +00:00
Alan Modra aa6c14f1ec daily update 2009-04-18 00:00:05 +00:00
H.J. Lu b6b450f1e8 2009-04-17 H.J. Lu <hongjiu.lu@intel.com>
* bfd-in2.h: Regenerated.
2009-04-17 22:50:18 +00:00
H.J. Lu d911860251 bfd/
2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>

	* peXXigen.c (_bfd_XX_print_private_bfd_data_common): Replace
	IMAGE_SUBSYSTEM_EFI_ROM with IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER.

binutils/

2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>

	* objcopy.c (set_pe_subsystem): Replace efi-rom with sal-rtd.
	* doc/binutils.texi: Likewise.

include/coff/

2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>

	* pe.h (IMAGE_SUBSYSTEM_EFI_ROM): Renamed to ...
	(IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER): This.
2009-04-17 15:03:48 +00:00
H.J. Lu 92dd451149 bfd/
2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/10074
	* coffcode.h (bfd_pei_p): New.

	* config.bfd: Remove bfd_efi_bsdrv_ia32_vec,
	bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec,
	bfd_efi_rtdrv_x86_64_vec, bfd_efi_bsdrv_ia64_vec and
	bfd_efi_rtdrv_ia64_vec.  Replace bfd_efi_app_ia32_vec,
	bfd_efi_app_x86_64_vec and bfd_efi_app_ia64_vec with
	i386pei_vec, x86_64pei_vec and bfd_pei_ia64_vec, respectively.

	* configure.in: Remove bfd_efi_bsdrv_ia32_vec,
	bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec,
	bfd_efi_rtdrv_x86_64_vec,
	bfd_efi_bsdrv_ia64_vec and bfd_efi_rtdrv_ia64_vec.  Replace
	bfd_efi_ia64_vec with bfd_pei_ia64_vec.
	* targets.c: Likewise.

	* configure: Regenerated.
	* libcoff.h: Likewise.
	* Makefile.in: Likewise.

	* efi-app-ia32.c: Removed.
	* efi-app-x86_64.c: Likewise.
	* efi-bsdrv-ia32.c: Likewise.
	* efi-bsdrv-ia64.c: Likewise.
	* efi-bsdrv-x86_64.c: Likewise.
	* efi-rtdrv-ia32.c: Likewise.
	* efi-rtdrv-ia64.c: Likewise.
	* efi-rtdrv-x86_64.c: Likewise.
	* efi-rtdrv-ia32.c: Likewise.

	* efi-app-ia64.c: Moved to ...
	* pei-ia64.c: This.
	(TARGET_SYM): Set to bfd_pei_ia64_vec.
	(TARGET_NAME): Set to pei-ia64.

	* libpei.h (bfd_target_pei_p): Removed.
	(bfd_target_pei_arch): Likewise.
	(bfd_target_efi_app_p): Likewise.
	(bfd_target_efi_app_arch): Likewise.
	(bfd_target_efi_bsdrv_p): Likewise.
	(bfd_target_efi_bsdrv_arch): Likewise.
	(bfd_target_efi_rtdrv_p): Likewise.
	(bfd_target_efi_rtdrv_arch): Likewise.
	(bfd_pe_executable_p): Likewise.

	* Makefile.am (BFD32_BACKENDS): Remove efi-app-ia32.lo,
	efi-bsdrv-ia32.lo and efi-rtdrv-ia32.lo.
	(BFD32_BACKENDS_CFILES): Remove efi-app-ia32.c, efi-bsdrv-ia32.c
	and efi-rtdrv-ia32.c.
	(BFD64_BACKENDS): Remove efi-app-ia64.lo, efi-bsdrv-ia64.lo,
	efi-rtdrv-ia64.lo, efi-app-x86_64.lo, efi-bsdrv-x86_64.lo and
	efi-rtdrv-x86_64.lo. Add pei-ia64.lo.
	(BFD64_BACKENDS_CFILES): Remove efi-app-ia64.c, efi-bsdrv-ia64.c,
	efi-rtdrv-ia64.c, efi-app-x86_64.c, efi-bsdrv-x86_64.c and
	efi-rtdrv-x86_64.c. Add pei-ia64.c.
	(efi-app-ia64.lo): Removed.
	(efi-bsdrv-ia32.lo): Likewise.
	(efi-rtdrv-ia32.lo): Likewise.
	(efi-app-ia64.lo): Likewise.
	(efi-bsdrv-ia64.lo): Likewise.
	(efi-rtdrv-ia64.lo): Likewise.
	(efi-app-x86_64.lo): Likewise.
	(efi-bsdrv-x86_64.lo): Likewise.
	(efi-rtdrv-x86_64.lo): Likewise.
	(pei-ia64.lo): New.

	* peicode.h (coff_swap_scnhdr_in): Replace bfd_pe_executable_p
	with bfd_pei_p.
	(arch_type): Removed.
	(pe_arch): Likewise.
	(pe_bfd_object_p): Just return coff_object_p.

	* peXXigen.c (_bfd_XXi_swap_scnhdr_out): Replace
	bfd_pe_executable_p with bfd_pei_p.

binutils/

2009-04-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/10074
	* objcopy.c: Include coff/i386.h and coff/pe.h.
	(pe_file_alignment): New.
	(pe_heap_commit): Likewise.
	(pe_heap_reserve): Likewise.
	(pe_image_base): Likewise.
	(pe_section_alignment): Likewise.
	(pe_stack_commit): Likewise.
	(pe_stack_reserve): Likewise.
	(pe_subsystem): Likewise.
	(pe_major_subsystem_version): Likewise.
	(pe_minor_subsystem_version): Likewise.
	(set_pe_subsystem): Likewise.
	(convert_efi_target): Likewise.
	(command_line_switch): Add OPTION_FILE_ALIGNMENT,
	OPTION_HEAP, OPTION_IMAGE_BASE, OPTION_SECTION_ALIGNMENT,
	OPTION_STACK and OPTION_SUBSYSTEM.
	(copy_options): Likewise.
	(copy_usage): Add --file-alignment, --heap, --image-base,
	--section-alignment, --stack and --subsystem.
	(copy_object): Set up PE parameters.
	(copy_main): Process Add OPTION_FILE_ALIGNMENT,
	OPTION_HEAP, OPTION_IMAGE_BASE, OPTION_SECTION_ALIGNMENT,
	OPTION_STACK and OPTION_SUBSYSTEM.   Convert EFI target to
	PEI target.

	* NEWS: Mention --file-alignment, --heap, --image-base,
	--section-alignment, --stack and --subsystem command line
	options for objcopy.

	* doc/binutils.texi: Document --file-alignment, --heap,
	--image-base, --section-alignment, --stack and --subsystem
	command line options for objcopy.
2009-04-17 13:46:18 +00:00
Christophe Lyon 69c5861ee1 2009-04-17 Christophe Lyon <christophe.lyon@st.com>
bfd/
	* elf32-arm.c (elf32_arm_size_stubs): Handle long branches through
	PLT entries to an undefined symbol when generating a shared
	library.

	testsuite/
	* ld-arm/arm-elf.exp: Add new test farcall-mixed-lib.
	* ld-arm/farcall-mixed-lib.d: Update expected output.
	* ld-arm/farcall-mixed-lib1.s: New file.
	* ld-arm/farcall-mixed-lib2.s: New file.
2009-04-17 13:04:41 +00:00
Nick Clifton e9cd066073 PR 9909
* coffcode.h (handle_COMDAT): Allow for external COMDAT symbols.
        [delta to coffcode.h accidentally committed with a previous patch]
2009-04-17 12:08:10 +00:00
Alan Modra f756c6b1d7 daily update 2009-04-17 00:00:05 +00:00
Richard Sandiford 3023e3f66a bfd/
* aout-adobe.c (aout_32_bfd_define_common_symbol): Define.
	* aout-target.h (MY_bfd_define_common_symbol): Likewise.
	* aout-tic30.c (MY_bfd_define_common_symbol): Likewise.
	* binary.c (binary_bfd_define_common_symbol): Likewise.
	* bout.c (b_out_bfd_define_common_symbol): Likewise.
	* coff-alpha.c (_bfd_ecoff_bfd_define_common_symbol): Likewise.
	* coff-mips.c (_bfd_ecoff_bfd_define_common_symbol): Likewise.
	* coffcode.h (coff_bfd_define_common_symbol): Likewise.
	* elfxx-target.h (bfd_elfNN_bfd_define_common_symbol): Likewise.
	* i386msdos.c (msdos_bfd_define_common_symbol): Likewise.
	* i386os9k.c (os9k_bfd_define_common_symbol): Likewise.
	* ieee.c (ieee_bfd_define_common_symbol): Likewise.
	* ihex.c (ihex_bfd_define_common_symbol): Likewise.
	* libbfd-in.h (_bfd_nolink_bfd_define_common_symbol): Likewise.
	* mach-o.c (bfd_mach_o_bfd_define_common_symbol): Likewise.
	* mmo.c (mmo_bfd_define_common_symbol): Likewise.
	* nlm-target.h (nlm_bfd_define_common_symbol): Likewise.
	* oasys.c (oasys_bfd_define_common_symbol): Likewise.
	* pef.c (bfd_pef_bfd_define_common_symbol): Likewise.
	* ppcboot.c (ppcboot_bfd_define_common_symbol): Likewise.
	* som.c (som_bfd_define_common_symbol): Likewise.
	* srec.c (srec_bfd_define_common_symbol): Likewise.
	* tekhex.c (tekhex_bfd_define_common_symbol): Likewise.
	* versados.c (versados_bfd_define_common_symbol): Likewise.
	* vms.c (vms_bfd_define_common_symbol): Likewise.
	* xcoff-target.h (_bfd_xcoff_bfd_define_common_symbol): Likewise.
	* xsym.c (bfd_sym_bfd_define_common_symbol): Likewise.
	* coff-rs6000.c (rs6000coff_vec): Add _bfd_xcoff_define_common_symbol.
	(pmac_xcoff_vec): Likewise.
	* coff64-rs6000.c (rs6000coff64_vec): Likewise.
	(aix5coff64_vec): Likewise.
	* linker.c (bfd_generic_define_common_symbol): New function.
	* targets.c (BFD_JUMP_TABLE_LINK): Add NAME##_bfd_define_common_symbol.
	(_bfd_define_common_symbol): New field.
	* libcoff-in.h (_bfd_xcoff_define_common_symbol): Declare.
	* xcofflink.c (_bfd_xcoff_define_common_symbol): New function.
	(xcoff_build_ldsyms): Don't set XCOFF_DEF_REGULAR for common
	symbols here.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Likewise.
	* libcoff.h: Likewise.

ld/
	* ldlang.c (lang_one_common): Use bfd_define_common_symbol.

ld/testsuite/
	* ld-powerpc/aix-export-2.s, ld-powerpc/aix-export-2.nd: New test.
	* ld-powerpc/aix52.exp: Run it.
2009-04-16 23:07:00 +00:00
Nick Clifton 20135e4cea Add new binutils target: moxie 2009-04-16 15:39:48 +00:00
Alan Modra 842f00eea9 daily update 2009-04-16 00:00:05 +00:00
Christophe Lyon 82b5c97a79 2009-04-15 Christophe Lyon <christophe.lyon@st.com>
bfd/
	* elf32-arm.c (elf32_arm_final_link_relocate): Don't convert ARM
	branch to an undef weak symbol into a jump to next instruction if
	a PLT entry will be created.

	testsuite/
	* ld-arm/arm-elf.exp: Add 1 more test to check undef weak
	reference with PLT in ARM mode.
	* ld-arm/thumb2-bl-undefweak1.d, ld-arm/thumb2-bl-undefweak1.s:
	New files.
2009-04-15 13:49:54 +00:00
Alan Modra 93af4360e4 daily update 2009-04-15 01:00:04 +00:00
Dave Korn 0408dee693 bfd/ChangeLog
* coffgen.c (make_a_section_from_file):  Set the backend long
	section names enable if long section names found on input.
	* coffcode.h:  Extend long section names documentation to match.

binutils/ChangeLog

	* objcopy.c (enum long_section_name_handling):  New enum type.
	(enum command_line_switch):  Add OPTION_LONG_SECTION_NAMES.
	(copy_options[]):  Add entry for --long-section-names option.
	(copy_usage):  Document it.
	(set_long_section_mode):  New subroutine.
	(copy_file):  Call it.
	(copy_main):  Accept OPTION_LONG_SECTION_NAMES and parse arg.
	* doc/binutils.texi:  Update objcopy documentation with details
	of new option.
2009-04-14 09:47:44 +00:00
Alan Modra 5171a1d110 daily update 2009-04-14 01:00:05 +00:00
Alan Modra 2e80c30680 daily update 2009-04-13 01:00:05 +00:00
Alan Modra 3c34593a24 daily update 2009-04-12 01:00:05 +00:00
Alan Modra ae50636032 daily update 2009-04-11 01:00:04 +00:00
Alan Modra ea6906eee3 daily update 2009-04-10 01:00:05 +00:00
Alan Modra b08bbc4b81 daily update 2009-04-09 01:00:04 +00:00
H.J. Lu a0c402a564 bfd/
2009-04-08  H.J. Lu  <hongjiu.lu@intel.com>

	* elflink.c (elf_link_add_object_symbols): Warn alternate ELF
	machine code.

include/

2009-04-08  H.J. Lu  <hongjiu.lu@intel.com>

	* bfdlink.h (bfd_link_info): Add warn_alternate_em.

ld/

2009-04-08  H.J. Lu  <hongjiu.lu@intel.com>

	* lexsup.c (option_values): Add OPTION_WARN_ALTERNATE_EM.
	(ld_options): Likewise.
	(parse_args): Likewise.

	* ld.texinfo: Document --warn-alternate-em.

	* NEWS: Mention --warn-alternate-em.
2009-04-08 16:04:50 +00:00
DJ Delorie 4d28413b40 [include/elf]
* mep.h (EF_MEP_CPU_C5): New.
[bfd]
	* archures.c: Add bfd_mach_mep_c5.
	* bfd-in2.h: Likewise.
	* cpu-mep.c: Add bfd_c5_arch.
	* elf32-mep.c: Support it.
[gas]
	* config/tc-mep.c: Add UCI/DSP instruction support.  Add C5 support.
	(md_show_usage): Change default endian to little.
	* config/tc-mep.h (TARGET_BYTES_BIG_ENDIAN): Change default to little.
[ld]
	* emulparams/elf32mep.sh: Change default endian to little.
2009-04-08 02:24:23 +00:00
Alan Modra e0edc2d941 daily update 2009-04-08 01:00:09 +00:00
H.J. Lu bb6198d224 2009-04-07 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (_bfd_elf_section_already_linked): Add `\n' for
	info->callbacks->einfo.
	* linker.c (_bfd_generic_section_already_linked): Likewise.
2009-04-07 20:04:08 +00:00
DJ Delorie bcb012d3f5 [bfd]
* elf32-h8300.c (elf32_h8_relax_section): Relax MOVA opcodes.
[gas]
	* tc-h8300.c (do_a_fix_imm): Pass the insn, force relocs for MOVA
	immediates.
	(build_bytes): Pass insn to do_a_fix_imm.
[include/opcode]
	* h8300.h: Add relaxation attributes to MOVA opcodes.
2009-04-07 18:21:22 +00:00
Alan Modra d28e2c2419 daily update 2009-04-07 01:00:05 +00:00
H.J. Lu db1fe6e9e5 2009-04-06 H.J. Lu <hongjiu.lu@intel.com>
* coff-x86_64.c (bfd_pe_print_pdata): Defined to
	_bfd_pex64_print_pdata only if PE is defined.

	* libpei.h (_bfd_pep_print_x64_pdata): Renamed to ...
	(_bfd_pex64_print_pdata): This.

	* peXXigen.c (_bfd_pep_print_x64_pdata): Renamed to ...
	(_bfd_pex64_print_pdata): This.  Defined only if COFF_WITH_pex64
	is defined.
2009-04-06 16:48:36 +00:00
Alan Modra 35d35f1f4e daily update 2009-04-06 01:00:05 +00:00
Kai Tietz c7c7219d3a 2009-04-05 Kai Tietz <kai.tietz@onevision.com>
* coff-x86_64.c (bfd_pe_print_pdata): Define as
        _bfd_pep_print_x64_pdata.
        * libpei.h (_bfd_pep_print_x64_pdata): Add prototype.
        * peXXigen.c (_bfd_pep_print_x64_pdata): New.
2009-04-05 18:12:21 +00:00
Alan Modra bab7ee3b35 daily update 2009-04-05 01:00:05 +00:00
Alan Modra c38faaf736 daily update 2009-04-04 00:00:05 +00:00
Sterling Augustine 3df502ae79 2009-04-02 Sterling Augustine <sterling@jaw.hq.tensilica.com>
* elf32-xtensa.c (relax_property_section): Always set r_offset
	to zero.
2009-04-03 16:06:40 +00:00
Alan Modra 41c7472acd daily update 2009-04-03 00:00:05 +00:00
Christophe Lyon d3626fb08b 2009-04-02 Christophe Lyon <christophe.lyon@st.com>
bfd/
	* elf32-arm.c (elf32_arm_stub_long_branch_v4t_thumb_thumb,
	elf32_arm_stub_long_branch_v4t_thumb_thumb_pic): Two new long
	branch stubs.
	(elf32_arm_stub_type): New enum values for the two new stubs.
	(arm_type_of_stub): Make use of the two new stubs.
	(arm_size_one_stub): Handle the two new stubs.

	testsuite/
	* ld-arm/farcall-thumb-thumb-pic-veneer.d: Update expected
	results.
	* ld-arm/farcall-thumb-thumb.d: Likewise.
2009-04-02 14:12:46 +00:00
Matt Thomas fe723c8722 2009-04-01 Matt Thomas <matt@netbsd.org>
* elf32-vax.c (elf_vax_check_relocs): Do not put relocations against
	hidden symbols into the GOT or PLT.GOT.
	(elf_vax_relocate_section): Do not emit a PCREL reloc
	into a shared object if it is against a hidden symbol.
2009-04-02 00:20:42 +00:00
Alan Modra 9ad7ca0088 daily update 2009-04-02 00:00:08 +00:00
Richard Sandiford ee69830047 bfd/
* xcofflink.c (xcoff_archive_info): Add contains_shared_object_p
	and know_contains_shared_object_p.
	(xcoff_archive_contains_shared_object_p): Add an "info" parameter.
	Cache the result in the archive_info table.
	(xcoff_auto_export_p): Add an "info" parameter and update the
	call to xcoff_archive_contains_shared_object_p.
	(xcoff_mark_auto_exports): Update accordingly.
	(xcoff_post_gc_symbol): Likewise.
2009-04-01 20:13:10 +00:00
Richard Sandiford 54e2dbe0fc bfd/
* xcofflink.c (bfd_link_input_bfd): Treat __rtinit as C_HIDEXT
	rather than C_EXT.

ld/testsuite/
	* ld-powerpc/aix-gc-1.nd: New test.
	* ld-powerpc/aix52.exp: Run it.
2009-04-01 20:09:03 +00:00
Richard Sandiford 2e470849cc bfd/
* coff-rs6000.c (member_layout): New structure.
	(archive_iterator): Likewise.
	(member_layout_init): New function.
	(archive_iterator_begin): Likewise.
	(archive_iterator_next): Likewise.
	(xcoff_write_armap_old): Use the new iterator functions.
	(do_shared_object_padding): Delete.
	(xcoff_write_armap_big): Use the new iterator functions.  Simplify
	handling of arch_info.
	(xcoff_write_archive_contents_old): Allocate arelt_data in the
	first loop rather than the second.  Allocate a member header if
	there isn't one, then work out the stat information and length
	in the first loop too.  Use the new iterators for the second loop.
	(xcoff_write_archive_contents_big): Likewise.
2009-04-01 20:04:28 +00:00
Richard Sandiford 24c611d1c4 bfd/
* 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-04-01 19:53:53 +00:00
Richard Sandiford d286971a6b include/coff/
* xcoff.h (xcoff_link_hash_table): Move to bfd/xcofflink.c.

bfd/
	* xcofflink.c (xcoff_link_hash_table): Moved from include/coff/xcoff.h.
2009-04-01 19:38:11 +00:00
Richard Sandiford b3d1832c34 bfd/
* xcofflink.c (xcoff_link_create_extra_sections): Don't create
	a .loader section for relocatable links.
	(xcoff_need_ldrel_p): New function.
	(xcoff_mark): Use it.
	(bfd_xcoff_link_count_reloc): Only count loader relocs if there's
	a loader section.
	(xcoff_build_ldsym): New function, split out from...
	(xcoff_build_ldsyms): ...here.  Rename to...
	(xcoff_post_gc_symbol): ...this.  Only export symbols, and only
	call xcoff_build_ldsym, if there's a loader section.
	(xcoff_build_loader_section): New function, extracted verbatim from...
	(bfd_xcoff_size_dynamic_sections): ...here.  Only call it if
	there's a loader section.  Only add an __rtinit loader symbol
	if there's a loader section.  Update after above name change.
	(xcoff_symbol_section, xcoff_create_ldrel): New functions.
	(bfd_link_input_bfd): Use xcoff_need_ldrel_p, xcoff_symbol_section
	and xcoff_create_ldrel.
	(xcoff_write_global_symbol): Use xcoff_create_ldrel.
	(xcoff_reloc_link_order): Likewise, but only call it if there's
	a loader section.  Use xcoff_symbol_section.
	(_bfd_xcoff_bfd_final_link): Only use fdinfo.ldrel and fdinfo.ldsym
	if there's a loader section.

ld/testsuite/
	* ld-powerpc/aix-rel-1.s, ld-powerpc/aix-rel-1.od: New test.
	* ld-powerpc/aix52.exp: Run it.
2009-04-01 19:27:38 +00:00
Richard Sandiford 8707bb8715 bfd/
* xcofflink.c (bfd_link_input_bfd): Fix buffer overrun.
2009-04-01 19:05:53 +00:00
Christophe Lyon e780aef286 2009-04-01 Christophe Lyon <christophe.lyon@st.com>
bfd/
	* elf32-arm.c (group_sections): Rewrite loops for better
	readability.
2009-04-01 15:34:12 +00:00
Alan Modra a54217b469 daily update 2009-04-01 00:00:04 +00:00
DJ Delorie c301e70067 * elflink.c (elf_link_input_bfd): Don't try to resolve complex
relocs when doing a relocatable link.
2009-03-31 01:42:29 +00:00
Alan Modra 4a19ce7eb9 daily update 2009-03-31 00:00:09 +00:00
Alan Modra 3d474056d3 daily update 2009-03-30 00:00:05 +00:00
Alan Modra f6bd35909f daily update 2009-03-29 00:00:06 +00:00
Mark Mitchell 3895f85287 * coff-arm.c (coff_arm_merge_private_bfd_data): Use "error:", not
"ERROR:", in error messages.
	* cpu-arm.c (bfd_arm_merge_machines): Likewise.
	* elf-attrs.c (_bfd_elf_merge_object_attributes): Likewise.
	* elf32-arm.c (tag_cpu_arch_combine): Likewise.
	(elf32_arm_merge_eabi_attributes): Likewise.
	(elf32_arm_merge_private_bfd_data): Likewise.
2009-03-28 23:19:00 +00:00
Alan Modra 4af38be89b daily update 2009-03-28 00:00:05 +00:00
Nick Clifton ea882e8744 * section.c (bfd_get_section_contents): Detect and handle the case
where a section has the SEC_IN_MEMORY flag set but no actual
        contents allocated.
2009-03-27 11:38:30 +00:00
Alan Modra cafcb80735 daily update 2009-03-27 00:00:10 +00:00
Alan Modra 9433b9b16e PR 6494
* elf.c (copy_elf_program_header): Do not check that PT_GNU_RELRO
	p_filesz and p_memsz are equal.  Use p_memsz as the segment size.
	(assign_file_positions_for_non_load_sections): Zap PT_GNU_RELRO
	if we don't find matching PT_LOAD when copying.
2009-03-26 12:23:52 +00:00
Alan Modra b7ab523c0d daily update 2009-03-26 00:00:04 +00:00
M R Swami Reddy dc1aa7347f 2009-03-25 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
* elf32-crx.c (crx_elf_howto_table): Zero the src_mask field of
        the reloc descriptions.
2009-03-25 08:08:36 +00:00
M R Swami Reddy 3614d36bc7 2009-03-25 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
* elf32-crx.c (crx_elf_howto_table): Zero the src_mask field of
	the reloc descriptions.
2009-03-25 08:05:57 +00:00
Hans-Peter Nilsson 34d3d6b922 * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_32_GD>
<R_CRIS_16_GOT_GD, case R_CRIS_32_GOT_GD>: Handle COMMON symbols.
	<case R_CRIS_16_TPREL, R_CRIS_32_TPREL>: Ditto.
2009-03-25 03:03:40 +00:00
Alan Modra b5fe7cfc58 daily update 2009-03-25 00:00:09 +00:00
H.J. Lu 34274ccc6a 2009-03-24 H.J. Lu <hongjiu.lu@intel.com>
* cpu-i386.c (bfd_x86_64_arch_intel_syntax): Make it static.
	(bfd_i386_arch_intel_syntax): Likewise.
	(i8086_arch): Likewise.
	(bfd_x86_64_arch): Likewise.
2009-03-24 18:07:14 +00:00
Hans-Peter Nilsson 6718f446da * elf32-cris.c (cris_elf_relocate_section): <case
R_CRIS_16_DTPREL, R_CRIS_32_DTPREL>: Allow use of non-local
	symbols for non-allocated sections.  Don't check whether to
	generate R_CRIS_DTPMOD for non-allocated sections.
	(cris_elf_gc_sweep_hook) <case R_CRIS_32_DTPREL>: Don't
	handle relocation GC:ing if applied to non-allocated section.
	(cris_elf_check_relocs): Similar.
2009-03-24 07:57:21 +00:00