[PATCH v2 2/2] arm64: Work around broken .inst when defective gas is detected

Dave Martin Dave.Martin at arm.com
Tue Dec 6 09:38:54 PST 2016


On Tue, Dec 06, 2016 at 04:28:26PM +0000, Dave Martin wrote:
> On Tue, Dec 06, 2016 at 03:27:45PM +0000, Marc Zyngier wrote:
> > .inst being largely broken with older binutils, it'd be better not
> > to emit it altogether when detecting such configuration (as it
> > leads to all kind of horrors when using alternatives).
> 
> GAS seems to provide few guarantees about the constantness of anything
> other than an expression composed purely of literal constants.  So,
> this may rather be lack of a useful feature rather than a bug per se.
> 
> > Generalize the __emit_inst macro and use it extensively in
> > asm/sysreg.h, and make it generate a .long when a broken gas is
> > detected. The disassembly will be crap, but at least we can write
> > semi-sane code.
> 
> Don't know how much this helps, but if we want decent disassembly then
> one option is to use macros instead of symbols, so that the argument to
> .inst involves only literals after macro expansion.

[...]

It seems that this doesn't solve your problem though ... oh well.

Cheers
---Dave



More information about the linux-arm-kernel mailing list