You are not logged in.

#1 2010-09-08 02:13:44

randall
Member
From: Dallas, TX
Registered: 2010-01-02
Posts: 4

Unexpected behavior from multi-lib ldd (SOLVED)

Hello everyone,

I just did a fresh install using the dual architecture netinstall image. I've enabled the new multi-lib repo and installed the multi-lib gcc compiler and 32-bit libc, and ldd doesn't provide the output that I was expecting. It's probably my misunderstanding or something I messed up in my haste to get everything setup, but I wanted to verify.

First, I created a small test program:

$ cat > a.c
main(){}

Then I compiled using

$ gcc a.c

Then I inspected the output

$ file ./a.out
a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped

and

$ ldd ./a.out
linux-vdso.so.1 =>  (0x00007fff0c1ff000)
libc.so.6 => /lib/libc.so.6 (0x00007f766d60a000)
/lib/ld-linux-x86-64.so.2 (0x00007f766d966000)

Which looks okay to me. However, if I compile like this to get a 32-bit executable

gcc -m32 a.c

and then inspect a.out, I get this

$ file ./a.out
./a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped

and

$ ldd ./a.out
   not a dynamic executable

and

$ /usr/lib32/ld-2.12.1.so --list ~/a.out
        linux-gate.so.1 =>  (0xf7743000)
        libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf763b000)
        libm.so.6 => /usr/lib32/libm.so.6 (0xf7616000)
        libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf75fc000)
        libc.so.6 => /usr/lib32/libc.so.6 (0xf74b0000)
        /lib/ld-linux.so.2 => ./ld-2.12.1.so (0xf7744000)

Is this the normal expected behavior from ldd? It looks like everything is resolved correctly and the 32-bit a.out still runs.

Last edited by randall (2010-09-08 05:56:33)

Offline

#2 2010-09-08 04:42:01

yejun
Member
Registered: 2009-10-21
Posts: 66

Re: Unexpected behavior from multi-lib ldd (SOLVED)

You need a patched ldd which is in wine. I think it will be fixed in next version.

Offline

#3 2010-09-08 05:56:17

randall
Member
From: Dallas, TX
Registered: 2010-01-02
Posts: 4

Re: Unexpected behavior from multi-lib ldd (SOLVED)

Alright. Thanks for the info.

Offline

Board footer

Powered by FluxBB