aboutsummaryrefslogtreecommitdiff
path: root/gold/icf.h
diff options
context:
space:
mode:
Diffstat (limited to 'gold/icf.h')
-rw-r--r--gold/icf.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/gold/icf.h b/gold/icf.h
index b87b992..de0fbe0 100644
--- a/gold/icf.h
+++ b/gold/icf.h
@@ -1,6 +1,6 @@
// icf.h -- Identical Code Folding
-// Copyright 2009 Free Software Foundation, Inc.
+// Copyright 2009, 2010 Free Software Foundation, Inc.
// Written by Sriraman Tallam <tmsriram@google.com>.
// This file is part of gold.
@@ -139,6 +139,17 @@ class Icf
Addend_list addend_reloc_list_;
};
+// This function returns true if this section corresponds to a function that
+// should be considered by icf as a possible candidate for folding. Some
+// 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)
+{
+ return (is_prefix_of(".text", section_name)
+ || is_prefix_of(".gnu.linkonce.t", section_name));
+}
+
} // End of namespace gold.
#endif