• Jann Horn's avatar
    objtool: Support repeated uses of the same C jump table · bd98c813
    Jann Horn authored
    This fixes objtool for both a GCC issue and a Clang issue:
    
    1) GCC issue:
    
       kernel/bpf/core.o: warning: objtool: ___bpf_prog_run()+0x8d5: sibling call from callable instruction with modified stack frame
    
       With CONFIG_RETPOLINE=n, GCC is doing the following optimization in
       ___bpf_prog_run().
    
       Before:
    
               select_insn:
                       jmp *jumptable(,%rax,8)
                       ...
               ALU64_ADD_X:
                       ...
                       jmp select_insn
               ALU_ADD_X:
                       ...
                       jmp select_insn
    
       After:
    
               select_insn:
                       jmp *jumptable(, %rax, 8)
                       ...
               ALU64_ADD_X:
                       ...
                       jmp *jumptable(, %rax, 8)
               ALU_ADD_X:
                       ...
                       jmp *jumptable(, %rax, 8)
    
       This confuses objtool.  It has never seen multiple indirect jump
       sites which use the same jump table.
    
       F...
    bd98c813
elf.h 2.43 KB