CBZ to the next instruction on ARM

Paul Brook paul@codesourcery.com
Thu Mar 22 16:21:00 GMT 2007


On Thursday 22 March 2007 16:05, Nick Clifton wrote:
> Hi Mark,
>
> > I propose the application of the attached patch that rewrites
> > such bogus CBZ instructions to no-ops.  This isn't particularly
> > elegant, but does make this robust.  OK?
>
> The patch is OK, but ... is it necessary to actually generate any
> instructions at all ?  Wouldn't it be more elegant to just omit
> generating an instruction, saving a couple of bytes ?

More elegant maybe, but also more surprising. Of course You could argue that 
the user has written bogus code, so deserve everything they get.

It's also significantly more complicated to implement. You have to do insn 
relaxation rather than simply applying a reloc to a fixed size instruction.

Paul



More information about the Binutils mailing list