File tree Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -1866,6 +1866,29 @@ static int read_unwind_hints(struct objtool_file *file)
1866
1866
return 0 ;
1867
1867
}
1868
1868
1869
+ static int read_noendbr_hints (struct objtool_file * file )
1870
+ {
1871
+ struct section * sec ;
1872
+ struct instruction * insn ;
1873
+ struct reloc * reloc ;
1874
+
1875
+ sec = find_section_by_name (file -> elf , ".rela.discard.noendbr" );
1876
+ if (!sec )
1877
+ return 0 ;
1878
+
1879
+ list_for_each_entry (reloc , & sec -> reloc_list , list ) {
1880
+ insn = find_insn (file , reloc -> sym -> sec , reloc -> sym -> offset + reloc -> addend );
1881
+ if (!insn ) {
1882
+ WARN ("bad .discard.noendbr entry" );
1883
+ return -1 ;
1884
+ }
1885
+
1886
+ insn -> noendbr = 1 ;
1887
+ }
1888
+
1889
+ return 0 ;
1890
+ }
1891
+
1869
1892
static int read_retpoline_hints (struct objtool_file * file )
1870
1893
{
1871
1894
struct section * sec ;
@@ -2099,6 +2122,10 @@ static int decode_sections(struct objtool_file *file)
2099
2122
if (ret )
2100
2123
return ret ;
2101
2124
2125
+ ret = read_noendbr_hints (file );
2126
+ if (ret )
2127
+ return ret ;
2128
+
2102
2129
/*
2103
2130
* Must be before add_{jump_call}_destination.
2104
2131
*/
Original file line number Diff line number Diff line change @@ -45,11 +45,18 @@ struct instruction {
45
45
unsigned int len ;
46
46
enum insn_type type ;
47
47
unsigned long immediate ;
48
- bool dead_end , ignore , ignore_alts ;
49
- bool hint ;
50
- bool retpoline_safe ;
48
+
49
+ u8 dead_end : 1 ,
50
+ ignore : 1 ,
51
+ ignore_alts : 1 ,
52
+ hint : 1 ,
53
+ retpoline_safe : 1 ,
54
+ noendbr : 1 ;
55
+ /* 2 bit hole */
51
56
s8 instr ;
52
57
u8 visited ;
58
+ /* u8 hole */
59
+
53
60
struct alt_group * alt_group ;
54
61
struct symbol * call_dest ;
55
62
struct instruction * jump_dest ;
You can’t perform that action at this time.
0 commit comments