File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -648,3 +648,8 @@ int arch_decode_hint_reg(struct instruction *insn, u8 sp_reg)
648
648
649
649
return 0 ;
650
650
}
651
+
652
+ bool arch_is_retpoline (struct symbol * sym )
653
+ {
654
+ return !strncmp (sym -> name , "__x86_indirect_" , 15 );
655
+ }
Original file line number Diff line number Diff line change @@ -850,6 +850,11 @@ static int add_ignore_alternatives(struct objtool_file *file)
850
850
return 0 ;
851
851
}
852
852
853
+ __weak bool arch_is_retpoline (struct symbol * sym )
854
+ {
855
+ return false;
856
+ }
857
+
853
858
/*
854
859
* Find the destination instructions for all jumps.
855
860
*/
@@ -872,7 +877,7 @@ static int add_jump_destinations(struct objtool_file *file)
872
877
} else if (reloc -> sym -> type == STT_SECTION ) {
873
878
dest_sec = reloc -> sym -> sec ;
874
879
dest_off = arch_dest_reloc_offset (reloc -> addend );
875
- } else if (! strncmp (reloc -> sym -> name , "__x86_indirect_thunk_" , 21 )) {
880
+ } else if (arch_is_retpoline (reloc -> sym )) {
876
881
/*
877
882
* Retpoline jumps are really dynamic jumps in
878
883
* disguise, so convert them accordingly.
@@ -1026,7 +1031,7 @@ static int add_call_destinations(struct objtool_file *file)
1026
1031
return -1 ;
1027
1032
}
1028
1033
1029
- } else if (! strncmp (reloc -> sym -> name , "__x86_indirect_thunk_" , 21 )) {
1034
+ } else if (arch_is_retpoline (reloc -> sym )) {
1030
1035
/*
1031
1036
* Retpoline calls are really dynamic calls in
1032
1037
* disguise, so convert them accordingly.
Original file line number Diff line number Diff line change @@ -86,4 +86,6 @@ const char *arch_nop_insn(int len);
86
86
87
87
int arch_decode_hint_reg (struct instruction * insn , u8 sp_reg );
88
88
89
+ bool arch_is_retpoline (struct symbol * sym );
90
+
89
91
#endif /* _ARCH_H */
You can’t perform that action at this time.
0 commit comments