From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] checkarmreloc error for AArch64 (using vexpress_aemv8a_defconfig)
Date: Mon, 20 Jul 2015 21:23:51 +0200 [thread overview]
Message-ID: <20150720212351.6df7a4f2@lilith> (raw)
In-Reply-To: <360A224CA5291F458103405CD90949369634A67F@ORSMSX105.amr.corp.intel.com>
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.
next prev parent reply other threads:[~2015-07-20 19:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-17 22:13 [U-Boot] checkarmreloc error for AArch64 (using vexpress_aemv8a_defconfig) Chou, David J
2015-07-18 8:43 ` Albert ARIBAUD
2015-07-18 8:58 ` Albert ARIBAUD
2015-07-20 4:15 ` Chou, David J
2015-07-20 19:23 ` Albert ARIBAUD [this message]
2015-07-20 22:17 ` Chou, David J
2015-07-21 7:01 ` Albert ARIBAUD
-- strict thread matches above, loose matches on Subject: below --
2015-02-26 9:41 Guillaume Gardet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150720212351.6df7a4f2@lilith \
--to=albert.u.boot@aribaud.net \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox