Merge branch 'linus' into objtool/core, to pick up Xen dependencies
[linux-block.git] / tools / objtool / check.c
index 94b518c12f9afe3fe577b9937bb4f8521b4e8453..ba07a8ebaf7310c872c154594145e2205203e5f7 100644 (file)
@@ -690,6 +690,7 @@ static int create_static_call_sections(struct objtool_file *file)
                if (strncmp(key_name, STATIC_CALL_TRAMP_PREFIX_STR,
                            STATIC_CALL_TRAMP_PREFIX_LEN)) {
                        WARN("static_call: trampoline name malformed: %s", key_name);
+                       free(key_name);
                        return -1;
                }
                tmp = key_name + STATIC_CALL_TRAMP_PREFIX_LEN - STATIC_CALL_KEY_PREFIX_LEN;
@@ -699,6 +700,7 @@ static int create_static_call_sections(struct objtool_file *file)
                if (!key_sym) {
                        if (!opts.module) {
                                WARN("static_call: can't find static_call_key symbol: %s", tmp);
+                               free(key_name);
                                return -1;
                        }
 
@@ -856,8 +858,15 @@ static int create_ibt_endbr_seal_sections(struct objtool_file *file)
        list_for_each_entry(insn, &file->endbr_list, call_node) {
 
                int *site = (int *)sec->data->d_buf + idx;
+               struct symbol *sym = insn->sym;
                *site = 0;
 
+               if (opts.module && sym && sym->type == STT_FUNC &&
+                   insn->offset == sym->offset &&
+                   (!strcmp(sym->name, "init_module") ||
+                    !strcmp(sym->name, "cleanup_module")))
+                       WARN("%s(): not an indirect call target", sym->name);
+
                if (elf_add_reloc_to_insn(file->elf, sec,
                                          idx * sizeof(int),
                                          R_X86_64_PC32,