This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiling binutils-2.14: -dynamic-linker ignored for libraries


On Sat, Jun 14, 2003 at 09:12:52PM +0000, Peter Hartlich wrote:
> Hello!
> 
> [I posted this to news:gnu.help.utils a few days ago. Since nobody
> answered there, I guess it's more appropriate on this list.]
> 
> I'm currently trying to compile binutils 2.14 (or 2.13, for that
> matter) on a system with a slashpackage[1]-like filesystem layout.
> glibc 2.3.2 is installed at /pkg/glibc-2.3.2, /pkg/glibc is a
> symbolic link to this directory.
> 
> gcc's specs file correctly points to the the dynamic linker at:
> /pkg/glibc/lib/ld-linux.so.2
> 
> First I tried to compile and install binutils to /pkg/binutils-2.14
> using the following CFLAGS:
> 
>   -Wl,-rpath -Wl,/pkg/glibc/lib -Wl,-rpath-link -Wl,/pkg/glibc/lib
>   -Wl,-L/pkg/glibc/lib
> 
> and:
> 
>   ../binutils-2.14/configure --prefix=/pkg/binutils-2.14
>   --enable-shared --disable-nls
> 
> However,  ldd /pkg/binutils-2.14/bin/* /pkg/binutils-2.14/lib/*
> showed the following output:
> 
>   ...
>   libc.so.6 => /pkg/glibc/lib/libc.so.6 (0x40017000)
>   /pkg/glibc-2.3.2/lib/ld-linux.so.2 => 
>   /pkg/glibc-2.3.2/lib/ld-linux.so.2 (0x40000000)
>   ...
> 
> So the dynamic linker wouldn't be found anymore after even a minor
> upgrade of the glibc. I then explicitly added
> 
>   -Wl,-dynamic-linker -Wl,/pkg/glibc/lib/ld-linux.so.2
> 
> to the CFLAGS mentioned above. Now, everything at
> /pkg/binutils-2.14/bin is fine: 
> 
>   $ ldd /pkg/binutils-2.14/bin/*
>   ...
>   libc.so.6 => /pkg/glibc/lib/libc.so.6 (0x40017000)
>   /pkg/glibc/lib/ld-linux.so.2 => /pkg/glibc/lib/ld-linux.so.2
>   (0x40000000)
>   ...
> 
> But at /pkg/binutils-2.14/lib, the problem still persists:
> 
>   $ ldd /pkg/binutils-2.14/lib/*
>   ...
>   libc.so.6 => /pkg/glibc/lib/libc.so.6 (0x40017000)
>   /pkg/glibc-2.3.2/lib/ld-linux.so.2 =>
>   /pkg/glibc-2.3.2/lib/ld-linux.so.2
>   (0x40000000)
>   ...
> 
> 
> Is there any way to get lib/* to use the right dynamic linker?

-dynamic-linker sets the value of the .interp section in binaries. 
Libraries don't get one (libc.so.6 is an exception, due to some magic).
The entry you're seeing above probably has nothing to do with
-dynamic-linker, and everything to do with -rpath.

Try using objdump -p and readelf; they are much more informative than
ldd.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]