History

objtool: Find unused ENDBR instructions

Find all ENDBR instructions which are never referenced and stick them in a section such that the kernel can poison them, sealing the functions from ever being an indirect call target. This removes about 1-in-4 ENDBR instructions.

Peter Zijlstra committed 4 years ago

Commit 89bc8531 parent 08f87a94 files · +78 −2Browse files

Showing the changes to tools/objtool/include (1 of 4 files). Show all

Unified · Split

tools/objtool/include/objtool/objtool.h+1−0
@@ -26,6 +26,7 @@ struct objtool_file { · 25 unmodified lines
2626 struct list_head retpoline_call_list;
2727 struct list_head static_call_list;
2828 struct list_head mcount_loc_list;
29+ struct list_head endbr_list;
2930 bool ignore_unreachables, c_file, hints, rodata;
3031
3132 unsigned int nr_endbr;