how to get target ldd ?
ng@piments.com
ng@piments.com
Tue Jun 9 22:17:00 GMT 2009
Yann E. MORIN wrote:
> Peter,
> All,
>
> On Saturday 06 June 2009 09:09:02 peter wrote:
>> I am having problems with a busybox ARM target I have build using ct-ng.
>> None of the executables , including busybox, seem to work unless I
>> build them static.
>
> What's the symptom ?
> Do they segfault ?
> Can you run a statically linked hello world ? A dynamic one ?
> What does it say on the console?
> Using glibc or uClibc ?
> ...
>
> You did not give enough info to diagnose the problem...
>
>> Is there a way to get ldd for the target system out of ct-ng?
>
> Look in the archives, this has already been discussed...
>
> The /problem/ with ldd (the one in glibc, at least) is that it tries to
> _run_ the dynamic linker /lib/ld-xxx.so with some environment variables
> set, and this will print the libraries it finds _at_runtime_.
>
> Obviously, you don't want to run your ARM dynamic linker on your dev
> machine, as this most probably is some kind os x86.
>
> If using populate as per your previous posts, what does populate -v says?
>
> Regards,
> Yann E. MORIN.
>
Thanks Yann, Dan,
I did not give more details of the problem because I thought ldd would
enable me to see where the problem lay. Sadly not. I copied the sys-root
copy of ldd and it gives me the same silliness as the other commands.
# which ldd
/usr/bin/ldd
# ldd
-sh: ldd: not found
# ls -ail `which ldd`
3273877 -r-xr-xr-x 1 root root 5583 Jun 8 2009 /usr/bin/ldd
So it's there, it's found by which, but "not found". Clearly this is
just busybox's challenged error handling spewing garbage. The question
is how to debug what is really happending.
This error is helpful in itself since it's not even a binary, it's a
script. Binaries give :
-sh: gnuplot: Permission denied
even though they have x permissions and are being invoked by root.
# which gnuplot
/usr/bin/gnuplot
# `which gnuplot`
-sh: /usr/bin/gnuplot: Permission denied
# ls -ail `which gnuplot`
3272843 -rwxr-xr-x 1 root root 2074273 Jun 2 2009
/usr/bin/gnuplot
Following Dan's suggestion got not more information: (unless getting the
same output with the trace IS more information)
# LD_TRACE_LOADED_OBJECTS=1 gnuplot
-sh: gnuplot: Permission denied
Busybox static works , bb with normal dyn linking : permission denied.
> If using populate as per your previous posts, what does populate -v says?
Tar bleats about some files in /etc having "improbable" datestamp, circa
1/1/1970. This does not seem to be an error though. After that it finds
the expected libs , oopies them , then starts "looping". This just
reports libs to be already present. This seems to be in order.
LD_TRACE_LOADED_OBJECTS=1 hello.stat
Hello world!
# LD_TRACE_LOADED_OBJECTS=1 hello.dyn
-sh: hello.dyn: Permission denied
So either ld loads but can't link or there is a broken lib...
bash-4.0#file /back/ts/root-image/lib/libc.so.6
/back/ts/root-image/lib/libc.so.6: ELF 32-bit LSB shared object, ARM,
version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux
2.6.29, not stripped
# readelf -a /back/ts/root-image/lib/libc.so.6
...
Version needs section '.gnu.version_r' contains 1 entries:
Addr: 0x0000000000012520 Offset: 0x012520 Link: 4 (.dynstr)
000000: Version: 1 File: ld-linux.so.3 Cnt: 2
0x0010: Name: GLIBC_2.4 Flags: none Version: 10
0x0020: Name: GLIBC_PRIVATE Flags: none Version: 9
Notes at offset 0x00000194 with length 0x00000020:
Owner Data size Description
GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag)
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "4T"
Tag_CPU_arch: v4T
Tag_ARM_ISA_use: Yes
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align8_needed: Yes
Tag_ABI_align8_preserved: Yes, except leaf SP
Tag_ABI_enum_size: int
I'm short on ideas now.
Thx
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list