From b3ce541e970466431bf6abfa8ad58424a1d1a7ec Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 28 Jun 2011 21:15:42 +0000 Subject: * target.h (Target::can_check_for_function_pointers): Rewrite. Make non-virtual. (Target::can_icf_inline_merge_sections): Likewise. (Target::section_may_have_icf_unsafe_poineters): Likewise. (Target::Target_info): Add can_icf_inline_merge_sections field. (Target::do_can_check_for_function_pointers): New virtual function. (Target::do_section_may_have_icf_unsafe_pointers): Likewise. * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename from can_check_for_function_pointers, move in file. (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from section_may_have_icf_unsafe_poineters, move in file. (Target_arm::arm_info): Initialize can_icf_inline_merge_sections. * i386.cc (Target_i386::do_can_check_for_function_pointers): Rename from can_check_for_function_pointers, move in file. (Target_i386::can_icf_inline_merge_sections): Remove. (Target_i386::i386_info): Initialize can_icf_inline_merge_sections. * powerpc.cc (Target_powerpc::powerpc_info) [all versions]: Initialize can_icf_inline_merge_sections. * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise. * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers): Rename from can_check_for_function_pointers, move in file. (Target_x86_64::can_icf_inline_merge_sections): Remove. (Target_x86_64::x86_64_info): Initialize can_icf_inline_merge_sections. * testsuite/testfile.cc (Target_test::test_target_info): Likewise. * icf.cc (get_section_contents): Correct formatting. --- gold/arm.cc | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'gold/arm.cc') diff --git a/gold/arm.cc b/gold/arm.cc index c8732e0..bf41bc8 100644 --- a/gold/arm.cc +++ b/gold/arm.cc @@ -1,6 +1,6 @@ // arm.cc -- arm target support for gold. -// Copyright 2009, 2010 Free Software Foundation, Inc. +// Copyright 2009, 2010, 2011 Free Software Foundation, Inc. // Written by Doug Kwan based on the i386 code // by Ian Lance Taylor . // This file also contains borrowed and adapted code from @@ -2182,23 +2182,6 @@ class Target_arm : public Sized_target<32, big_endian> fix_cortex_a8_(false), cortex_a8_relocs_info_() { } - // Virtual function which is set to return true by a target if - // it can use relocation types to determine if a function's - // pointer is taken. - virtual bool - can_check_for_function_pointers() const - { return true; } - - // Whether a section called SECTION_NAME may have function pointers to - // sections not eligible for safe ICF folding. - virtual bool - section_may_have_icf_unsafe_pointers(const char* section_name) const - { - return (!is_prefix_of(".ARM.exidx", section_name) - && !is_prefix_of(".ARM.extab", section_name) - && Target::section_may_have_icf_unsafe_pointers(section_name)); - } - // Whether we can use BLX. bool may_use_blx() const @@ -2553,6 +2536,23 @@ class Target_arm : public Sized_target<32, big_endian> arm_reloc_property_table = new Arm_reloc_property_table(); } + // Virtual function which is set to return true by a target if + // it can use relocation types to determine if a function's + // pointer is taken. + virtual bool + do_can_check_for_function_pointers() const + { return true; } + + // Whether a section called SECTION_NAME may have function pointers to + // sections not eligible for safe ICF folding. + virtual bool + do_section_may_have_icf_unsafe_pointers(const char* section_name) const + { + return (!is_prefix_of(".ARM.exidx", section_name) + && !is_prefix_of(".ARM.extab", section_name) + && Target::do_section_may_have_icf_unsafe_pointers(section_name)); + } + private: // The class which scans relocations. class Scan @@ -2946,6 +2946,7 @@ const Target::Target_info Target_arm::arm_info = false, // has_resolve false, // has_code_fill true, // is_default_stack_executable + false, // can_icf_inline_merge_sections '\0', // wrap_char "/usr/lib/libc.so.1", // dynamic_linker 0x8000, // default_text_segment_address -- cgit v1.1