Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ldd hex number in parentheses

Tags:

linux

ldd

When executing ldd on a file, it returns a hex number in parentheses vor every library it found.

For example:

root@server> ldd wpa_supplicant
        linux-gate.so.1 =>  (0xb779b000)
        libnl.so.1 => /usr/lib/libnl.so.1 (0xb774d000)
        libssl.so.1.0.0 => not found
        libcrypto.so.1.0.0 => not found
        libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7748000)
        libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb75ed000)
        libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb75c7000)
        /lib/ld-linux.so.2 (0xb779c000)

If the hex number is not the one of the library the executable once got linked against, a version information error may occur.

I got two questions:

  1. Where does this value originate?
  2. How can I find out which hex value the executable is looking for? (i.e. the one it originally got linked against)
like image 903
Zulakis Avatar asked Nov 01 '12 21:11

Zulakis


People also ask

What does LDD output mean?

ldd (List Dynamic Dependencies) is a *nix utility that prints the shared libraries required by each program or shared library specified on the command line. It was developed by Roland McGrath and Ulrich Drepper. If some shared library is missing for any program, that program won't come up.

What does LDD command do?

What is Ldd. Ldd is a powerful command-line tool that allows users to view an executable file's shared object dependencies. A library refers to one or more pre-compiled resources such as functions, subroutines, classes, or values. Each of these resources is combined to create libraries.

How do you use LDD?

How to use the ldd command? Basic usage of ldd is fairly simple - just run the 'ldd' command along with an executable or shared object file name as input. So you can see all shared library dependencies have been produced in output.


1 Answers

The hexadecimal numbers are the memory addresses the respective library gets loaded into. See https://stackoverflow.com/a/5130690/637284 for further explanation.

like image 80
halex Avatar answered Sep 19 '22 20:09

halex