Commit Graph

12 Commits

Author SHA1 Message Date
Roland McGrath 43819297ce gold/
* i386.cc (Target_i386): Remove unused member dynbss_.
	* arm.cc (Target_arm): Likewise.
	* powerpc.cc (Target_powerpc): Likewise.
	* sparc.cc (Target_sparc): Likewise.
	* tilegx.cc (Target_tilegx): Likewise.
	* x86_64.cc (Target_x86_64): Likewise.
	* dwarf_reader.h (Dwarf_info_reader): Remove unused members
	type_signature_, type_offset_.
	* plugin.h (Plugin_hook): Remove unused member layout_.
	* readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
	mapfile_.
	(Read_member): Remove unused members input_objects_, symtab_,
	mapfile_, layout_.
	(Check_library): Remove unused member symtab_.
	* archive.h (Lib_group): Remove unused member lib_.
	* archive.cc (Lib_group::Lib_group): Update initializer.
	* incremental.h	(Incremental_binary): Remove unused member target_.
	(Incremental_script_entry): Removed unused member script_.
	* layout.h (Write_symbols_task): Remove unused member input_objects_.
	* icf.h (Icf): Remove unused member num_tracked_relocs.
2013-10-11 21:11:49 +00:00
Sriraman Tallam 4e271fffec 2011-02-02 Sriraman Tallam <tmsriram@google.com>
* icf.h (is_section_foldable_candidate): Change type of parameter
        to std::string.
	* icf.cc (Icf::find_identical_sections): Change type of local variable
        section_name to be std::string.
	(is_function_ctor_or_dtor): Change type of parameter to std::string.
2011-02-02 21:55:29 +00:00
Nick Clifton ca09d69af1 * archive.cc: Formatting fixes: Remove whitespace between
typename and following asterisk.  Remove whitespace between
        function name and opening parenthesis.
        * archive.h: Likewise.
        * arm.cc: Likewise.
        * attributes.cc: Likewise.
        * attributes.h: Likewise.
        * common.cc: Likewise.
        * copy-relocs.cc: Likewise.
        * dirsearch.h: Likewise.
        * dynobj.cc: Likewise.
        * ehframe.cc: Likewise.
        * ehframe.h: Likewise.
        * expression.cc: Likewise.
        * fileread.cc: Likewise.
        * fileread.h: Likewise.
        * gc.h: Likewise.
        * gold-threads.cc: Likewise.
        * gold.cc: Likewise.
        * i386.cc: Likewise.
        * icf.h: Likewise.
        * incremental-dump.cc: Likewise.
        * incremental.cc: Likewise.
        * layout.cc: Likewise.
        * layout.h: Likewise.
        * main.cc: Likewise.
        * merge.cc: Likewise.
        * merge.h: Likewise.
        * object.cc: Likewise.
        * object.h: Likewise.
        * options.cc: Likewise.
        * options.h: Likewise.
        * output.cc: Likewise.
        * output.h: Likewise.
        * plugin.cc: Likewise.
        * plugin.h: Likewise.
        * powerpc.cc: Likewise.
        * reloc.cc: Likewise.
        * script-c.h: Likewise.
        * script-sections.cc: Likewise.
        * script.cc: Likewise.
        * stringpool.cc: Likewise.
        * symtab.cc: Likewise.
        * symtab.h: Likewise.
        * target.cc: Likewise.
        * timer.cc: Likewise.
        * timer.h: Likewise.
        * version.cc: Likewise.
        * x86_64.cc: Likewise.
2010-08-25 08:36:54 +00:00
Sriraman Tallam 41cbeecc3c * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
paramter to the call to gold::gc_process_relocs.
	* i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
	paramter to the call to gold::gc_process_relocs.
	* x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
	parameter to the call to gold::gc_process_relocs.
	* powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
	template parameter to the call to gold::gc_process_relocs.
	* sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
	paramter to the call to gold::gc_process_relocs.
	* gc.h (get_embedded_addend_size): New function.
	(gc_process_relocs): Save the size of the reloc for use by ICF.
	* icf.cc (get_section_contents): Get the addend from the text section
	for SHT_REL relocation sections.
	* icf.h (Icf::Reloc_addend_size_info): New typedef.
	(Icf::Reloc_info): Add new member reloc_addend_size_info.
	* int_encoding.h (read_from_pointer): New overloaded function.
	* testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
	* testsuite/icf_sht_rel_addend_test.sh: New file.
	* testsuite/icf_sht_rel_addend_test_1.cc: New file.
	* testsuite/icf_sht_rel_addend_test_2.cc: New file.
2010-07-29 18:57:28 +00:00
Doug Kwan 8a75a161b2 2010-06-25 Doug Kwan <dougkwan@google.com>
* arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
	(Target_arm::section_may_have_icf_unsafe_pointers): New method
	definition.
	(Target_arm::Scan::local_reloc_may_be_function_pointer,
	Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
	target hook to detect function points.
	(Target_arm::Scan::possible_function_pointer_reloc): New method.
	* icf.h (Icf::check_section_for_function_pointers): Change type of
	parameter SECTION_NAME to const reference to std::string.  Use
	target hook to determine if section may have unsafe pointers.
	* target.h (Target::section_may_have_icf_unsafe_pointers): New
	method definition.
2010-06-25 00:37:40 +00:00
Sriraman Tallam 0897ed3bdb * i386.cc (Target_i386::can_check_for_function_pointers): New function.
(Scan::possible_function_pointer_reloc): New function.
	(Scan::local_reloc_may_be_function_pointer): Change to call
	possible_function_pointer_reloc.
	(Scan::global_reloc_may_be_function_pointer): Ditto.
	* icf.h (Icf::check_section_for_function_pointers): Change to reject
	relocations in ".data.rel.ro._ZTV" section.
	* testsuite/icf_safe_so_test.sh: Change to pass i386.
	* testsuite/icf_safe_so_test.cc: Ditto.
	* testsuite/icf_safe_test.cc: Ditto.
	* testsuite/icf_safe_test.sh: Ditto.
2010-03-04 01:33:22 +00:00
Sriraman Tallam b487ad64e5 2010-02-20 Sriraman Tallam <tmsriram@google.com>
* gc.h (gc_process_relocs): Change vectors to point to the new list.
	Add reloc offset information.
	* icf.cc (get_section_contents): Change iterators to point to the new
	vectors. Add reloc offset information to the contents.
	* icf.h (Icf::Sections_reachable_info): New typedef.
	(Icf::Sections_reachable_list): New typedef.
	(Icf::Offset_info): New typedef.
	(Icf::Reloc_info): New struct typedef.
	(Icf::Reloc_info_list): New typedef.
	(Icf::symbol_reloc_list): Delete method.
	(Icf::addend_reloc_list): Delete method.
	(Icf::section_reloc_list): Delete method.
	(Icf::reloc_info_list): New method.
	(Icf::reloc_info_list_): New member.
2010-02-21 00:57:59 +00:00
Sriraman Tallam 21bb3914d6 2010-02-12 Sriraman Tallam <tmsriram@google.com>
* arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
	(Scan::global_reloc_may_be_function_pointer): New function.
	* sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
	(Scan::global_reloc_may_be_function_pointer): New function.
	* powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
	(Scan::global_reloc_may_be_function_pointer): New function.
	* i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
	(Scan::global_reloc_may_be_function_pointer): New function.
	* x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
	(Scan::global_reloc_may_be_function_pointer): New function.
	(Scan::possible_function_pointer_reloc): New function.
	(Target_x86_64::can_check_for_function_pointers): New function.
	* gc.h (gc_process_relocs): Scan relocation types to determine if
	function pointers were taken for targets that support it.
	* icf.cc (Icf::find_identical_sections): Include functions for
	folding in safe ICF whose pointer is not taken.
	* icf.h (Secn_fptr_taken_set): New typedef.
	(fptr_section_id_): New member.
	(section_has_function_pointers): New function.
	(set_section_has_function_pointers): New function.
	(check_section_for_function_pointers): New function.
	* options.h: Fix comment for safe ICF option.
	* target.h (can_check_for_function_pointers): New function.
	* testsuite/Makefile.am: Add icf_safe_so_test test case.
	Modify icf_safe_test for X86-64.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/icf_safe_so_test.cc: New file.
	* testsuite/icf_safe_so_test.sh: New file.
	* testsuite/icf_safe_test.cc (kept_func_3): New function.
	(main): Change to take pointer to function kept_func_3.
	* testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
	folding is done correctly for X86-64.
2010-02-13 02:04:21 +00:00
Doug Kwan 5ac169d4b6 2010-01-20 Doug Kwan <dougkwan@google.com>
* arm.cc (Target_arm::Arm_input_section_map): Change key type from
	Input_section_specifier to Section_id.
	(Target_arm::new_arm_input_section: Adjust code for change of key
	type.
	(Target_arm::find_arm_input_section): Ditto.
	* gc.h (object.h): Include for Section_id nand Section_id_hash.
	(Section_id): Remove.
	(Garbage_collection::Section_id_hash): Remove.
	* icf.h (object.h): Include for Section_id nand Section_id_hash.
	(Section_id): Remove.
	(Icf::Section_id_hash): Remove.
	* object.h (Section_id, Const_section_id, Section_id_hash,
	Const_section_id_hash): New type definitions.
	* output.cc (Output_section::add_relaxed_input_section): Change to
	use Const_section_id instead of Input_section_specifier as key type.
	(Output_section::add_merge_input_section): Ditto.
	(Output_section::build_relaxation_map): Change to use Section_id
	instead of Input_section_specifier as key type.
 	(Output_section::convert_input_sections_in_list_to_relaxed_sections):
	Ditto.
	(Output_section::convert_input_sections_to_relaxed_sections): Change
	to use Const_section_id instead of Input_section_specifier as key type.
 	(Output_section::find_merge_section): Ditto.
	(Output_section::find_relaxed_input_section): Ditto.
	* output.h (Input_section_specifier): Remove class.
	(Output_section::Output_section_data_by_input_section_map): Change
	key type to Const_section_id.
	(Output_section::Output_relaxed_input_section_by_input_section_map):
	Ditto.
	(Output_section::Relaxation_map): Change key type to Section_id.
2010-01-20 17:29:52 +00:00
Sriraman Tallam 55a2bb3546 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
check for .text or .gnu.linkonce.t sections.
	* icf.cc (Icf::find_identical_sections): Ditto.
	Change the detection for mangled function name within the section
	name.
	* icf.h (is_section_foldable_candidate): New function.
2010-01-04 19:08:39 +00:00
Sriraman Tallam 48c187ced8 Sriraman Tallam <tmsriram@google.com>
* icf.cc (Icf::find_identical_sections): Unfold symbols that have
	been maked as --keep-unique.
	(Icf::unfold_section): New function.
	* icf.h (Icf::unfold_section): New function.
	* options.h (General_options::keep_unique): New option.
	* testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/icf_keep_unique_test.sh: New file.
	* testsuite/icf_keep_unique_test.cc: New file.
2009-08-12 19:03:16 +00:00
Sriraman Tallam ef15dade89 *** empty log message *** 2009-08-05 20:51:56 +00:00