objtool: Detect jumps to retpoline thunks
[sfrench/cifs-2.6.git] / tools / objtool / check.c
index 9b341584eb1b56b05761bea127ee6cf94eacc190..de053fb7049b04623b034c9369f9049a14d0b05e 100644 (file)
@@ -456,6 +456,13 @@ static int add_jump_destinations(struct objtool_file *file)
                } else if (rela->sym->sec->idx) {
                        dest_sec = rela->sym->sec;
                        dest_off = rela->sym->sym.st_value + rela->addend + 4;
+               } else if (strstr(rela->sym->name, "_indirect_thunk_")) {
+                       /*
+                        * Retpoline jumps are really dynamic jumps in
+                        * disguise, so convert them accordingly.
+                        */
+                       insn->type = INSN_JUMP_DYNAMIC;
+                       continue;
                } else {
                        /* sibling call */
                        insn->jump_dest = 0;