.so problem

Gergely Tamás gertom@rgai.hu
Fri Apr 4 08:11:00 GMT 2003


Emmanuel Arazo wrote:
> Sorry I can't seem to forward my messages to gnu-help mailing list. 
> Kindly forward my message if you received this..
> 
> Thanks.
> 
>  
> 
> Hello.
> 
> What actually are the errors or comments that caused any problems. Or, 
> what are you really trying to do?

I have an arm-linux system with 2.4.18-rmk3 kernel headers. I made a gcc 
cross compiler (binutils, gcc, glibc) on a pc host for arm-linux target with 
the same header files. I compiled and linked some simple programs with this 
cross-compiler, but when I tried to run them, the linux said: "No such file 
or directory". I examined a program, and found that in the section named 
".interp" it contained the value "/usr/lib/ld.so.1". There is no such file 
on the target system. Then I examined a 'good' executable, and it contained
"/lib/ld-linux.so.2" in the mentioned section. If I create a link: 
/usr/lib/ld.so.1->/lib/ld-linux.so.2, my program segfaults.

> 
> Cross-compiled libraries (eg. *.so files) should not be placed in 
> /usr/lib directory, that is in the host side, or it will destroy the 
> proper function of your host box.

Yes, on the host, they are collected on a separate directory by using 
--prefix during configuration.

> When compiling try to use --prefix as 
> a compile option during configuration. ld* files are created from glibc 
> package. Link files for ld files will be created after issuing "make 
> install" in glibc...

Yes, on the host, I found ld-linux.so.2 in the directory I used with 
--prefix. If I copy this file on the target system as ld.so.1 and run my 
program, it says: "error while loading shared libraries: libc.so.6: cannot 
open shared object file: No such file or directory".

> 
> Eman

I'm trying to make a working cross-compiler, that uses ld-linux.so.2 instead 
of ld.so.1 (not only the name, but the shared object). Should I tell this to 
binutils, gcc or glibc; and how?

Thanks

> 
>  Muthukumar Ratty <muthu@iqmail.net> wrote:
> 
> 
>     Sorry, typo :)
> 
>     s/ld.so.2/ld-linux.so.2
> 
>     On Thu, 3 Apr 2003, Muthukumar Ratty wrote:
> 
>      > On Thu, 3 Apr 2003, [ISO-8859-2] Gergely Tamás wrote:
>      >
>      > > I'm trying to cross-compile for arm-linux. After linking, the
>     executables
>      > > contain "/usr/lib/ld.so.1" in the ".interp" section. But the
>     only similar
>      > > file I have in the $(PREFIX)/lib directory is ld-linux.so.2
>      >
>      > If this file is for ARM then either
>      > 1. you can create a ld.so.2 as symbolic link to this one OR
>      > 2. you can edit the gcc spec files to change the ld.so.1 to
>     ld.so.2 OR
>      > 3. you can explicitly pass it to linker as option
>      >
>      >
>      > >
>      > > - Could anyone tell me where the value of the ".interp" section
>     comes from?
>      > > - Does /usr/lib/ld.so.1 comes with the linux system or belongs
>     to binutils
>      > > or gcc or glibc?
>      > >

-- 
**************************************************************************
* Gergely Tamás                                    e-mail:gertom@rgai.hu *
* ICQ:104783919                                    http://gertom.rgai.hu *
**************************************************************************



More information about the Gcc-help mailing list