PowerPC: ignore sticky options for .machine
Franz Sirl
Franz.Sirl-kernel@lauterbach.com
Tue Jul 27 14:51:38 GMT 2021
Am 2021-07-23 um 13:23 schrieb Alan Modra:
> PowerPC gas and objdump for a long time have allowed certain -m/-M
> options that extend a base cpu with extra functional units to be
> specified before the base cpu. For example, "-maltivec -mpower4" is
> the same as "-mpower4 -maltivec". See
> https://sourceware.org/pipermail/binutils/2008-January/054935.html
>
> It doesn't make as much sense that .machine keep any of these
> "sticky" flags when handling a new base cpu. See gcc PR101393. I
> think that instead .machine ought to override the command line.
> That's what this patch does. It is still possible to extend cpu
> functionality with .machine. For example the following can be
> assembled when selecting a basic -mppc on the command line:
> .machine power5
> .machine altivec
> frin 1,2
> lvsr 3,4,5
> Here, ".machine altivec" extends the ".machine power5" so that both
> the power5 "frin" instruction and the altivec "lvsr" instruction are
> enabled. Swapping the two ".machine" directives would result in
> failure to assemble "lvsr".
>
> * config/tc-ppc.c (ppc_machine): Don't use command line
> sticky options.
Hi Alan,
this works nicely here with newlib and our code. Tried the patch against
2.37 and 2.36.1.
> I'll leave committing this for a while in case someone thinks this is
> totally crazy..
I don't think this is crazy, for me it makes a lot more sense than the
previous behaviour.
Franz.
More information about the Binutils
mailing list