Discussion:
ldd on ARM
Nestor
2005-03-23 13:40:29 UTC
Permalink
Hi,

I noticed that the "ldd" utility seems not to work with dynamically linked executables for ARM. I checked this with the "bash" executable compiled for Linux 2.4.24-uc0 (gcc version 3.3.2) to run on XScale. It says "not a dynamic executable", but I know that it really is "bash: ELF 32-bit MSB executable, ARM, version 1 (ARM), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), not stripped".

Does anyone out there knows if there is a ldd version that does the job? My host is RH9 on i386.

By the way, why the "file" command is reporting Linux 2.0.0 ? I guess this should be Linux 2.2.5 to match the glibc version, right?

Thanks,

(Nestor)



-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
Catalin Marinas
2005-03-23 13:53:25 UTC
Permalink
Post by Nestor
I noticed that the "ldd" utility seems not to work with dynamically
linked executables for ARM. I checked this with the "bash"
executable compiled for Linux 2.4.24-uc0 (gcc version 3.3.2) to run
on XScale. It says "not a dynamic executable", but I know that it
really is "bash: ELF 32-bit MSB executable, ARM, version 1 (ARM),
for GNU/Linux 2.0.0, dynamically linked (uses shared libs), not
stripped".
Does anyone out there knows if there is a ldd version that does the
job? My host is RH9 on i386.
Are you trying to run the host ldd on an ARM binary? It won't
work. Ldd is just a script that runs /lib/ld-linux.so.2 but you would
need to run it on your platform, not on the host.

Try running "/lib/ld-linux.so.2 --list /bin/bash" on your ARM
platform.
--
Catalin


-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
Nestor
2005-03-23 14:50:37 UTC
Permalink
Post by Catalin Marinas
Are you trying to run the host ldd on an ARM binary? It won't
work. Ldd is just a script that runs /lib/ld-linux.so.2 but you would
need to run it on your platform, not on the host.
It really is a script ! I thought it was an executable file and didn't check it out...

Thanks, the "/lib/ld-linux.so.2 --list" works just great.

(Nestor)



-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
Sebastian Haas
2005-03-23 14:00:21 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nestor schrieb:
| Does anyone out there knows if there is a ldd version that does the
job? My host is RH9 on i386.
I guess there is a special ldd tool for ARM binaries, something like
arm-elf-ldd.

best regards,
Sebastian Haas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCQXZ1pqRB8PJG7XwRApxhAJ9UC8vHnjFI/RBNQdI5p1lGgBlhaACbBKVG
Ul3A1lDrDJkNrYWKffZDStI=
=Gadh
-----END PGP SIGNATURE-----

-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
Trilok Soni
2005-03-23 14:10:13 UTC
Permalink
Post by Nestor
Hi,
I noticed that the "ldd" utility seems not to work with dynamically linked executables for ARM. I checked this with the "bash" executable compiled for Linux 2.4.24-uc0 (gcc version 3.3.2) to run on XScale. It says "not a dynamic executable", but I know that it really is "bash: ELF 32-bit MSB executable, ARM, version 1 (ARM), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), not stripped".
You can try:

#arm-linux-readelf -a "your binary" | grep "Shared"

---Trilok Soni

-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
Nestor
2005-03-23 14:54:53 UTC
Permalink
Post by Trilok Soni
#arm-linux-readelf -a "your binary" | grep "Shared"
Hi Trilok,

Your approach works on my host (RH9 i386). The other way (/lib/ld-linux.so.2) needs the target platform to get the info.

Thanks,

(Nestor)



-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
Trilok Soni
2005-03-23 15:11:16 UTC
Permalink
Post by Nestor
Post by Trilok Soni
#arm-linux-readelf -a "your binary" | grep "Shared"
Hi Trilok,
Your approach works on my host (RH9 i386).
Correct.
Post by Nestor
The other way (/lib/ld-linux.so.2) needs the target platform to get the info.
Yes. So we know now how to extract that information on target and host :-).

---Trilok Soni


-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
Continue reading on narkive:
Loading...