tags:

views:

108

answers:

1

Checking the source from /usr/bin/ldd, I see that it uses ld-linux to find the dependencies of an executable, although it first calls ld-linux with the --verify argument. Then the script acts differently according to the exit code of the ld-linux --verify call.

The man page for ld-linux does not provide any info on exit codes, and a Google search turns nothing of value. Is there some documentation anywhere (other than by looking at ld-linux's source code) that provides a list of exit codes for ld-linux --verfify and their respective meanings?

+1  A: 

I did some experiments and exit status is zero on success and 1 on failure. This includes grotesque abuse such as asking it to verify a shell script.

You'd be safe assuming zero on success, nonzero on failure, and no other information.

Norman Ramsey
That's not the case unfortunately. Zero is indeed "success", but there are a plethora of nonzero values, with plenty of meaning for each. e.g., ldd acts one way if the return value is either 0 or 2, and another way if the return value is 5. However, I have no idea what 2 means (5 means "invoked with __libc_enable_secure according to some comment in the script). So I can only suppose 2 means something, and there is a 3 and a 4 (at least).
Fred
@Fred: Bletch. You haven't told us why you need to know, but the only advice I have left for you is from a long time ago and far, far away: use the source, Luke!
Norman Ramsey