Skip to content

Commit

Permalink
ftrace/recordmcount: Modify only executable sections
Browse files Browse the repository at this point in the history
PROGBITS is not enough to determine if the section should be modified
or not. Only process sections that are marked as executable.

Cc: John Reiser <jreiser@bitwagon.com>
Link: http://lkml.kernel.org/r/20110421023737.991485123@goodmis.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and rostedt committed May 16, 2011
1 parent 9f087e7 commit 8abd572
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/recordmcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ __has_rel_mcount(Elf_Shdr const *const relhdr, /* is SHT_REL or SHT_RELA */
succeed_file();
}
if (w(txthdr->sh_type) != SHT_PROGBITS ||
!(w(txthdr->sh_flags) & SHF_EXECINSTR) ||
!is_mcounted_section_name(txtname))
return NULL;
return txtname;
Expand Down

0 comments on commit 8abd572

Please sign in to comment.