Skip to content

create-diff-object fails to find new static functions in some cases #834

@euspectre

Description

@euspectre

If a source patch adds a global function foo() that takes a callback as an argument, and a static function bar() that is used as such callback, create-diff-object may fail to find bar() in some cases. Namely, - if foo() is defined in one source file, but called in another source file where bar() is defined.

Example:
new-static-callback.patch

create-diff-object complains as follows:

base.o: new function: foo
meminfo.o: changed function: meminfo_proc_open
meminfo.o: new function: bar
/usr/libexec/kpatch/create-diff-object: ERROR: meminfo.o: kpatch_create_intermediate_sections: 2485: lookup_local_symbol bar needed for .text.meminfo_proc_open
ERROR: 1 error(s) encountered.

A workaround is simple: just make the callback bar() non-static. The binary patch is built successfully and works OK in that case, so this issue is not that critical.

I guess, I probably missed some special case when preparing the patch for #755, but I haven't dug into this yet.

x86_64, OS: Virtuozzo 7, kpatch 0.5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions