Commit Graph

266 Commits

Author SHA1 Message Date
Nick Clifton ea5cae92bd * script-sections.cc(class Memory_region): Remove
current_lma_offset_ field.  Rename current_vma_offset_ to
        current_offset_.  Add last_section_ field.
        (Memory_region::get_current_vma_address): Rename to
        get_current_address.
        (Memory_region::get_current_lma_address): Delete.
        (Memory_region::increment_vma_offset): Rename to
        increment_offset.
        (Memory_region::increment_lma_offset): Delete.
        (Memory_region::attributes_compatible): New method.  Returns
        true if the provided section is compatible with the region.
        (Memory_region::get_last_section): New method.  Returns the last
        section to use the region.
        (Memory_region::set_last_section): New method.  Stores the last
        section to use the region.
        (Script_sections::block_in_region): New method.  Returns true if
        a block of memory is contained within a region.
        (Script_sections::find_memory_region): New method.  Locates a
        memory region to be used to set a VMA or LMA address.
        (Output_section_definition::set_section_addresses): Add code to
        check for addresses set by memory regions.
        (Output_segment::set_section_addresses): Remove memory region
        walking code.
        (Script_sections::create_segment): Add a warning if a header
        segment is created outside of any region.
        * script-sections.h (class Script_sections): Add prototypes for
        find_memory_region and block_in_region methods.
        * testsuite/memory_test.s: Use .long instead of .word.
        * testsuite/memory_test.t: Add some more output sections.
        * testsuite/memory_test.sh: Update expected output.

        * ld.texinfo: Update description of computation of VMA and LMA
        addresses for output sections.

        * ld-scripts/rgn-at5.t: Add some more output sections.
        * ld-scripts/rgn-at5.d: Update expected output.
2010-10-06 08:58:59 +00:00
Alan Modra abf4be64df PR ld/12066
* ldexp.c (fold_name): Treat absolute symbols as plain numbers.
	* ld.texinfo (Expression Section): Don't say absolute symbols
	are addresses.
2010-10-01 08:15:42 +00:00
Alan Modra 2e76e85a38 bfd/
* elf.c (bfd_elf_get_default_section_type): Don't test SEC_NEVER_LOAD.
	* elflink.c (elf_link_input_bfd): Likewise.
ld/
	* ld.texinfo (NOLOAD): Do not erroneously state that contents will
	appear in output file.
	* ldlang.c (lang_add_section): Clear SEC_HAS_CONTENTS on noload
	unless SEC_COFF_SHARED_LIBRARY.
	(map_input_to_output_sections): Don't set SEC_HAS_CONTENTS for noload
	output sections.
	(lang_size_sections_1): Don't test SEC_NEVER_LOAD when deciding
	to update dot in region.  Ditto when setting SEC_ALLOC if dot
	advanced due to assignment.
	* ldwrite.c (build_link_order): Don't test SEC_NEVER_LOAD.
2010-09-16 00:06:12 +00:00
Nick Clifton c09e9a8c9e * ld.texinfo (MEMORY): Clarify the behaviour of the ! character in
a region's attributes.
2010-08-31 10:26:11 +00:00
Alan Modra 7542af2ae8 binutils/
* NEWS: Mention change in linker script expression evaluation.
ld/
	* ld.texinfo (Expression Section): Detail expression evaluation.
	(Builtin Functions <ADDR>): Correct.
	(Builtin Functions <LOADADDR>): Don't mention LOADADDR normally
	the same as ADDR.
	(Builtin Functions <SEGMENT_START>): Typo fix.
	* ldexp.c (new_number): New function.
	(make_abs, exp_get_abs_int): Cope with NULL expld.result.section.
	(fold_unary <'~', '!', '-'>): Don't make_abs.
	(fold_binary): Simplify result section logic.  Return NULL section
	for logical ops.
	(fold_binary <SEGMENT_START>): Use new_rel_from_abs to set value to
	a consistent result.
	(fold_name <SIZEOF_HEADERS>): Return new_number, not new_abs.
	(fold_name <DEFINED, SIZEOF, ALIGNOF, LENGTH, CONSTANT>): Likewise.
	(fold_name <NAME>): No need to handle absolute symbols differently
	from relative ones.
	(fold_name <ORIGIN>): Don't return valid result when
	lang_first_phase_enum.  Return new_rel_from_abs, not new_abs.
	(exp_fold_tree_1 <etree_value>): Return new_number, not new_rel.
	(exp_fold_tree_1): Ajust for NULL expld.result.section.  When assigning
	a plain number to dot, assume the value is relative to expld.section.
	Make terms not in an output section, absolute.
	* ldlang.c (print_assignment): Fix style nit.
	(lang_size_sections_1): Cope with NULL expld.result.section.
	(lang_do_assignments_1): Likewise.
ld/testsuite/
	* ld-scripts/memory.t: Remove ORIGIN fudge.
2010-08-19 05:51:50 +00:00
Mike Frysinger bb1515f254 ld: improve linker script section
The example version script in the manual currently suggests:
	extern "C++" { "int f(int, double)"; }

But a C++ function like that doesn't encode the return type into the
mangled  name, so when the linker demangles things, it ends up with
"f(int, double)"  and so it never matches.

The example also lacks a trailing semicolon after the brace, so the
linker always complains about a syntax error in the file.

While the language section documents the possibilities, it isn't clear
as to which is the default language.  So explicitly state that the C
language is the default.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-07-20 19:25:42 +00:00
Nick Clifton 9fbcbd8145 etc/ChangeLog
* standards.texi: Relicense under GFDL v1.3.
        * fdl.texi: Replace with v1.3 text.

gas/ChangeLog

        * doc/as.texinfo: Replace abbreviated 20th century year numbers
        with full versions.

gprof/ChangeLog

        * gprof.texi: Replace abbreviated 20th century year numbers with
        full versions.

ld/ChangeLog

        * fdl.texi: Replace with v1.3 text.
        * ld.texinfo: Replace abbreviated 20th century year numbers with
        full versions.
        * ldint.texinfo: Likewise.
        Relicense under GFDL v1.3.  Replace text of v1.1 FDL with an
        include of the fdl.texi file.
2010-06-08 10:30:56 +00:00
Andrew Haley 85fdf9067f 2010-04-15 Andrew Haley <aph@redhat.com>
* emultempl/armelf.em (merge_exidx_entries): New variable.
	(OPTION_NO_MERGE_EXIDX_ENTRIES): New definition.
	("no-merge-exidx-entries"): New option.
	* ld.texinfo (merge-exidx-entries): Document this option.

2010-04-15  Andrew Haley  <aph@redhat.com>

	* bfd-in.h (elf32_arm_fix_exidx_coverage): Add new flag:
	merge_exidx_entries.
	* bfd-in2.h: Likewise.
	* elf32-arm.c (elf32_arm_fix_exidx_coverage): Likewise.  Use it to
	control merging of exidx entries.

2010-04-15  Andrew Haley  <aph@redhat.com>

	* options.h (merge_exidx_entries): New option.
	* arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
	(class Arm_exidx_fixup::merge_exidx_entries_): New member.
	(Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
	(Target_arm::merge_exidx_entries): New function.
	(process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
	(Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
	to Arm_exidx_fixup constructor.
	Add new arg, merge_exidx_entries.
	(Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
	Arm_output_section::fix_exidx_coverage.
2010-04-21 16:32:31 +00:00
Kai Tietz 522f09cd4c 2010-04-05 Kai Tietz <kai.tietz@onevision.com>
* emultempl/pep.em (U): Macro modified.
	(U_SIZE): New helper macro.
	(GET_INIT_SYMBOL_NAME): Likewise.
	(enum options): Add OPTION_NO_LEADING_UNDERSCORE
	and OPTION_LEADING_UNDERSCORE enumerator-values.
	(gld${EMULATION_NAME}_add_options): Add --(no-)leading-underscore
	option.
	(definfo): Add new member is_c_symbol.
	(D): Add to macro underscore mode parameter.
	(init): Add definition for is_c_symbol.
	(gld_${EMULATION_NAME}_list_options): Display new options.
	(set_pep_name): Adjust underscoring dependent fixed
	symbol handling.
	(gld_${EMULATION_NAME}_set_symbols): Likewise.
	(saw_option): Likewise.
	(gld_${EMULATION_NAME}_unrecognized_file): Likewise.
	(set_entry_point): Initial initial_symbol_char dependent to
	target's default and new option flag pep_leading_underscore.
	* emultempl/pe.em (U): Macro modified.
	(U_SIZE): New helper macro.
	(GET_INIT_SYMBOL_NAME): Likewise.
	(OPTION_LEADING_UNDERSCORE): Add new option define.
	(OPTION_NO_LEADING_UNDERSCORE): Likewise.
	(gld${EMULATION_NAME}_add_options): Add --(no-)leading-underscore
	option.
	(definfo): Add new member is_c_symbol.
	(D): Add to macro underscore mode parameter.
	(init): Add definition for is_c_symbol.
	(gld_${EMULATION_NAME}_list_options): Display new options.
	(set_pep_name): Adjust underscoring dependent fixed
	symbol handling.
	(gld_${EMULATION_NAME}_set_symbols): Likewise.
	(saw_option): Likewise.
	(gld_${EMULATION_NAME}_unrecognized_file): Likewise.
	(set_entry_point): Initial initial_symbol_char dependent to
	target's default and new option flag pep_leading_underscore.
	* pe-dll.c (pe_leading_underscore): New flag variable.
	(pe_detail_list): Remove const to allow modify of
	member underscore.
	(pe_dll_id_target): Initialize pe_details' underscore variable
	dependent to target's default and flag pe_leading_underscore.
	* pe-dll.h (pe_leading_underscore): Add extern declaration of
	option flag.
	* pep-dll.c (pe_leading_underscore): Add alias define for
	pep_leading_underscore.
	* pep-dll.h (pep_leading_underscore) Add extern declaration of
	option flag.
	* ld.texinfo: Add documentation for --(no-)leading-underscore
	option.
2010-04-05 09:04:09 +00:00
H.J. Lu fc073cb7bc Fix a typo in ld.texinfo.
2010-02-27  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/11330
	* ld.texinfo: Replace explicitely with explicitly.
2010-02-27 23:00:41 +00:00
Jie Zhang 90f5d9d961 * ld.texinfo: Make it clear that --nmagic disables linking
against shared libraries.
2009-12-04 07:28:13 +00:00
Nick Clifton 28d5f67740 PR ld/10956
* ld.h (struct args_type): Rename 'relax' field to
        'disable_target_specific_optimizations' and turn it into a
        tri-state variable.
        (RELAXATION_DISABLED_BY_DEFAULT): New macro.
        (RELAXATION_DISABLED_BY_USER): New macro.
        (RELAXATION_ENABLED): New macro.
        (DISABLE_RELAXATION): New macro.
        (ENABLE_RELAXATION): New macro.
        * lexsup (enum option_values): Add OPTION_NO_RELAX.
        (struct ld_options): Add --no-relax.
        (parse_args): Handle OPTION_NO_RELAX.  Use DISABLE_RELAXATION and
        ENABLE_RELAXATION macros.
        * ldlang.c (lang_relax_sections): Use RELAXATION_ENABLED macro.
        (lang_process): Likewise.
        * ldmain.c (main): Initialise
        disable_target_specific_optimizations field.
        (multiple_definition): Use RELAXATION_ENABLED macro.
        * ld.texinfo: Document new command line option.
        * emultempl/alphaelf.em: Remove --no-relax option.
        (before_allocation): Test RELAXATION_DISABLED_BY_USER macro.
        Use ENABLE_RELAXATION macro.
        * emultempl/avrelf.em: (after_allocation): Test RELAXATION_ENABLED
        macro.
        * emultempl/cr16elf.em: Remove --no-relax option.
        (before_allocation): Test RELAXATION_DISABLED_BY_USER macro.
        Use ENABLE_RELAXATION macro.
        * emultempl/crxelf.em: Remove --no-relax option.
        (before_allocation): Test RELAXATION_DISABLED_BY_USER macro.
        Use ENABLE_RELAXATION macro.
        * emultempl/mmix-elfnmmo.em: (before_allocation): Use
        ENABLE_RELAXATION macro.
        * emultempl/needrelax.em: (before_allocation): Use
        ENABLE_RELAXATION macro.
        * emultempl/ppc32elf.em: (before_allocation): Test
        RELAXATION_DISABLED_BY_DEFAULT macro. Use
        ENABLE_RELAXATION macro.
        * emultempl/sh64elf.em: (before_allocation): Test
        RELAXATION_ENABLED macro. Use DISABLE_RELAXATION macro.
        * emultempl/xtensaelf.em: Remove --no-relax option.
        (before_allocation): Test RELAXATION_ENABLED macro.
        Use ENABLE_RELAXATION macro.
2009-11-26 13:45:25 +00:00
Nick Clifton 3ab904c416 PR ld/10864
* ld.texinfo (Entry Point): Mention that the default entry symbol
        is not 'start' on some targets.
2009-11-10 16:34:53 +00:00
Nick Clifton ddbb8a31d5 * lexsup.c: Rename --add-needed to --copy-dt-needed-entries.
* ldlang.h (struct lang_input_statement_struct): Rename add_needed
        to add_DT_NEEDED_for_dynamic.  Rename as_needed to
        add_DT_NEEDED_for_regular.
        * ldlang.c: Likewise.
        * ldlang.h: Likewise.
        * ldlang.c: Use the new variable names.
        * ldgram.y: Likewise.
        * emultempl/elf32.em: Likewise.
        * ld.texinfo: Document the renamed option.  Also mention its
        affect on the resolution of dynamic symbols.
        * NEWS: Mention the changed option name.
2009-11-05 15:35:50 +00:00
Kai Tietz 7fcab87103 2009-10-23 Kai Tietz <kai.tietz@onevision.com>
* deffile.h (def_file_export): New member its_name.
	(def_file_import): Likewise.
	(def_file_add_export): Add argument its_name.
	(def_file_add_import): Likewise.
	* deffilep.y (def_exports): Add argument its_name.
	(def_import): Likewise.
	(EQUAL): Add new token for '=='.
	(opt_equalequal_name): New rule.
	(expline): Add rule opt_equalequal_name.
	(impline): Likewise.
	(def_file_free): Free for exports and imports
	the optional member its_name.
	(def_lex): Add scan of '==' as EQUAL.
	* pe-dll.c (pe_export_sort): Sort for its_name too.
	(process_def_file_and_drectve): Adjust calls to
	def_file_add_export.
	(generate_edata): Take its_name in account.
	(make_one): Likewise.
	(pe_process_import_defs): Likewise.
	(pe_dll_generate_def_file): Add print of new '==' option.
	* ld.texinfo: Extend documentation about .def file syntax.
	* NEWS: Mention new feature.
2009-10-23 11:40:17 +00:00
Nick Clifton 2927aacaee * emultempl/pe.em (OPTION_EXCLUDE_ALL_SYMBOLS): New macro.
(gld${EMULATION_NAME}_add_options): Add new --exclude-all-symbols option
        to exclude all symbols from automatic export.
        (gld_${EMULATION_NAME}_list_options): Describe it.
        (gld${EMULATION_NAME}_handle_option): Handle it.
        * emultempl/pep.em: Likewise to all the above.
        * pe-dll.c (pe_dll_exclude_all_symbols): New variable.
        (process_def_file_and_drectve): Use it.
        * pe-dll.h (pe_dll_exclude_all_symbols): Declare.
        * pep-dll.c (pep_dll_exclude_all_symbols): Define pep_ alias.
        * pep-dll.h (pe_dll_exclude_all_symbols): Declare.
        * NEWS: Mention the new feature.
        * ld.texinfo: Document the new command line switch.
2009-10-16 15:15:39 +00:00
Alan Modra 4100cea361 PR ld/10744
* ldlang.c (lang_new_phdr): Allow FILEHDR/PHDRS on more than the
	first PT_LOAD header.
	* ld.texinfo: Update.
2009-10-08 01:00:27 +00:00
Nathan Sidwell 5c1a3f0fa7 ld/
* ldlang.c (lang_new_phdr): Check PHDRS and FILEHDR in loadable
	segments do not appear after a different loadable segment.
	* ld.texinfo (PHDRS): Document order of processing segments.
	Document where PHDRS and FILEHDR may appear.

	ld/testsuite/
	* ld-scripts/phdrs3.d: New.
	* ld-scripts/phdrs3.t: New.
	* ld-scripts/phdrs3.exp: New.
2009-10-07 07:25:36 +00:00
Alan Modra 7ee314faa4 bfd/
* 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-23 13:54:29 +00:00
Nick Clifton 07d8eb5534 * ld.texinfo: Fix typo. 2009-07-06 13:48:51 +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
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
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
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
Chris Demetriou 267e27229e [ld/ChangeLog]
2009-04-29  Chris Demetriou  <cgd@google.com>

        * lexsup.c (option_values): Add OPTION_NO_EXPORT_DYNAMIC.
        (ld_options): Likewise.
        (parse_args): Likewise.
        * ld.texinfo: Document --no-export-dynamic.
        * NEWS: Mention --no-export-dynamic.

[ld/testsuite/ChangeLog]
2009-04-29  Chris Demetriou  <cgd@google.com>

        * ld-elfvers/vers.exp (vers4b): New test to verify that
        --no-export-dynamic undoes --export-dynamic.
2009-04-29 17:24:27 +00:00
Nick Clifton 0c71d7594b PR 9824
* ld.texinfo (Output Section Constraint): New node.  Documents the
        ONLY_IF_RO and ONLY_IF_RW constraints.
        (Symbolic Constants): New node.  Documents the CONSTANT operator.
2009-04-09 16:06:48 +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
Nick Clifton 6ce340f181 * ld.texinfo (Output Section Address): Note that specifying an
address for an output section will only change the location
        counter if the output section is used.
2009-04-07 08:07:08 +00:00
Kazu Hirata 7d24f02c67 * ld.texinfo (-L): Mention that -L options do not affect how ld
searches for a linker script unless -T option is specified.
	* ldfile.c (ldfile_find_command_file): Append the path obtained
	from the program name to the search path instead of
	prepending. Add a new parameter "default_only". Restrict the
	search to the default script location if the new parameter is
	true.
	(ldfile_open_command_file_1): New.
	(ldfile_open_command_file): Call ldfile_open_command_file_1.
	(ldfile_open_default_command_file): New.
2009-04-06 00:47:09 +00:00
Dave Korn 8b747e1a27 ld/ChangeLog
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-02 14:42:41 +00:00
Dave Korn 2f563b5100 include/ChangeLog
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-14 03:30:26 +00:00
Dave Korn 3efd345c3b * emultempl/pe.em (debug_section_p): New bfd_map_over_sections hook.
(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-03 18:22:11 +00:00
Nick Clifton 4a93e18003 * ldgram.y: Add support for REGION_ALIAS operator.
* ldlang.c: Likewise.
        * ldlang.h: Likewise.
        * ldlex.l: Likewise.
        * NEWS: Mention the new feature.
        * ld.texinfo: Document the new feature.
        * ld-scripts/regions-alias-1.t: New file.
        * ld-scripts/regions-alias-2.t: New file.
        * ld-scripts/regions-alias-3.t: New file.
        * ld-scripts/regions-alias-4.t: New file.
        * ld-scripts/script.exp: Run region alias tests.
2009-03-02 17:27:36 +00:00
Daniel Jacobowitz 07d72278cd 2009-02-24 Joseph Myers <joseph@codesourcery.com>
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-24 22:43:10 +00:00
Sandra Loosemore 2509a395cb 2009-02-24 Sandra Loosemore <sandra@codesourcery.com>
ld/
	* ld.texinfo (Options): Correct typos in example.  Recommend
	using joined forms of syntax for passing options with arguments
	from a driver.
	(-a): Use consistent syntax for documenting option arguments.
	Clean up indexing and markup.
	(-A/--architecture): Likewise.
	(-f/--auxiliary): Likewise.
	(-F/--filter): Likewise.
	(-fini): Likewise.
	(-G/--gpsize): Likewise.
	(-h/-soname):Likewise.
	(-init): Likewise.
	(-l/--library): Likewise.
	(-L/--library-path): Likewise.
	(-m): Likewise.
	(--defsym): Likewise.
	(-I/--dynamic-linker): Likewise.
	(-Map): Likewise.
	(--oformat): Likewise.
	(--retain-symbols-file): Likewise.
	(-rpath): Likewise.
	(-rpath-link): Likewise.
	(--sort-common): Likewise.
	(--sort-section): Likewise.
	(--split-by-file): Likewise.
	(--split-by-reloc): Likewise.
	(--sysroot): Likewise.
	(--section-start): Likewise.
	(-Tbss, -Tdata, -Ttext): Likewise.
	(-Ttext-segment): Likewise.
	(--version-script): Likewise.
	(--wrap): Likewise.
2009-02-24 18:06:27 +00:00
Dave Korn 8818386922 bfd/ChangeLog
* 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-18 18:23:08 +00:00
Nick Clifton 903249d7bc PR 9805
* ld.texinfo (--allow-shlib-undefined): Correct description of
        default settings and tidy up the rest of the entry.
2009-02-04 09:13:22 +00:00
Nick Clifton 8a308ae82b PR 9797
* ld.texinfo (Constants): Document the base-encoding suffixes
        supported in linker scripts.
2009-02-03 17:04:53 +00:00
Alan Modra 010e5ae26e binutils/
* NEWS: Mention --as-needed change.
ld/
	* ld.texinfo (--as-needed): Update.
bfd/
	* elflink.c (on_needed_list): New function.
	(elf_link_add_object_symbols): Link in --as-needed libs if they
	satisfy undefined symbols in other libs.
2009-01-31 11:44:38 +00:00
Nathan Sidwell 02b0b1aa77 * lexsup.c (parse_args): Set check_section_addresses to 1 or 0.
* ld.h (args_type): Make check_section_addresses a char.
	ldlang.c (lang_process): Don't consider relocatable flag when
	checking for overlap.
	* ldmain.c (main): Default check_section_addresses to -1. Check it
	for relocatable links.
	* ld.texinfo (--check-sections): Update documentation.
2009-01-26 15:23:39 +00:00
H.J. Lu 258795f524 ld/
2009-01-16  H.J. Lu  <hongjiu.lu@intel.com>

	* lexsup.c (option_values): Add OPTION_TTEXT_SEGMENT.
	(ld_options): Add -Ttext-segment.
	(parse_args): Handle OPTION_TTEXT_SEGMENT.

	* ld.texinfo: Document -Ttext-segment.

	* NEWS: Mention -Ttext-segment.

	* scripttempl/elf.sc (TEXT_START_ADDR): Use SEGMENT_START.
	(SHLIB_TEXT_START_ADDR): Likewise.

ld/testsuite/

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

	* ld-elf/textaddr1.d: New.
	* ld-elf/textaddr2.d: Likewise.
2009-01-16 14:14:07 +00:00
Kai Tietz ce11ba6c9d 2009-01-08 Kai Tietz <kai.tietz@onevision.com>
* 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-08 13:28:48 +00:00
Dave Korn e1c37eb57e * NEWS: Mention new feature --exclude-modules-for-implib.
* 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.
2009-01-03 18:04:16 +00:00
Alan Modra ae5a359786 include/
PR 7047
	* bfdlink.h (struct bfd_elf_version_expr): Delete "symbol".
	Add "literal".
bfd/
	PR 7047
	* configure.in: Bump version.
	* configure: Regenerate.
	* elflink.c (_bfd_elf_link_assign_sym_version): Continue matching
	against version nodes when a global match is a wildcard.  Similarly
	continue matching on local wildcard matches, rather than only
	continuing for "*".  Have any global wildcard match override a
	local wildcard match.  Correct logic hiding unversioned symbol.
	(bfd_elf_size_dynamic_sections): Update for changes to struct
	bfd_elf_version_expr.
ld/
	PR 7047
	* emultempl/ppc64elf.em (gld${EMULATION_NAME}_new_vers_pattern): Update
	for changes to struct bfd_elf_version_expr.
	* ldlang.c (lang_vers_match, version_expr_head_hash): Likewise.
	(version_expr_head_eq, lang_finalize_version_expr_head): Likewise.
	(lang_register_vers_node): Likewise.
	(lang_new_vers_pattern): Likewise.  Ensure "literal" is set when
	no glob chars found in "pattern".
	(realsymbol): Correct backslash quote logic.
	* ld.texinfo (VERSION): Warn about global wildcards.
2008-11-26 01:04:17 +00:00
Nick Clifton 793c580792 Change documentation license to FDL v1.3 2008-11-19 16:22:48 +00:00
Joseph Myers a9dc948127 bfd:
* bfd-in.h (bfd_elf32_arm_set_target_relocs): Add new parameter.
	* bfd-in2.h: Regenerate.
	* elf32-arm.c (struct elf_arm_obj_tdata): Add field
	no_wchar_size_warning.
	(bfd_elf32_arm_set_target_relocs): Add new parameter
	no_wchar_warn.
	(elf32_arm_merge_eabi_attributes): Give a warning, not an error,
	for conflicting wchar_t attributes.  Do not warn if
	--no-wchar-size-warning.  Make diagnostic text more specific.

ld:
	* ld.texinfo (--no-wchar-size-warning): Document new ARM option.
	* emultempl/armelf.em (no_wchar_size_warning): New.
	(arm_elf_create_output_section_statements): Pass
	no_wchar_size_warning to arm_elf_create_output_section_statements.
	(OPTION_NO_WCHAR_SIZE_WARNING): New.
	(PARSE_AND_LIST_LONGOPTS): Add no-wchar-size-warning.
	(PARSE_AND_LIST_OPTIONS): List --no-wchar-size-warning.
	(PARSE_AND_LIST_ARGS_CASES): Handle --no-wchar-size-warning.

ld/testsuite:
	* ld-arm/attr-merge-wchar-0.s,ld-arm/attr-merge-wchar-2.s,
	ld-arm/attr-merge-wchar-4.s, ld-arm/attr-merge-wchar-00-nowarn.d,
	ld-arm/attr-merge-wchar-00.d, ld-arm/attr-merge-wchar-02-nowarn.d,
	ld-arm/attr-merge-wchar-02.d, ld-arm/attr-merge-wchar-04-nowarn.d,
	ld-arm/attr-merge-wchar-04.d, ld-arm/attr-merge-wchar-20-nowarn.d,
	ld-arm/attr-merge-wchar-20.d, ld-arm/attr-merge-wchar-22-nowarn.d,
	ld-arm/attr-merge-wchar-22.d, ld-arm/attr-merge-wchar-24-nowarn.d,
	ld-arm/attr-merge-wchar-24.d, ld-arm/attr-merge-wchar-40-nowarn.d,
	ld-arm/attr-merge-wchar-40.d, ld-arm/attr-merge-wchar-42-nowarn.d,
	ld-arm/attr-merge-wchar-42.d, ld-arm/attr-merge-wchar-44-nowarn.d,
	ld-arm/attr-merge-wchar-44.d: New.
	* ld-arm/arm-elf.exp: Run new tests.
2008-07-18 20:49:12 +00:00
Jie Zhang 1bac266e85 Revert my last change since it has not been approved. 2008-07-12 08:54:13 +00:00
Jie Zhang 8c68457827 bfd/
* elf.c (_bfd_elf_map_sections_to_segments): Don't put
	executable sections into the same segment with other
	read only sections if --sep-code.
	* elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
	(elf32_bfin_data_in_l1): New variable.
	(elf32_bfin_final_write_processing): New.
	(elf32_bfin_special_sections[]): New.
	(elf_backend_final_write_processing): Define.
	(elf_backend_special_sections): Define.

	binutils/
	* readelf.c (get_machine_flags): Deal with Blackfin specific
	flags.

	include/
	* bfdlink.h (struct bfd_link_info): Add sep_code member
	variable.
	* elf/bfin.h (EF_BFIN_CODE_IN_L1): Define.
	(EF_BFIN_DATA_IN_L1): Define.

	ld/
	* Makefile.am (eelf32bfin.c): Depend on bfin.em.
	(eelf32bfinfd.c): Likewise.
	* Makefile.in: Regenerate.
	* gen-doc.texi: Set Blackfin.
	* ld.texinfo: Document --sep-code and Blackfin specific
	options.
	* ldmain.c (main): Initialize link_info.sep_code.
	* lexsup.c (enum option_values): Add OPTION_SEP_CODE.
	(ld_options[]): Add --sep-code.
	(parse_args): Deal with --sep-code.
	* emulparams/bfin.sh (EXTRA_EM_FILE): Define.
	* emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define.
	* emultempl/bfin.em: New file.
2008-07-11 19:24:39 +00:00
Nathan Sidwell 4006703d71 * ld.texinfo (File Commands): Document that INCLUDE can be used in
several different places.
	* ldgram.y (statement, memory_spec, section): Allow INCLUDE.
	(memory, memory_spec_list): Simplify BNF
	(memory_spec_list_opt): New rule.
	* ldlex.l (INCLUDE): Recognize in EXPRESSION.
testsuite/
	* ld-scripts/include-1.d: New.
	* ld-scripts/include-1.t: New.
	* ld-scripts/include-data.t: New.
	* ld-scripts/include-mem.t: New.
	* ld-scripts/include-ram.t: New.
	* ld-scripts/include-sections.t: New.
	* ld-scripts/include-subdata.t: New.
	* ld-scripts/include.exp: New.
	* ld-scripts/include.s: New.
2008-07-06 13:38:37 +00:00
Hans-Peter Nilsson 7a2de473a3 * ld.texinfo (@node MMIX): For the __.MMIX.start. prefix, only
mention it as being special for global symbols.
2008-06-16 15:10:13 +00:00