diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-06-19 08:16:45 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-12-03 05:12:30 -0800 |
commit | f7854b908977adce4ff669c4e0332ef868568b7c (patch) | |
tree | d2f77c87c4dd0166bbb3f636f2d7d717a26eed12 /gcc/doc/tm.texi | |
parent | 97ffef3553267f52ca83dbebdcc8b5e3739febee (diff) | |
download | gcc-f7854b908977adce4ff669c4e0332ef868568b7c.zip gcc-f7854b908977adce4ff669c4e0332ef868568b7c.tar.gz gcc-f7854b908977adce4ff669c4e0332ef868568b7c.tar.bz2 |
Add TARGET_IFUNC_REF_LOCAL_OK
1. On some targets, like PowerPC, reference to ifunc function resolver
must be non-local so that compiler will properly emit PLT call. Add
TARGET_IFUNC_REF_LOCAL_OK to allow binding indirect function resolver
locally for targets which don't require special PLT call sequence.
2. Add ix86_call_use_plt_p to call local ifunc function resolvers via
PLT.
gcc/
PR target/51469
PR target/83782
* target.def (ifunc_ref_local_ok): Add a target hook.
* varasm.c (default_binds_local_p_3): Force indirect function
resolver non-local only if targetm.ifunc_ref_local_ok returns
false.
* config/i386/i386-expand.c (ix86_expand_call): Call
ix86_call_use_plt_p to check if PLT should be used.
* config/i386/i386-protos.h (ix86_call_use_plt_p): New.
* config/i386/i386.c (output_pic_addr_const): Call
ix86_call_use_plt_p to check if "@PLT" is needed.
(ix86_call_use_plt_p): New.
(TARGET_IFUNC_REF_LOCAL_OK): New.
* doc/tm.texi.in: Add TARGET_IFUNC_REF_LOCAL_OK.
* doc/tm.texi: Regenerated.
gcc/testsuite/
PR target/51469
PR target/83782
* gcc.target/i386/pr83782-1.c: New test.
* gcc.target/i386/pr83782-2.c: Likewise.
Diffstat (limited to 'gcc/doc/tm.texi')
-rw-r--r-- | gcc/doc/tm.texi | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 6ec1d50..78cc1a2 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -12359,6 +12359,11 @@ The support includes the assembler, linker and dynamic linker. The default value of this hook is based on target's libc. @end deftypefn +@deftypefn {Target Hook} bool TARGET_IFUNC_REF_LOCAL_OK (void) +Return true if it is OK to reference indirect function resolvers +locally. The default is to return false. +@end deftypefn + @deftypefn {Target Hook} {unsigned int} TARGET_ATOMIC_ALIGN_FOR_MODE (machine_mode @var{mode}) If defined, this function returns an appropriate alignment in bits for an atomic object of machine_mode @var{mode}. If 0 is returned then the |