PowerPC: ignore sticky options for .machine
Alan Modra
amodra@gmail.com
Wed Jul 28 02:23:39 GMT 2021
On Tue, Jul 27, 2021 at 11:38:28AM -0500, Segher Boessenkool wrote:
> On Tue, Jul 27, 2021 at 05:03:51PM +0200, Franz Sirl wrote:
> > Am 2021-07-24 um 05:20 schrieb Alan Modra:
> > >If you define "wants" as "just assemble this file!" then yes, I can
> > >imagine plenty of cases where some dodgy source now assembles but
> > >won't after this change. The most likely is source containing
> > >.machine directives other than the sticky ones that now assembles with
> > >-many might not assemble after this change. For example, a file
> > >with ".machine power8" and following that a non-power8 instruction,
> > >now will give an assembly error. ".machine power8; .machine any" in
> > >the source would work for both old and new assemblers.
> > >
> > >I guess it might be a good idea for -many on the command line to
> > >override .machine.
> >
> > Really? But then your change will be kind of useless again, or? When
> > writing assembler code and explicitly using .machine, I would really
> > prefer to get *exactly* what I selected. Getting an error for a mnemonic
> > not valid for the CPU I selected is much better than an opcode that may
> > change with binutils releases, just because for example the opcode table
> > got cleaned up and re-ordered.
>
> Code that previously only compiled because there was -many on the
> command line will stop doing that, without the suggested change. This
> can be fixed by adding a ".machine any" line after every other
> ".machine", but how much of that will be needed?
I've decided to commit the original patch with an extra comment and a
variable name change. If we need to tweak -many behaviour that can be
done later.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list