bfd/

2006-10-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3351
	* elflink.c (_bfd_elf_update_dynamic_flags): New.
	(_bfd_elf_merge_symbol): Update both real and indirect symbol
	dynamic flags.
	(_bfd_elf_add_default_symbol): Make the real symbol dynamic if
	the indirect symbol is defined in a shared library.
	(elf_link_add_object_symbols): Likewise.  If the indirect
	symbol has been forced local, don't make the real symbol
	dynamic.
	(elf_link_check_versioned_symbol): Check indirect symbol.
	(elf_link_output_extsym): Use real symbol definition when
	reporting indirect symbol error.  Check version info for
	dynamic versioned symbol.

ld/testsuite/

2006-10-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3351
	* ld-elf/indirect.exp: New file.
	* ld-elf/indirect1a.c: Likewise.
	* ld-elf/indirect1b.c: Likewise.
	* ld-elf/indirect1c.c: Likewise.
	* ld-elf/indirect2.c: Likewise.
	* ld-elf/indirect3.out: Likewise.
	* ld-elf/indirect3a.c: Likewise.
	* ld-elf/indirect3b.c: Likewise.
	* ld-elf/indirect3c.c: Likewise.
	* ld-elf/indirect4.out: Likewise.
	* ld-elf/indirect4a.c: Likewise.
	* ld-elf/indirect4b.c: Likewise.
	* ld-elf/indirect4c.c: Likewise.

diff --git a/bfd/elflink.c b/bfd/elflink.c
index 32575d9..f6f2740 100644
bfd/

2007-01-23  H.J. Lu  <hongjiu.lu@intel.com>

	* elf-bfd.h (_bfd_elf_sharable_com_section): New.
	(_bfd_elf_add_sharable_symbol): Likewise.
	(_bfd_elf_sharable_section_from_bfd_section): Likewise.
	(_bfd_elf_sharable_symbol_processing): Likewise.
	(_bfd_elf_sharable_common_definition): Likewise.
	(_bfd_elf_sharable_common_section_index): Likewise.
	(_bfd_elf_sharable_common_section): Likewise.
	(_bfd_elf_sharable_merge_symbol): Likewise.

	* elf.c (special_sections_g): Add ".gnu.linkonce.shrb" and
	".gnu.linkonce.shrd".
	(special_sections_s): Add ".sharable_bss" and ".sharable_data".
	(get_program_header_size): Handle PT_GNU_SHR segment.
	(_bfd_elf_map_sections_to_segments): Likewise.
	(assign_file_positions_for_load_sections): Likewise.

	* elf32-i386.c (elf_i386_link_hash_table): Add sdynsharablebss
	and srelsharablebss fields.
	(elf_i386_link_hash_table_create): Initialize sdynsharablebss
	and srelsharablebss.
	(elf_i386_create_dynamic_sections): Handle sdynsharablebss and
	srelsharablebss.
	(elf_i386_adjust_dynamic_symbol): Likewise.
	(elf_i386_size_dynamic_sections): Likewise.
	(elf_i386_finish_dynamic_symbol): Likewise.
	(elf_backend_add_symbol_hook): Defined.
	(elf_backend_section_from_bfd_section): Likewise.
	(elf_backend_symbol_processing): Likewise.
	(elf_backend_common_section_index): Likewise.
	(elf_backend_common_section): Likewise.
	(elf_backend_common_definition): Likewise.
	(elf_backend_merge_symbol): Likewise.

	* elf64-x86-64.c (elf_x86_64_link_hash_table): Add
	sdynsharablebss and srelsharablebss fields.
	(elf_x86_64_link_hash_table_create): Initialize sdynsharablebss
	and srelsharablebss.
	(elf_x86_64_create_dynamic_sections): Handle sdynsharablebss
	and srelsharablebss.
	(elf_x86_64_adjust_dynamic_symbol): Likewise.
	(elf_x86_64_size_dynamic_sections): Likewise.
	(elf_x86_64_finish_dynamic_symbol): Likewise.
	(elf_x86_64_add_symbol_hook): Handle sharable symbols.
	(elf_x86_64_elf_section_from_bfd_section): Likewise.
	(elf_x86_64_symbol_processing): Likewise.
	(elf_x86_64_merge_symbol): Likewise.
	(elf_x86_64_common_definition): Handle sharable sections.
	(elf_x86_64_common_section_index): Likewise.
	(elf_x86_64_common_section): Likewise.

	* elflink.c (_bfd_elf_create_dynamic_sections): Handle
	.dynsharablebss section.
	(_bfd_elf_sharable_com_section): New.
	(get_sharable_common_section): Likewise.
	(_bfd_elf_add_sharable_symbol): Likewise.
	(_bfd_elf_sharable_section_from_bfd_section): Likewise.
	(_bfd_elf_sharable_symbol_processing): Likewise.
	(_bfd_elf_sharable_common_definition): Likewise.
	(_bfd_elf_sharable_common_section_index): Likewise.
	(_bfd_elf_sharable_common_section): Likewise.
	(_bfd_elf_sharable_merge_symbol): Likewise.

	* elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Handle sharable
	symbols.
	(elf_backend_add_symbol_hook): Defined.
	(elf_backend_section_from_bfd_section): Likewise.
	(elf_backend_symbol_processing): Likewise.
	(elf_backend_common_section_index): Likewise.
	(elf_backend_common_section): Likewise.
	(elf_backend_common_definition): Likewise.
	(elf_backend_merge_symbol): Likewise.

binutils/

2007-01-04  H.J. Lu  <hongjiu.lu@intel.com>

	* readelf.c (dump_relocations): Handle sharable sections.
	(get_segment_type): Handle sharable segment.
	(get_symbol_index_type): Handle sharable sections.

gas/

2007-01-04  H.J. Lu  <hongjiu.lu@intel.com>

	* config/obj-elf.c (obj_elf_sharable_common): New.
	(elf_pseudo_table): Add "sharable_common".
	(obj_elf_change_section): Handle sharable sections.

include/

2007-01-23  H.J. Lu  <hongjiu.lu@intel.com>

	* bfdlink.h (bfd_link_info): Add sharable_sections.

include/elf/

2007-01-04  H.J. Lu  <hongjiu.lu@intel.com>

	* common.h (PT_GNU_SHR): New.
	(SHF_GNU_SHARABLE): Likewise.
	(SHN_GNU_SHARABLE_COMMON): Likewise.

ld/

2007-01-04  H.J. Lu  <hongjiu.lu@intel.com>

	* emulparams/elf64_ia64.sh (SHARABLE_SECTIONS): Set to yes.
	* emulparams/elf_i386.sh (SHARABLE_SECTIONS): Likewise.
	* emulparams/elf_x86_64.sh (SHARABLE_SECTIONS): Likewise.

	* emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Set
	link_info.sharable_sections based on $SHARABLE_SECTIONS.
	(gld${EMULATION_NAME}_place_orphan): Don't allow orphaned
	sharable sections.

	* ldmain.c (main): Initialize link_info.sharable_sections.
	* scripttempl/elf.sc: Support sharable sections.

diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index cc83588..de441d9 100644
2010-07-01  H.J. Lu  <hongjiu.lu@intel.com>

	* elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Silence unused warning
	on ignored.

	* elf32-tic6x.c (elf32_tic6x_relocate_section): Add an argument for
	error ignored.
	
bfd/

2007-07-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4409
	* elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add an argument for
	error ignored.
	* elf-m10200.c (mn10200_elf_relocate_section): Updated.
	* elf-m10300.c (mn10300_elf_relocate_section): Likewise.
	* elf32-arm.c (elf32_arm_relocate_section): Likewise.
	* elf32-avr.c (elf32_avr_relocate_section): Likewise.
	* elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
	(bfin_relocate_section): Likewise.
	* elf32-cr16.c (elf32_cr16_relocate_section): Likewise.
	* elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
	* elf32-cris.c (cris_elf_relocate_section): Likewise.
	* elf32-crx.c (elf32_crx_relocate_section): Likewise.
	* elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
	* elf32-fr30.c (fr30_elf_relocate_section): Likewise.
	* elf32-frv.c (elf32_frv_relocate_section): Likewise.
	* elf32-h8300.c (elf32_h8_relocate_section): Likewise.
	* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
	* elf32-i386.c (elf_i386_relocate_section): Likewise.
	* elf32-i860.c (elf32_i860_relocate_section): Likewise.
	* elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
	* elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
	* elf32-lm32.c (lm32_elf_relocate_section): Likewise.
	* elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
	* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
	* elf32-microblaze.c (microblaze_elf_relocate_section): Likewise.
	* elf32-mcore.c (mcore_elf_relocate_section): Likewise.
	* elf32-mep.c (mep_elf_relocate_section): Likewise.
	* elf32-moxie.c (moxie_elf_relocate_section): Likewise.
	* elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
	* elf32-mt.c (mt_elf_relocate_section): Likewise.
	* elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
	* elf32-rx.c (rx_elf_relocate_section): Likewise.
	* elf32-s390.c (elf_s390_relocate_section): Likewise.
	* elf32-v850.c (v850_elf_relocate_section): Likewise.
	* elf32-vax.c (elf_vax_relocate_section): Likewise.
	* elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
	* elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
	* elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
	* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
	* elf64-mmix.c (mmix_elf_relocate_section): Likewise.
	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
	* elf64-s390.c (elf_s390_relocate_section): Likewise.
	* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.

	* elfxx-ia64.c (elfNN_ia64_relocate_section): Skip if error
	from RELOC_FOR_GLOBAL_SYMBOL in executable is ignored.

ld/

2007-07-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4409
	* ldmain.c (how_to_report_unresolved_symbols): New.
	(main): Set link_info.unresolved_syms_in_objects and
	link_info.unresolved_syms_in_shared_libs if they aren't set
	yet.

	* ldmain.h (how_to_report_unresolved_symbols): New.

	* lexsup.c (how_to_report_unresolved_symbols): Removed.
	(parse_args): Set link_info.pie to FALSE for -shared. Don't
	set default values for link_info.unresolved_syms_in_objects nor
	link_info.unresolved_syms_in_shared_libs.

ld/testsuite/

2007-07-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4409
	* ld-ia64/error1.d: New file.
	* ld-ia64/error1.s: Likewise.
	* ld-ia64/error2.d: Likewise.
	* ld-ia64/error3.d: Likewise.
	* ld-ia64/error4.d: Likewise.

diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 66dcbcd..7e36cfe 100644
diff --git a/binutils/ChangeLog.addend b/binutils/ChangeLog.addend
new file mode 100644
index 0000000..e0bd096
bfd/

2007-07-19  H.J. Lu  <hongjiu.lu@intel.com>

	* elflink.c (elf_link_add_object_symbols): Check symbol type
	for symbol alias in a dynamic object.

ld/testsuite/

2007-07-19  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-elf/data2.c: New.
	* ld-elf/weakdef1.c: Likewise.

	* ld-elf/shared.exp: Add tests for libdata2 and weakdef1.

2008-03-12  H.J. Lu  <hongjiu.lu@intel.com>

	* elf.c (assign_section_numbers): Check if number of sections
	>= SHN_LORESERVE.
	* elfcode.h (elf_object_p): Likewise.

bfd/

2010-12-12  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/12248
	PR ld/12277
	PR ld/12291
	* bfd.c (bfd_lto_object_type): New.
	(BFD_PLUGIN): Likewise.
	(BFD_PLUGIN_DUMMY): Likewise.
	(bfd_group_signature): Likewise.
	(BFD_FLAGS_SAVED): Add BFD_PLUGIN and BFD_PLUGIN_DUMMY.
	(BFD_FLAGS_FOR_BFD_USE_MASK): Likewise.
	(bfd): Add object_only_section and lto_type.

	* elf.c (special_sections_g): Add ".gnu_object_only".

	* format.c (bfd_set_lto_type): New.
	(bfd_check_format_matches): Use it.

	* section.c (GNU_OBJECT_ONLY_SECTION_NAME): New.

	* bfd-in2.h: Regenerated.

binutils/

2010-12-12  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/12248
	PR ld/12277
	PR ld/12291
	* objcopy.c (group_signature): Removed.
	(is_strip_section): Replace group_signature with
	bfd_group_signature.
	(setup_section): Likewise.

	* readelf.c (get_section_type_name): Handle SHT_GNU_OBJECT_ONLY.

gas/testsuite/

2010-12-12  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/12248
	PR ld/12277
	PR ld/12291
	* gas/elf/section9.s: Add the .gnu_object_only test.
	* gas/elf/section9.d: Updated.

include/

2010-12-12  H.J. Lu  <hongjiu.lu@intel.com>

	* bfdlink.h (bfd_link_info): Add emit_gnu_object_only and
	emitting_gnu_object_only.

include/elf/

2010-12-12  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/12248
	PR ld/12277
	PR ld/12291
	* common.h (SHT_GNU_OBJECT_ONLY): New.

ld/

2010-12-12  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/12248
	PR ld/12277
	PR ld/12291
	* ldfile.c: Updated for 2 stage linking and support for mixed
	IR/non-IR objects.
	* ldlang.c: Likewise.

	* ldlang.h (lang_input_statement_struct): Add stage1.
	(lang_init): Take a bfd_boolean argument.
	(cmdline_enum_type): New.
	(cmdline_header_type): Likewise.
	(cmdline_input_statement_type): Likewise.
	(cmdline_file_type): Likewise.
	(cmdline_bfd_type): Likewise.
	(cmdline_union_type): Likewise.
	(cmdline_list_type): Likewise.
	(cmdline_option_append): Likewise.
	(cmdline_option_insert_claimed_output): Likewise.
	(cmdline_set_next_claimed_output): Likewise.
	(cmdline_claimed_archive_member_list_append): Likewise.
	(cmdline_emit_object_only_section): Likewise.
	(cmdline_check_object_only_section): Likewise.
	(cmdline_remove_object_only_files): Likewise.

	* ldmain.c (main): Pass FALSE to lang_init.  Use
	ld_parse_linker_script.  Set link_info.output_bfd to NULL
	after close.  Call cmdline_emit_object_only_section if needed.
	(ld_parse_linker_script): New.
	(add_archive_element): Updated for 2 stage linking and support
	for mixed IR/non-IR objects.

	* ldmain.h (ld_parse_linker_script): New.

	* plugin.c (IRONLY_SUFFIX_LEN): Removed.
	(plugin_opt_plugin_arg): Ignore -pass-through=.
	(plugin_get_ir_dummy_bfd): Set BFD_PLUGIN_DUMMY on dummy IR
	input.
	(is_ir_dummy_bfd): Check BFD_PLUGIN_DUMMY.
	(get_symbols): Re-indent.
	(add_input_file): Replace lang_add_input_file with
	cmdline_list_insert_claimed_output.
	(add_input_library): Likewise

	* emultempl/elf32.em (orphan_init_done): Moved out of
	gld${EMULATION_NAME}_place_orphan.
	(hold): Likewise.
	(gld${EMULATION_NAME}_finish): New.
	(ld_${EMULATION_NAME}_emulation): Use gld${EMULATION_NAME}_finish.

	* scripttempl/armbpabi.sc: Also discard .gnu_object_only
	sections.
	* scripttempl/elf.sc: Likewise.
	* scripttempl/elf32sh-symbian.sc: Likewise.
	* scripttempl/elf64hppa.sc: Likewise.
	* scripttempl/elfxtensa.sc: Likewise.
	* scripttempl/mep.sc: Likewise.
	* scripttempl/pe.sc: Likewise.
	* scripttempl/pep.sc: Likewise.

ld/testsuite/

2010-12-12  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/12248
	PR ld/12277
	PR ld/12291
	* ld-plugin/func1p.c: New.
	* ld-plugin/func2.c: Likewise.
	* ld-plugin/func2i.c: Likewise.
	* ld-plugin/func3h.c: Likewise.

	* ld-plugin/plugin.exp: Add object files for symbols claimed
	or created by testplugin.
	* ld-plugin/plugin-7.d: Updated.
	* ld-plugin/plugin-8.d: Likewise.
	* ld-plugin/plugin-9.d: Likewise.

diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index e7805b6..bea54b1 100644
ld/

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

	PR ld/12356
	Revert 2010-12-20 by Alan Modra <amodra@gmail.com>.
	* ld.texinfo (Expression Section): Remove __ld_compatibility.

	* ldemul.c (after_open_default): Don't check  __ld_compatibility.
	* ldexp.c (fold_name): Likewise.
	(exp_fold_tree_1): Likewise.

	* ldlang.c (ld_compatibility): Removed.
	* ldlang.h (ld_compatibility): Likewise.

	* emultempl/aix.em (gld${EMULATION_NAME}_after_open): Don't call
	after_open_default.
	* emultempl/armcoff.em (gld${EMULATION_NAME}_after_open): Likewise.
	* emultempl/beos.em (gld${EMULATION_NAME}_after_open): Likewise.
	* emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Likewise.
	* emultempl/genelf.em (gld${EMULATION_NAME}_after_open): Likewise.
	* emultempl/lnk960.em (gld${EMULATION_NAME}_after_open): Likewise.
	* emultempl/m68kcoff.em (gld${EMULATION_NAME}_after_open): Likewise.
	* emultempl/mmo.em (gld${EMULATION_NAME}_after_open): Likewise.
	* emultempl/pe.em (gld${EMULATION_NAME}_after_open): Likewise.
	* emultempl/pep.em (gld${EMULATION_NAME}_after_open): Likewise.
	* emultempl/sunos.em (gld${EMULATION_NAME}_after_open): Likewise.
	* emultempl/z80.em (gld${EMULATION_NAME}_after_open): Likewise.

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

	PR ld/12356
	* ldlang.c: Revert 2010-12-20 by Alan Modra <amodra@gmail.com>.
	* ldexp.h: Likewise.
	* ldexp.c: Likewise.
	* ldlang.c: Likewise.

ld/testsuite/

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

	PR ld/12356
	* ld-scripts/default-script2.d: Revert 2010-12-20 by Alan
	Modra <amodra@gmail.com>.

	* ld-scripts/defined5.d: New.
	* ld-scripts/defined5.s: Likewise.
	* ld-scripts/defined5.t: Likewise.

	* ld-scripts/defined.exp: Run defined5.

diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em
index 60c4fc6..5ccb25c 100644
