https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108315

--- Comment #4 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
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 ABI
> extension, where the function compiled with -mcpu=power10 doesn't use r2 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=power10 compiled file doesn't use any p10 instructions
> doesn't mean it's safe to use on a pre-p10 system.
> 
> 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 mysteriously
fails at runtime [*] because it's the users' job to tag static libraries with
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

Reply via email to