Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / tools / objtool / check.c
index ac743a1..7325d89 100644 (file)
@@ -28,6 +28,8 @@
 #include <linux/hashtable.h>
 #include <linux/kernel.h>
 
+#define FAKE_JUMP_OFFSET -1
+
 struct alternative {
        struct list_head list;
        struct instruction *insn;
@@ -568,7 +570,7 @@ static int add_jump_destinations(struct objtool_file *file)
                    insn->type != INSN_JUMP_UNCONDITIONAL)
                        continue;
 
-               if (insn->ignore)
+               if (insn->ignore || insn->offset == FAKE_JUMP_OFFSET)
                        continue;
 
                rela = find_rela_by_dest_range(insn->sec, insn->offset,
@@ -745,10 +747,10 @@ static int handle_group_alt(struct objtool_file *file,
                clear_insn_state(&fake_jump->state);
 
                fake_jump->sec = special_alt->new_sec;
-               fake_jump->offset = -1;
+               fake_jump->offset = FAKE_JUMP_OFFSET;
                fake_jump->type = INSN_JUMP_UNCONDITIONAL;
                fake_jump->jump_dest = list_next_entry(last_orig_insn, list);
-               fake_jump->ignore = true;
+               fake_jump->func = orig_insn->func;
        }
 
        if (!special_alt->new_len) {
@@ -1957,7 +1959,8 @@ static int validate_branch(struct objtool_file *file, struct instruction *first,
                        return 1;
                }
 
-               func = insn->func ? insn->func->pfunc : NULL;
+               if (insn->func)
+                       func = insn->func->pfunc;
 
                if (func && insn->ignore) {
                        WARN_FUNC("BUG: why am I validating an ignored function?",