Re: [RFC PATCH] ARM: Use logical or instead of addition for badr address calculation

2018-06-19 Thread Ard Biesheuvel
On 19 June 2018 at 20:20, Ard Biesheuvel wrote: > On 19 June 2018 at 20:17, Ard Biesheuvel wrote: >> On 19 June 2018 at 19:24, Guenter Roeck wrote: >>> On Tue, Jun 19, 2018 at 03:35:07PM +0200, Ard Biesheuvel wrote: >> >> + /* this needs to be a separate macro or \@ does not work

Re: [RFC PATCH] ARM: Use logical or instead of addition for badr address calculation

2018-06-19 Thread Ard Biesheuvel
On 19 June 2018 at 20:17, Ard Biesheuvel wrote: > On 19 June 2018 at 19:24, Guenter Roeck wrote: >> On Tue, Jun 19, 2018 at 03:35:07PM +0200, Ard Biesheuvel wrote: >>> >> >>> >> + /* this needs to be a separate macro or \@ does not work >>> >> correctly >>> >> */ >>> >> + .macro __b

Re: [RFC PATCH] ARM: Use logical or instead of addition for badr address calculation

2018-06-19 Thread Ard Biesheuvel
On 19 June 2018 at 19:24, Guenter Roeck wrote: > On Tue, Jun 19, 2018 at 03:35:07PM +0200, Ard Biesheuvel wrote: >> >> >> >> + /* this needs to be a separate macro or \@ does not work correctly >> >> */ >> >> + .macro __badr, c, rd, sym >> >> + .eqv.Lsym\@, \sym >> >> +

Re: [RFC PATCH] ARM: Use logical or instead of addition for badr address calculation

2018-06-19 Thread Russell King - ARM Linux
On Tue, Jun 19, 2018 at 10:14:24AM -0700, Guenter Roeck wrote: > On Tue, Jun 19, 2018 at 04:12:35PM +0100, Russell King - ARM Linux wrote: > > > > So, I'm going to continue sitting on the fence on this, and basically > > take the attitude that it's better that people don't use the new > > binutils

Re: [RFC PATCH] ARM: Use logical or instead of addition for badr address calculation

2018-06-19 Thread Guenter Roeck
On Tue, Jun 19, 2018 at 03:35:07PM +0200, Ard Biesheuvel wrote: > >> > >> + /* this needs to be a separate macro or \@ does not work correctly > >> */ > >> + .macro __badr, c, rd, sym > >> + .eqv.Lsym\@, \sym > >> + adr\c \rd, .Lsym\@ + 1 > > > > > > Wild shot, but th

Re: [RFC PATCH] ARM: Use logical or instead of addition for badr address calculation

2018-06-19 Thread Guenter Roeck
On Tue, Jun 19, 2018 at 04:12:35PM +0100, Russell King - ARM Linux wrote: > > So, I'm going to continue sitting on the fence on this, and basically > take the attitude that it's better that people don't use the new > binutils until binutils people can provide us with an officially > sanctioned sol

Re: [RFC PATCH] ARM: Use logical or instead of addition for badr address calculation

2018-06-19 Thread Russell King - ARM Linux
On Tue, Jun 19, 2018 at 03:35:07PM +0200, Ard Biesheuvel wrote: > On 19 June 2018 at 15:29, Guenter Roeck wrote: > > Hi Ard, > > > > > > On 06/19/2018 12:48 AM, Ard Biesheuvel wrote: > >> > >> On 19 June 2018 at 07:07, Guenter Roeck wrote: > >>> > >>> Modern assemblers may take the ISA into accou

Re: [RFC PATCH] ARM: Use logical or instead of addition for badr address calculation

2018-06-19 Thread Ard Biesheuvel
On 19 June 2018 at 15:29, Guenter Roeck wrote: > Hi Ard, > > > On 06/19/2018 12:48 AM, Ard Biesheuvel wrote: >> >> On 19 June 2018 at 07:07, Guenter Roeck wrote: >>> >>> Modern assemblers may take the ISA into account when resolving local >>> symbols. This can result in bad address calculations w

Re: [RFC PATCH] ARM: Use logical or instead of addition for badr address calculation

2018-06-19 Thread Guenter Roeck
Hi Ard, On 06/19/2018 12:48 AM, Ard Biesheuvel wrote: On 19 June 2018 at 07:07, Guenter Roeck wrote: Modern assemblers may take the ISA into account when resolving local symbols. This can result in bad address calculations when using badr in the wrong location since the offset + 1 may be added

Re: [RFC PATCH] ARM: Use logical or instead of addition for badr address calculation

2018-06-19 Thread Ard Biesheuvel
On 19 June 2018 at 09:48, Ard Biesheuvel wrote: > On 19 June 2018 at 07:07, Guenter Roeck wrote: >> Modern assemblers may take the ISA into account when resolving local >> symbols. This can result in bad address calculations when using badr >> in the wrong location since the offset + 1 may be add

Re: [RFC PATCH] ARM: Use logical or instead of addition for badr address calculation

2018-06-19 Thread Ard Biesheuvel
On 19 June 2018 at 07:07, Guenter Roeck wrote: > Modern assemblers may take the ISA into account when resolving local > symbols. This can result in bad address calculations when using badr > in the wrong location since the offset + 1 may be added twice, resulting > in an even address target for TH

[RFC PATCH] ARM: Use logical or instead of addition for badr address calculation

2018-06-18 Thread Guenter Roeck
Modern assemblers may take the ISA into account when resolving local symbols. This can result in bad address calculations when using badr in the wrong location since the offset + 1 may be added twice, resulting in an even address target for THUMB instructions. This in turn results in an exception a