Allow changing the fentry section per file and per function
authorAndi Kleen <ak@linux.intel.com>
Thu, 29 Nov 2018 23:11:59 +0000 (23:11 +0000)
committerAndi Kleen <ak@gcc.gnu.org>
Thu, 29 Nov 2018 23:11:59 +0000 (23:11 +0000)
commit1c31f6c896e9ff74e14a491775f154aa3a825ee6
tree63a5b6409a3193e6e16f6854a1a4f91d929f5cc5
parentd7bf0bd696eaa7611ca97285347f8e3e604feefd
Allow changing the fentry section per file and per function

When dynamically patching in/out instrumentation it can be useful
to handle different classes of functions differently. Add support
for changing the fentry section name on the command line
or as a function attributes. This allows to mark functions differently,
and handle them differently in dynamic patching.

gcc/:

2018-11-29  Andi Kleen  <ak@linux.intel.com>

* config/i386/i386.c (current_fentry_section): Add.
(x86_function_profiler): Handle fentry section.
(ix86_attribute_table): Add fentry section.
* config/i386/i386.opt: Add -mfentry-section.
* doc/extend.texi: Document fentry_section attribute.
* doc/invoke.texi: Document -mfentry-section.

gcc/testsuite/:

2018-11-29  Andi Kleen  <ak@linux.intel.com>

* gcc.target/i386/fentryname2.c: New test.
* gcc.target/i386/fentryname3.c: New test.

From-SVN: r266654
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.opt
gcc/doc/extend.texi
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/fentryname2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/fentryname3.c [new file with mode: 0644]