@@ -266,7 +266,8 @@ static int decode_instructions(struct objtool_file *file)
266
266
strncmp (sec -> name , ".discard." , 9 ))
267
267
sec -> text = true;
268
268
269
- if (!strcmp (sec -> name , ".noinstr.text" ))
269
+ if (!strcmp (sec -> name , ".noinstr.text" ) ||
270
+ !strcmp (sec -> name , ".entry.text" ))
270
271
sec -> noinstr = true;
271
272
272
273
for (offset = 0 ; offset < sec -> len ; offset += insn -> len ) {
@@ -2071,7 +2072,7 @@ static inline const char *call_dest_name(struct instruction *insn)
2071
2072
static int validate_call (struct instruction * insn , struct insn_state * state )
2072
2073
{
2073
2074
if (state -> noinstr && state -> instr <= 0 &&
2074
- (!insn -> call_dest || insn -> call_dest -> sec != insn -> sec )) {
2075
+ (!insn -> call_dest || ! insn -> call_dest -> sec -> noinstr )) {
2075
2076
WARN_FUNC ("call to %s() leaves .noinstr.text section" ,
2076
2077
insn -> sec , insn -> offset , call_dest_name (insn ));
2077
2078
return 1 ;
@@ -2558,11 +2559,16 @@ static int validate_vmlinux_functions(struct objtool_file *file)
2558
2559
int warnings = 0 ;
2559
2560
2560
2561
sec = find_section_by_name (file -> elf , ".noinstr.text" );
2561
- if (!sec )
2562
- return 0 ;
2562
+ if (sec ) {
2563
+ warnings += validate_section (file , sec );
2564
+ warnings += validate_unwind_hints (file , sec );
2565
+ }
2563
2566
2564
- warnings += validate_section (file , sec );
2565
- warnings += validate_unwind_hints (file , sec );
2567
+ sec = find_section_by_name (file -> elf , ".entry.text" );
2568
+ if (sec ) {
2569
+ warnings += validate_section (file , sec );
2570
+ warnings += validate_unwind_hints (file , sec );
2571
+ }
2566
2572
2567
2573
return warnings ;
2568
2574
}
0 commit comments