mirror of https://github.com/dynup/kpatch
create-diff-object: Support dynamic debug on newer kernels
After Linux commit 47cdd64be483 ("dynamic_debug: refactor dynamic_pr_debug and friends"), the name of the static local variable used for dynamic printks is no longer "descriptor". Make the is_special_static() check broader such that it doesn't care about the variable name, and just whitelists any variable in the __verbose section. Fixes #990. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
This commit is contained in:
parent
3b936efa10
commit
7b367a4ef5
|
@ -249,7 +249,6 @@ static int is_special_static(struct symbol *sym)
|
||||||
static char *prefixes[] = {
|
static char *prefixes[] = {
|
||||||
"__key.",
|
"__key.",
|
||||||
"__warned.",
|
"__warned.",
|
||||||
"descriptor.",
|
|
||||||
"__func__.",
|
"__func__.",
|
||||||
"__FUNCTION__.",
|
"__FUNCTION__.",
|
||||||
"_rs.",
|
"_rs.",
|
||||||
|
@ -261,12 +260,13 @@ static int is_special_static(struct symbol *sym)
|
||||||
if (!sym)
|
if (!sym)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (sym->type == STT_SECTION) {
|
/* pr_debug() uses static local variables in the __verbose section */
|
||||||
/* __verbose section contains the descriptor variables */
|
if ((sym->type == STT_OBJECT && !strcmp(sym->sec->name, "__verbose")) ||
|
||||||
if (!strcmp(sym->name, "__verbose"))
|
(sym->type == STT_SECTION && !strcmp(sym->name, "__verbose")))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* otherwise make sure section is bundled */
|
if (sym->type == STT_SECTION) {
|
||||||
|
/* make sure section is bundled */
|
||||||
if (!sym->sec->sym)
|
if (!sym->sec->sym)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -1117,8 +1117,8 @@ static void kpatch_correlate_static_local_variables(struct kpatch_elf *base,
|
||||||
if (bundled != patched_bundled)
|
if (bundled != patched_bundled)
|
||||||
ERROR("bundle mismatch for symbol %s", sym->name);
|
ERROR("bundle mismatch for symbol %s", sym->name);
|
||||||
if (!bundled && sym->sec->twin != patched_sym->sec)
|
if (!bundled && sym->sec->twin != patched_sym->sec)
|
||||||
ERROR("sections %s and %s aren't correlated",
|
ERROR("sections %s and %s aren't correlated for symbol %s",
|
||||||
sym->sec->name, patched_sym->sec->name);
|
sym->sec->name, patched_sym->sec->name, sym->name);
|
||||||
|
|
||||||
log_debug("renaming and correlating static local %s to %s\n",
|
log_debug("renaming and correlating static local %s to %s\n",
|
||||||
patched_sym->name, sym->name);
|
patched_sym->name, sym->name);
|
||||||
|
|
Loading…
Reference in New Issue