On Thu, Sep 27, 2012 at 4:09 AM, Michael Hope wrote:
> On 27 September 2012 01:06, Shivamurthy Shastri
> wrote:
> > On Wed, Sep 26, 2012 at 6:28 PM, Fathi Boudra
> > wrote:
> >>
> >> On 26 September 2012 15:44, Shivamurthy Shastri
> >> wrote:
> >> > Hi,
> >> >
> >> > I am using Linaro Toolchain for compiling UEFI and I am getting
> >> > alignment
> >> > fault as exception while running UEFI on Origen Board.
> >> > When I was using other cross compilers the issue was not there.
> >> > The crash report is as follows:
> >> >
> >> >
> >> > Data Abort Exception PC at 0x4F84DCDC CPSR 0x6133 nZCveAifT_svc
> >> >
> >> >
> /home/shiva/workspace/armserver/uefi_origen/edk2/Build/OrigenBoard-Exynos/DEBUG_ARMLINUXGCC/ARM/FatPkg/EnhancedFatDxe/Fat/DEBUG/Fat.dll
> >> > loaded at 0x4F84D000 (PE/COFF offset) 0xCDC (ELF or Mach-O offset)
> 0xA9C
> >> > 0xF8BD6037 LDRH r6, [sp, #0x37]
> >> > R0 0x000B R1 0x000A R2 0x4FCEEAD8 R3 0x8000
> >> > R4 0x4F836010 R5 0x4F863619 R6 0x R7 0x4F837F10
> >> > R8 0x R9 0x R10 0x0001 R11 0x
> >> > R12 0x SP 0x4FCEEA20 LR 0x4F84DCDD PC 0x4F84DCDC
> >> > DFSR 0x0001 DFAR 0x4FCEEB17 IFSR 0x140B IFAR 0x00910883
> >> > Alignment fault: read from 0x4FCEEB17
> >> > Instruction Domain fault on Page at 0x00910883
> >> >
> >> > ASSERT
> >> >
> >> >
> /home/shiva/workspace/armserver/uefi_origen/edk2/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandler.c(304):
> >> > ((BOOLEAN)(0==1))
> >>
> >> Could you try to add -mno-unaligned-access flag.
> >> See
> >>
> http://git.linaro.org/gitweb?p=arm/uefi/uefi-next.git;a=commitdiff;h=228b8242e9675bef9f739326281fcb027e5946e3
> >>
> >> Cheers,
> >> --
> >> Fathi Boudra
> >> Linaro Release Manager | LAVA Project Manager
> >> Linaro.org | Open source software for ARM SoCs
> >
> >
> >
> > I tried that, but I am unable to solve the problem.
>
> Hi Shiva. The instruction in your dump looks suspicious:
> LDRH r6, [sp, #0x37]
>
> sp should be eight byte aligned, so this ends up doing a half word
> load from an odd address. Could you upload the build log and a
> pre-built version of Fat.dll somewhere so I can have a look?
>
> Note that the CPU supports unaliged access out of reset. You have to
> manually turn the unaligned access trap on and that's probably
> happening somewhere in your startup routines.
>
> -- Michael
>
Hi Michael,
I was using code sourcery toolchain which has not given this problem.
Meanwhile I have not changed any code of UEFI.
But, I am getting problem with the linaro toolchain. Below are the
toolchain details.
CodeSourcery toolchain:
shiva@shiva:/usr/local/arm/arm/bin$ ./arm-none-linux-gnueabi-gcc -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with:
/scratch/julian/2010q1-release-linux-lite/src/gcc-4.4-2010q1/configure
--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu
--target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap
--disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs
--with-arch=armv5te --with-gnu-as --with-gnu-ld
--with-specs='%{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables}
%{O2:%{!fno-remove-local-statics: -fremove-local-statics}}
%{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics:
-fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared
--disable-lto --enable-symvers=gnu --enable-__cxa_atexit
--with-pkgversion='Sourcery G++ Lite 2010q1-202' --with-bugurl=
https://support.codesourcery.com/GNUToolchain/ --disable-nls
--prefix=/opt/codesourcery
--with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc
--with-build-sysroot=/scratch/julian/2010q1-release-linux-lite/install/arm-none-linux-gnueabi/libc
--with-gmp=/scratch/julian/2010q1-release-linux-lite/obj/host-libs-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr
--with-mpfr=/scratch/julian/2010q1-release-linux-lite/obj/host-libs-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr
--with-ppl=/scratch/julian/2010q1-release-linux-lite/obj/host-libs-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm'
--with-cloog=/scratch/julian/2010q1-release-linux-lite/obj/host-libs-2010q1-202-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr
--disable-libgomp --enable-poison-system-directories
--with-build-time-tools=/scratch/julian/20