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

Hi,
I am using u-boot-2015.07-rc2, using vexpress_aemv8a_defconfig as following: $ make vexpress_aemv8a_juno_defconfig ARCH=arm CROSS_COMPILE=aarch64-linux-android- $ make all ARCH=arm CROSS_COMPILE=aarch64-linux-android-
And I got "make: *** [checkarmreloc] Error 1" at the end of the build as following:
OBJCOPY examples/standalone/hello_world.srec OBJCOPY examples/standalone/smc911x_eeprom.srec OBJCOPY examples/standalone/hello_world.bin OBJCOPY examples/standalone/smc911x_eeprom.bin LDS u-boot.lds LD u-boot u-boot contains unexpected relocations: R_AARCH64_ABS64 R_AARCH64_RELATIVE make: *** [checkarmreloc] Error 1
But it generated an ELF 64-bit LSB executable, version 1 (SYSV), statically linked u-boot. Does this u-boot still useful or how to fix the issue?
This build error has been mentioned in http://lists.denx.de/pipermail/u-boot/2015-February/206440.html , has it been fixe?
Thanks a lot for your help.
Best Regards, David Chou

Hello David,
On Fri, 17 Jul 2015 22:13:32 +0000, Chou, David J david.j.chou@intel.com wrote:
Hi,
I am using u-boot-2015.07-rc2, using vexpress_aemv8a_defconfig as following: $ make vexpress_aemv8a_juno_defconfig ARCH=arm CROSS_COMPILE=aarch64-linux-android- $ make all ARCH=arm CROSS_COMPILE=aarch64-linux-android-
And I got "make: *** [checkarmreloc] Error 1" at the end of the build as following:
OBJCOPY examples/standalone/hello_world.srec OBJCOPY examples/standalone/smc911x_eeprom.srec OBJCOPY examples/standalone/hello_world.bin OBJCOPY examples/standalone/smc911x_eeprom.bin LDS u-boot.lds LD u-boot u-boot contains unexpected relocations: R_AARCH64_ABS64 R_AARCH64_RELATIVE make: *** [checkarmreloc] Error 1
But it generated an ELF 64-bit LSB executable, version 1 (SYSV), statically linked u-boot. Does this u-boot still useful or how to fix the issue?
This build error has been mentioned in http://lists.denx.de/pipermail/u-boot/2015-February/206440.html , has it been fixe?
This error does not appear with the aarmch64 toolchain used by buildman or with the aarmch64 toolchain from Ubuntu repositories, either for v2015.07-rc2 or for current top of branch u-boot[-arm]/master.
Is the code you are building pure v2015.07-rc3 or does it contain any local changes?
Thanks a lot for your help.
Best Regards, David Chou
Amicalement,

On Sat, 18 Jul 2015 10:43:41 +0200, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
This error does not appear with the aarmch64 toolchain used by buildman or with the aarmch64 toolchain from Ubuntu repositories, either for
s/aarmch64/aarch64/g
Amicalement,

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?
Thanks.
Best Regards, David Chou
-----Original Message----- From: Albert ARIBAUD [mailto:albert.u.boot@aribaud.net] Sent: Saturday, July 18, 2015 1:44 AM To: Chou, David J Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] checkarmreloc error for AArch64 (using vexpress_aemv8a_defconfig)
Hello David,
On Fri, 17 Jul 2015 22:13:32 +0000, Chou, David J david.j.chou@intel.com wrote:
Hi,
I am using u-boot-2015.07-rc2, using vexpress_aemv8a_defconfig as following: $ make vexpress_aemv8a_juno_defconfig ARCH=arm CROSS_COMPILE=aarch64-linux-android- $ make all ARCH=arm CROSS_COMPILE=aarch64-linux-android-
And I got "make: *** [checkarmreloc] Error 1" at the end of the build as following:
OBJCOPY examples/standalone/hello_world.srec OBJCOPY examples/standalone/smc911x_eeprom.srec OBJCOPY examples/standalone/hello_world.bin OBJCOPY examples/standalone/smc911x_eeprom.bin LDS u-boot.lds LD u-boot u-boot contains unexpected relocations: R_AARCH64_ABS64 R_AARCH64_RELATIVE make: *** [checkarmreloc] Error 1
But it generated an ELF 64-bit LSB executable, version 1 (SYSV), statically linked u-boot. Does this u-boot still useful or how to fix the issue?
This build error has been mentioned in http://lists.denx.de/pipermail/u-boot/2015-February/206440.html , has it been fixe?
This error does not appear with the aarmch64 toolchain used by buildman or with the aarmch64 toolchain from Ubuntu repositories, either for v2015.07-rc2 or for current top of branch u-boot[-arm]/master.
Is the code you are building pure v2015.07-rc3 or does it contain any local changes?
Thanks a lot for your help.
Best Regards, David Chou
Amicalement, -- Albert.

Hello David J,
On Mon, 20 Jul 2015 04:15:35 +0000, Chou, David J david.j.chou@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,

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@aribaud.net] Sent: Monday, July 20, 2015 12:24 PM To: Chou, David J Cc: u-boot@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@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.

Hello David J,
On Mon, 20 Jul 2015 22:17:49 +0000, Chou, David J david.j.chou@intel.com wrote:
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 $ make all ARCH=arm CROSS_COMPILE=aarch64-linux-gnu-
This is one way of building U-Boot, indeed, which should amount to the same as the "Building the Software" instructions given in the README file.
Thanks.
Best Regards, David Chou
Amicalement,
participants (2)
-
Albert ARIBAUD
-
Chou, David J