]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
objtool: Avoid emptying lists for duplicate sections
authorJosh Poimboeuf <jpoimboe@kernel.org>
Wed, 17 Sep 2025 16:03:41 +0000 (09:03 -0700)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 14 Oct 2025 21:46:47 +0000 (14:46 -0700)
When a to-be-created section already exists, there's no point in
emptying the various lists if their respective sections already exist.
In fact it's better to leave them intact as they might get used later.

Acked-by: Petr Mladek <pmladek@suse.com>
Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
tools/objtool/check.c

index 473e73722d5c1b484d8cc6d243f85e3fe50ba37e..e567a625b9e0940b440914eb7a59cecb41669c40 100644 (file)
@@ -635,7 +635,6 @@ static int create_static_call_sections(struct objtool_file *file)
 
        sec = find_section_by_name(file->elf, ".static_call_sites");
        if (sec) {
-               INIT_LIST_HEAD(&file->static_call_list);
                WARN("file already has .static_call_sites section, skipping");
                return 0;
        }
@@ -851,7 +850,6 @@ static int create_cfi_sections(struct objtool_file *file)
 
        sec = find_section_by_name(file->elf, ".cfi_sites");
        if (sec) {
-               INIT_LIST_HEAD(&file->call_list);
                WARN("file already has .cfi_sites section, skipping");
                return 0;
        }
@@ -900,7 +898,6 @@ static int create_mcount_loc_sections(struct objtool_file *file)
 
        sec = find_section_by_name(file->elf, "__mcount_loc");
        if (sec) {
-               INIT_LIST_HEAD(&file->mcount_loc_list);
                WARN("file already has __mcount_loc section, skipping");
                return 0;
        }
@@ -945,7 +942,6 @@ static int create_direct_call_sections(struct objtool_file *file)
 
        sec = find_section_by_name(file->elf, ".call_sites");
        if (sec) {
-               INIT_LIST_HEAD(&file->call_list);
                WARN("file already has .call_sites section, skipping");
                return 0;
        }