LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-19-2009, 02:28 PM   #1
ranthal
LQ Newbie
 
Registered: Jun 2009
Location: Carlsbad, CA
Posts: 24

Rep: Reputation: 15
ldd on cross-compiled executable


Hey all,

I'm trying to run ldd on an x86 host for an executable file that is cross-compiled for a PowerPC I can't seem to get it to print the linked libraries. Here's what the output essentially looks like:
Code:
user$ file main
main: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
user$ ldd main
    not a dynamic executable
I feel like the solution is fairly obvious but I haven't been able to find it. Help?
 
Old 10-19-2009, 04:25 PM   #2
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 139Reputation: 139
Right, I deleted my last post on account of me just being way, way wrong - I'd never run ldd against anything I've cross-compiled, so I went and ran it against something I thought I'd cross-compiled that I'd actually natively compiled, because I'm an idiot

The short of it: I don't know how ldd does its job, but my x86 ldd doesn't work on my cross-compiled ARM executables either, so it looks like it just doesn't work at all. Maybe you should take your powerpc-*-ldd compiled with your C library (if you use glibc/uClibc, at least) and run it on your target architecture?

Last edited by JohnGraham; 10-19-2009 at 04:56 PM.
 
Old 10-19-2009, 05:03 PM   #3
ranthal
LQ Newbie
 
Registered: Jun 2009
Location: Carlsbad, CA
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by JohnGraham View Post
The short of it: I don't know how ldd does its job, but my x86 ldd doesn't work on my cross-compiled ARM executables either, so it looks like it just doesn't work at all. Maybe you should take your powerpc-*-ldd compiled with your C library (if you use glibc/uClibc, at least) and run it on your target architecture?
Haha, well yeah, I considered that so I'll give it a shot, just gotta go through the extra steps of tftping it over. I did run readelf and got this:
Code:
Dynamic section at offset 0x3403c contains 28 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libcryptoservices.so]
 0x00000001 (NEEDED)                     Shared library: [libframework.so]
 0x00000001 (NEEDED)                     Shared library: [libtommath.so]
 0x00000001 (NEEDED)                     Shared library: [libhwaes.so]
 0x00000001 (NEEDED)                     Shared library: [libfpui.so]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
 0x00000001 (NEEDED)                     Shared library: [libm.so.0]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.0]
 0x0000000c (INIT)                       0x10008bbc
 0x0000000d (FINI)                       0x1002cd80
 0x00000004 (HASH)                       0x10000128
 0x00000005 (STRTAB)                     0x10003230
 0x00000006 (SYMTAB)                     0x10001180
 0x0000000a (STRSZ)                      19619 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000015 (DEBUG)                      0x0
 0x00000003 (PLTGOT)                     0x10044220
 0x00000002 (PLTRELSZ)                   1896 (bytes)
 0x00000014 (PLTREL)                     RELA
 0x00000017 (JMPREL)                     0x10008454
 0x00000007 (RELA)                       0x1000834c
 0x00000008 (RELASZ)                     2160 (bytes)
 0x00000009 (RELAENT)                    12 (bytes)
 0x6ffffffe (VERNEED)                    0x100082ec
 0x6fffffff (VERNEEDNUM)                 2
 0x6ffffff0 (VERSYM)                     0x10007ed4
 0x00000000 (NULL)                       0x0
The first group of libs you see in the list are the libs I was hoping it would show. This is all so I can debug it with gdb locally while running gdbserver on the target. I had it working fine about a month ago then something in our build system must have changed screwing it all up. Hmmmmm....
 
  


Reply

Tags
ldd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why I cannot run the compiled executable in other pc? christyyim Linux - Newbie 5 12-23-2008 03:18 AM
version GLIBC_2.3 not found error when cross compiled executable is run on targert sateeshgalla Programming 3 05-14-2008 10:42 AM
"list dynamic dependency" of an executable using command other than "ldd" Amrita@3086 Solaris / OpenSolaris 3 04-04-2007 04:56 AM
problem with the cross compiled executable??? raklo Linux - Kernel 0 04-03-2007 07:16 AM
Executable compiled w/gcc won't run brancheb Programming 5 05-16-2004 01:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration