mirror of
https://github.com/dynup/kpatch
synced 2025-04-29 06:27:59 +00:00
create-diff-object: Ignore unused CSWTCH static local symbols
Fixes #519.
This commit is contained in:
parent
d4d4fb2b0e
commit
ce7ed7007b
@ -1141,8 +1141,20 @@ void kpatch_correlate_static_local_variables(struct kpatch_elf *base,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sec)
|
if (!sec) {
|
||||||
|
/*
|
||||||
|
* CSWTCH is a read-only static local array used by gcc
|
||||||
|
* for some switch statements. If two functions use
|
||||||
|
* the same CSWTCH data, there can be two separate
|
||||||
|
* CSWTCH symbols referring to the same bundled
|
||||||
|
* .rodata.CSWTCH.xxxx section and one of them will be
|
||||||
|
* unused.
|
||||||
|
*/
|
||||||
|
if (!strncmp(sym->name, "CSWTCH.", 7))
|
||||||
|
continue;
|
||||||
|
|
||||||
ERROR("static local variable %s not used", sym->name);
|
ERROR("static local variable %s not used", sym->name);
|
||||||
|
}
|
||||||
|
|
||||||
if (!basesym) {
|
if (!basesym) {
|
||||||
log_normal("WARNING: unable to correlate static local variable %s used by %s, assuming variable is new\n",
|
log_normal("WARNING: unable to correlate static local variable %s used by %s, assuming variable is new\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user