[tip: objtool/core] objtool/klp: Handle Clang .data..Lanon anonymous data sections

tip-bot2 for Josh Poimboeuf posted 1 patch 1 month, 1 week ago
tools/objtool/klp-diff.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
[tip: objtool/core] objtool/klp: Handle Clang .data..Lanon anonymous data sections
Posted by tip-bot2 for Josh Poimboeuf 1 month, 1 week ago
The following commit has been merged into the objtool/core branch of tip:

Commit-ID:     ff0cf5efef40e3b60e7bb27a6072f9a0c6e4c5ce
Gitweb:        https://git.kernel.org/tip/ff0cf5efef40e3b60e7bb27a6072f9a0c6e4c5ce
Author:        Josh Poimboeuf <jpoimboe@kernel.org>
AuthorDate:    Thu, 09 Apr 2026 20:50:35 -07:00
Committer:     Josh Poimboeuf <jpoimboe@kernel.org>
CommitterDate: Mon, 04 May 2026 21:16:04 -07:00

objtool/klp: Handle Clang .data..Lanon anonymous data sections

Clang generates anonymous data sections named .data..Lanon.<hash>.
These need section-symbol references in the same way as .data..Lubsan
(GCC) and .data..L__unnamed_ (Clang UBSAN) sections.  Without this,
convert_reloc_sym() fails when processing relocations that reference
these sections.

Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 tools/objtool/klp-diff.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c
index 463b6da..7e58ef3 100644
--- a/tools/objtool/klp-diff.c
+++ b/tools/objtool/klp-diff.c
@@ -1030,14 +1030,15 @@ found_sym:
 }
 
 /*
- * Sections with anonymous or uncorrelated data (strings, UBSAN data)
- * need section symbol references.
+ * Sections with anonymous or uncorrelated data (strings, UBSAN data, Clang
+ * anonymous constants) need section symbol references.
  */
 static bool is_uncorrelated_section(struct section *sec)
 {
 	return is_string_sec(sec) ||
 	       strstarts(sec->name, ".data..Lubsan") ||		/* GCC */
-	       strstarts(sec->name, ".data..L__unnamed_");	/* Clang */
+	       strstarts(sec->name, ".data..L__unnamed_") ||	/* Clang */
+	       strstarts(sec->name, ".data..Lanon.");		/* Clang */
 }
 
 /*