X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gold%2Ficf.h;h=7faf81635aaf9f08abd9705415c2dccab4116bc1;hb=55c144e691ec05a7b8231b5c58dc6d6659a1c4eb;hp=c968c9daa2219d4e778f4ef172bb4c33dddf743f;hpb=8a75a161b2c2b23f87f986e186c18dc5e267753f;p=deliverable%2Fbinutils-gdb.git diff --git a/gold/icf.h b/gold/icf.h index c968c9daa2..7faf81635a 100644 --- a/gold/icf.h +++ b/gold/icf.h @@ -1,6 +1,6 @@ // icf.h -- Identical Code Folding -// Copyright 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2009-2015 Free Software Foundation, Inc. // Written by Sriraman Tallam . // This file is part of gold. @@ -43,6 +43,7 @@ class Icf typedef std::vector Symbol_info; typedef std::vector > Addend_info; typedef std::vector Offset_info; + typedef std::vector Reloc_addend_size_info; typedef Unordered_map Uniq_secn_id_map; @@ -57,6 +58,7 @@ class Icf // This stores the symbol value and the addend for a reloc. Addend_info addend_info; Offset_info offset_info; + Reloc_addend_size_info reloc_addend_size_info; } Reloc_info; typedef Unordered_mapfptr_section_id_.find(Section_id(obj, shndx)) != this->fptr_section_id_.end()); @@ -112,7 +114,7 @@ class Icf // Records that a pointer of the function defined in this section // is taken. void - set_section_has_function_pointers(Object *obj, unsigned int shndx) + set_section_has_function_pointers(Relobj* obj, unsigned int shndx) { this->fptr_section_id_.insert(Section_id(obj, shndx)); } @@ -134,7 +136,7 @@ class Icf Reloc_info_list& reloc_info_list() { return this->reloc_info_list_; } - + // Returns a mapping of each section to a unique integer. Uniq_secn_id_map& section_to_int_map() @@ -154,7 +156,6 @@ class Icf // function is taken in which case it is dangerous to fold // this function. Secn_fptr_taken_set fptr_section_id_; - unsigned int* num_tracked_relocs; // Flag to indicate if ICF has been run. bool icf_ready_; // This list is populated by gc_process_relocs in gc.h. @@ -166,10 +167,11 @@ class Icf // earlier gcc versions, like 4.0.3, put constructors and destructors in // .gnu.linkonce.t sections and hence should be included too. inline bool -is_section_foldable_candidate(const char* section_name) +is_section_foldable_candidate(const std::string& section_name) { - return (is_prefix_of(".text", section_name) - || is_prefix_of(".gnu.linkonce.t", section_name)); + const char* section_name_cstr = section_name.c_str(); + return (is_prefix_of(".text", section_name_cstr) + || is_prefix_of(".gnu.linkonce.t", section_name_cstr)); } } // End of namespace gold.