RE: [arm-gnu] Assembler misaligned branch destination Error in ARM GCC 3.4+CS2005q3/Glibc toolchain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [arm-gnu] Assembler misaligned branch destination Error in ARM GCC 3.4+CS2005q3/Glibc toolchain



Hi,
 Yes I am using the compiler provided with tool chain. I could get rid
of the error: "misaligned branch 
destination" after renaming the labels in atomicbase.h file. The
assmebler was taking those errors as absolute addresses:
The portion of code from atomicbase.h is given here:
@@ -1393,7 +1393,7 @@
 "        mov   %0, #0x80000000;\n"      /* Set ulRet to 0x80000000
*/
 "1:      swp   %0, %0, [%1];\n"         /* Swap *pNum and ulRet
*/
 "        cmp   %0, #0x80000000;\n"      /* Is someone else using pNum?
*/
-"        beq   1;\n"                    /* If so, retry...
*/
+"        beq   1b;\n"                 /* If so, retry...             */
 "        add   %0, %0, #1;\n"           /* Increment ulRet
*/
 "        cmp   %0, #0x80000000;\n"      /* check for overflow
*/
 "        addeq %0, %0, #1;\n"         /* if so, increment again      */

Br,
Abdullah

>-----Original Message-----
>From: ext Carlos O'Donell [mailto:carlos@xxxxxxxxxxxxxxxx] 
>Sent: 10 March, 2006 17:37
>To: Abdullah Shafaq (Nokia-M/Helsinki)
>Cc: arm-gnu@xxxxxxxxxxxxxxxx; Karsisto Konsta (Nokia-M/Helsinki)
>Subject: Re: [arm-gnu] Assembler misaligned branch destination 
>Error in ARM GCC 3.4+CS2005q3/Glibc toolchain
>
>On Wed, Mar 08, 2006 at 12:20:30PM +0200, S.Abdullah wrote:
>>   I am using ARM GCC 3.4+CS2005q3/Glibc toolchain inside scratchbox 
>> (0.9.8.5). I get error from assembler  "misaligned branch 
>destination".
>> I am attaching the code that produces this error. It can be used to 
>> reproduce the error using the above mentioned tool-chain inside 
>> scratchbox or using cross-compiler.
>
>Thank you for your interest in our Sourcery G++ toolchain!
> 
>> arm-linux-g++  -include common_util_ribodefs.h hxdefpackethookhlp.cpp
>> 
>> /var/tmp/ccdQOuvk.s: Assembler messages:
>> /var/tmp/ccdQOuvk.s:170: Error: misaligned branch destination
>> /var/tmp/ccdQOuvk.s:211: Error: misaligned branch destination
>> 
>> 
>> arm-linux-g++ -include common_util_ribodefs.h -S \
>> hxdefpackethookhlp.cpp  (produces assembler output)
>> 
>> Description:
>> 
>> The Assembler produces label which are then used as an absolute 
>> addresses.
> 
>Are you using the compiler provided with the ARM 2005 Q3 
>toolchain? If you are not, could you please try this test with 
>this compiler.  We do a lot of work to provide you with a high 
>quality and tested toolchain.
>
>Cheers,
>Carlos.
>--
>Carlos O'Donell
>CodeSourcery
>carlos@xxxxxxxxxxxxxxxx
>(650) 331-3385 x716
>