Skip to content

Commit df75656

Browse files
committed
CDO: Handle dynamic debug UNIQUE_ID with LLVM
With LLVM, dynamic debug unique id looks like: <func_name>.__UNIQUE_ID_ddebug<number>. Use __kpatch_unique_id_strcmp to compare them. Signed-off-by: Song Liu <song@kernel.org>
1 parent a04e6e9 commit df75656

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

kpatch-build/create-diff-object.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static unsigned int function_padding_size(struct kpatch_elf *kelf, struct symbol
281281
size = 8;
282282
else if (i != 0)
283283
log_error("function %s within section %s has invalid padding\n", sym->name, sym->sec->name);
284-
284+
285285
break;
286286
}
287287
default:
@@ -519,6 +519,15 @@ static int kpatch_mangled_strcmp(char *s1, char *s2)
519519
if (!strncmp(s1, "__UNIQUE_ID_", 12))
520520
return __kpatch_unique_id_strcmp(s1, s2);
521521

522+
/*
523+
* With LLVM, dynamic debug unique id looks like
524+
* <func_name>.__UNIQUE_ID_ddebug<number>.
525+
*
526+
* Use __kpatch_unique_id_strcmp to compare them.
527+
*/
528+
if (strstr(s1, "__UNIQUE_ID_ddebug"))
529+
return __kpatch_unique_id_strcmp(s1, s2);
530+
522531
while (*s1 == *s2) {
523532
if (!*s1)
524533
return 0;

0 commit comments

Comments
 (0)