aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index 60fabb8..62b4cad 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -2409,6 +2409,20 @@ Layout::relaxation_loop_body(
return off;
}
+// By default, gold groups input sections with certain prefixes. This
+// function returns true if this section name NAME contains such a prefix.
+
+bool
+Layout::is_section_name_prefix_grouped(const char *name)
+{
+ if (is_prefix_of(".text.unlikely", name)
+ || is_prefix_of(".text.startup", name)
+ || is_prefix_of(".text.hot", name))
+ return true;
+
+ return false;
+}
+
// Search the list of patterns and find the postion of the given section
// name in the output section. If the section name matches a glob
// pattern and a non-glob name, then the non-glob position takes