This is the mail archive of the mailing list for the glibc 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: [Patch] ldd failures on multilb architectures

On Fri, Nov 14, 2003 at 10:48:32AM +0100, Hannes Reinecke wrote:
> Hi all,
> /usr/bin/ldd has some slight problems with multilib architectures. 
> First, it tries to execute all eligible '', but does not redirect 
> the output to /dev/null, so we always get the nasty 'Cannot execute 
> binary file' error message.

Who issues this error message? Works just fine for me in current CVS
(and several months old glibc too).
Say on s390x (looking at your signature):
echo 'int main () { return 0; }' > test.c
for i in -m31 -m64; do for j in "" -static; do gcc $i $j -o test test.c; ldd ./test; echo $?; done; done => /lib/ (0x4002d000)
        /lib/ => /lib/ (0x40000000)
        not a dynamic executable
1 => /lib64/tls/ (0x0000010000031000)
        /lib64/ => /lib64/ (0x0000010000000000)
        not a dynamic executable

which is the expected output.

> Second, '' might return 1 in case it found a statically linked 
> binary. Since ldd only checks for return codes 0 or 2, it fails horribly.

And this second change is clearly broken. will exit with 1 if any error happens, e.g. incompatible object
or statically linked object.  If you break for 1, you just killed multi-lib

> --- elf/
> +++ elf/
> @@ -127,10 +127,10 @@
>      RTLD=
>      for rtld in ${RTLDLIST}; do
>        if test -x $rtld; then
> -	verify_out=`${rtld} --verify "$file"`
> +	verify_out=`${rtld} --verify "$file" > /dev/null 2>&1`
>          ret=$?
>  	case $ret in
> -	[02]) RTLD=${rtld}; break;;
> +	[012]) RTLD=${rtld}; break;;
>  	esac
>        fi
>      done


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