From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BBA3A3858C52; Tue, 28 Feb 2023 06:31:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BBA3A3858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677565877; bh=IT+1tfdPU45UcySv+hizzgYfezC8JyIEGFLdI7ne7po=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wsnmo64la/6Qt3JkSvsBdJLDnbmJ7zUwDJt5OMgUgKUsJaGoFZaU+ikjKgxX10c8Z vTA9Da339vwfK8w5kY+b6buwvQ33xR6IbOdM416RB28h39Qpy3NGX722xxJOHUXZPe 8mdETRnREG9v+AqIwfTXiXJhfKyvH/YJk8aya5wc= From: "amonakov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108315] -mcpu=power10 changes ABI Date: Tue, 28 Feb 2023 06:31:17 +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: 13.0 X-Bugzilla-Keywords: ABI, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: amonakov at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108315 --- Comment #4 from Alexander Monakov --- Let me address one point separately: (In reply to Peter Bergner from comment #1) > CCing Alan, since he probably knows best how this all works, but yes, > -mcpu-power10 changes the ABI, namely it adds pcrel support which is an A= BI > extension, where the function compiled with -mcpu=3Dpower10 doesn't use r= 2 to > access its GOT, but uses pcrel code instead. I think copying over a p10 > compiled asm or obj file to a p9 system and them linking there with a > non-p10 aware compiler/binutils seems to be a user error on my part. Just > because the -mcpu=3Dpower10 compiled file doesn't use any p10 instructions > doesn't mean it's safe to use on a pre-p10 system. >=20 > I'll let Alan correct me if I'm wrong, but this seems like user error to = me. And the user deserves to get a silently mislinked executable that mysteriou= sly fails at runtime [*] because it's the users' job to tag static libraries wi= th minimum required ABI level, not the toolchain's. Yeah. [*] it does not immediately segfault when returning from a localentry 1 function; it just continues with wrong r2, that may very well point to valid memory=