diff mbox series

[5/7] create-diff-object: add .text.hot to the list of bundleable functions

Message ID 20250116175214.83742-6-roger.pau@citrix.com (mailing list archive)
State New
Headers show
Series livepatch-build-tools: fixes for handling .cold and .hot sections | expand

Commit Message

Roger Pau Monné Jan. 16, 2025, 5:52 p.m. UTC
From: Artem Savkov <asavkov@redhat.com>

According to gcc8's man pages gcc can put functions into .text.unlikely
or .text.hot subfunctions during optimization. Add ".text.hot" to the
list of bundleable functions in is_bundleable().

Signed-off-by: Artem Savkov <asavkov@redhat.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 common.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/common.c b/common.c
index 84ca14d3e397..b46fcf5cb6ca 100644
--- a/common.c
+++ b/common.c
@@ -131,6 +131,11 @@  static int is_bundleable(struct symbol *sym)
 			  !strncmp(sym->sec->name + 15, sym->name, strlen(sym->sec->name) - 15))))
 		return 1;
 
+	if (sym->type == STT_FUNC &&
+	    !strncmp(sym->sec->name, ".text.hot.",10) &&
+	    !strcmp(sym->sec->name + 10, sym->name))
+		return 1;
+
 	if (sym->type == STT_OBJECT &&
 	   !strncmp(sym->sec->name, ".data.",6) &&
 	   !strcmp(sym->sec->name + 6, sym->name))