ftrace/recordmcount: Modify only executable sections
authorSteven Rostedt <[email protected]>
Wed, 13 Apr 2011 17:31:08 +0000 (13:31 -0400)
committerSteven Rostedt <[email protected]>
Mon, 16 May 2011 18:42:56 +0000 (14:42 -0400)
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 <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Steven Rostedt <[email protected]>
scripts/recordmcount.h

index ac7b3303cb3136c5171b5b27fb8792136221891b..7f8d5c4c780f7f5a43386ccf524f7e221083c127 100644 (file)
@@ -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;