From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 675183858413; Fri, 3 Dec 2021 13:13:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 675183858413 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/83782] [9/10/11/12 Regression] Inconsistent address for hidden ifunc in a shared library Date: Fri, 03 Dec 2021 13:13:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 7.2.1 X-Bugzilla-Keywords: ABI X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2021 13:13:25 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D83782 --- Comment #3 from CVS Commits --- The master branch has been updated by H.J. Lu : https://gcc.gnu.org/g:f7854b908977adce4ff669c4e0332ef868568b7c commit r12-5771-gf7854b908977adce4ff669c4e0332ef868568b7c Author: H.J. Lu Date: Sat Jun 19 08:16:45 2021 -0700 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.=