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
26 struct list_head retpoline_call_list;26 struct list_head retpoline_call_list;
27 struct list_head static_call_list;27 struct list_head static_call_list;
28 struct list_head mcount_loc_list;28 struct list_head mcount_loc_list;
29 struct list_head endbr_list;
29 bool ignore_unreachables, c_file, hints, rodata;30 bool ignore_unreachables, c_file, hints, rodata;
30 31
31 unsigned int nr_endbr;32 unsigned int nr_endbr;