diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2018-07-16 14:29:08 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2018-07-16 14:29:08 +0000 |
commit | 6902799c8d1470fd8a55754cc1caf0bb442472e9 (patch) | |
tree | 4737ab3fe3006a96ff3d3df645c23b717060c2b5 /gcc/expr.c | |
parent | 96e4fda582406cea5c33cecc54cb4f6d1ba8083f (diff) | |
download | gcc-6902799c8d1470fd8a55754cc1caf0bb442472e9.zip gcc-6902799c8d1470fd8a55754cc1caf0bb442472e9.tar.gz gcc-6902799c8d1470fd8a55754cc1caf0bb442472e9.tar.bz2 |
S/390: Add direct support for Linux kernel __fentry__ patching.
On i386, the difference between mcount and fentry is that fentry
comes before the prolog. On s390 mcount already comes before the
prolog, but takes 4 instructions. This patch introduces the more
efficient implementation (just 1 instruction) and puts it under
-mfentry flag.
The produced code is compatible only with newer glibc versions,
which provide the __fentry__ symbol and do not clobber %r0 when
resolving lazily bound functions. Because 31-bit PLT stubs assume
%r12 contains GOT address, which is not the case when the code runs
before the prolog, -mfentry is allowed only for 64-bit code.
Also, code compiled with -mfentry cannot be used for the nested C
functions, since they both use %r0. In this case instrumentation is
not insterted, and a new warning is issued for each affected nested
function.
2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com>
* common.opt: Add the new warning.
* config/s390/s390.c (s390_function_profiler): Emit "brasl
%r0,__fentry__" when -mfentry is specified.
(s390_option_override_internal): Disallow -mfentry for 31-bit
CPUs.
* config/s390/s390.opt: Add the new option.
2018-07-16 Ilya Leoshkevich <iii@linux.ibm.com>
* gcc.target/s390/mfentry-m64.c: New testcase.
From-SVN: r262732
Diffstat (limited to 'gcc/expr.c')
0 files changed, 0 insertions, 0 deletions