[U-Boot] checkarmreloc error for AArch64 (using vexpress_aemv8a_defconfig)

Chou, David J david.j.chou at intel.com
Tue Jul 21 00:17:49 CEST 2015


Hello Albert,

You are right.  it seems the "file' program in my Ubuntu- 12.04.5 LTS system doesn't have the aarch64 database of signatures as you said. But If I moved the 64 bit u-boot I built in my Ubuntu- 12.04.5 LTS system to an Ubuntu14.04.02 LTS system, the "file u-boot" shows " u-boot: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), statically  linked, not stripped".

So, can I conclude the way I build aarch64 u-boot by following is correct?
$ make distclean
$ make vexpress_aemv8a_juno_defconfig ARCH=arm  CROSS_COMPILE=aarch64-linux-gnu- 
$ make all ARCH=arm CROSS_COMPILE=aarch64-linux-gnu-

Thanks.

Best Regards,
David Chou

-----Original Message-----
From: Albert ARIBAUD [mailto:albert.u.boot at aribaud.net] 
Sent: Monday, July 20, 2015 12:24 PM
To: Chou, David J
Cc: u-boot at lists.denx.de; Sood, Ritu
Subject: Re: [U-Boot] checkarmreloc error for AArch64 (using vexpress_aemv8a_defconfig)

Hello David J,

On Mon, 20 Jul 2015 04:15:35 +0000, Chou, David J <david.j.chou at intel.com> wrote:
> Hello Albert,
> 
> Thanks for your quick response.  The error message disappeared after I switched to use gcc-linaro-aarch64-linux-gnu-4.8-2014.04_linux tool chain from Linaro in either u-boot-2015.07-rc2 branch or latest u-boot-2015.07 branch.  
> 
> I have one question: why the following  build generated a statically linked u-boot  as showed by "$ file u-boot" followed, and also it doesn't show "ARM" after " u-boot: ELF 64-bit LSB shared object," : 
> $ make distclean
> $ make vexpress_aemv8a_juno_defconfig ARCH=arm 
> CROSS_COMPILE=aarch64-linux-gnu- $ make all ARCH=arm 
> CROSS_COMPILE=aarch64-linux-gnu- $ file u-boot
> u-boot: ELF 64-bit LSB shared object, version 1 (SYSV), statically 
> linked, not stripped
> 
> But when I built a 32-bit arm u-boot using following command, it generated a  dynamically linked u-boot, and  "file  u-boot" shows "ARM" after " u-boot: ELF 32-bit LSB shared object,":
> $ make distclean
> $ make vexpress_ca15_tc2_defconfig ARCH=arm CROSS_COMPILE=arm-eabi- $ 
> make all ARCH=arm CROSS_COMPILE=arm-eabi- $ file u-boot
> u-boot: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), 
> dynamically linked (uses shared libs), not stripped


> Is there anything wrong in my  commands (shown in following" again  to make a 64 bit aarch64 u-boot, what commands you use to generated 64 bits u-boot ?
> $ make distclean
> $ make vexpress_aemv8a_juno_defconfig ARCH=arm 
> CROSS_COMPILE=aarch64-linux-gnu- $ make all ARCH=arm 
> CROSS_COMPILE=aarch64-linux-gnu-
> 
> Is the 64bits u-boot you generated statically linked or dynamically linked when you use "file u-boot" to check it? Does "file u-boot" show "ARM" after " u-boot: ELF 64-bit LSB shared object,"?  Can you show the "file u-boot" result for your 64 bit u-boot?  

Actually, 'file' is simpy wrong.

U-boot is statically linked. U-Boot could not be dynamically linked, since U-Boot does not run above an OS that could provide dynamic libraries. After all, it is U-Boot's role to get such an OS to boot.

Also, while your 'file' cannot recognize the AARCH64 file, mine can:

u-boot: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped

See? "ARM aarch64".

So how come yours does not?

It's all about the database of signatures that the 'file' command uses.
mine has the signature for "ARM aarch64", yours does not.

And both yours and mine wrongly find a "dynamically linked" signature in 32-bit ARM u-boot.

If you want to check this, copy the 32-bit u-boot ELF file over to an ARM 32-bit target running Linux, an do an 'ldd u-boot'. This should show you the libraries if u-boot was really dynamic. But it won't (on my OpenRD-Client it fails with "unknown exit code" 139). Compare this with, say, 'ldd /bin/bash', which lists the five libraries bash needs.

So the thing is, you're trusting 'file', and you should not. :)

> Thanks.

No problem.

> Best Regards,
> David Chou

Amicalement,
--
Albert.


More information about the U-Boot mailing list