13

When executing ldd on a file, it returns a hex number in parentheses for 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)
Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33
Zulakis
  • 7,859
  • 10
  • 42
  • 67
  • I don't know this for sure, but I don't think the hex number has anything to do with the version of the library - I think it's the (proposed/expected) address where that library would be mapped into the programs address space when you execute it. To see what version of a library you need, try `ldd -v`. – twalberg Nov 01 '12 at 21:16
  • If these values does not change each time you run ldd, just rip that system to shred and use a real, secure and up to date Linux system. – BatchyX Nov 01 '12 at 22:16
  • I think its useful to also note that this hex address may vary as documented here : https://stackoverflow.com/questions/2217023/ldd-shows-varied-addresses-on-x86-linux – still_learning Apr 11 '18 at 23:14

1 Answers1

13

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

Community
  • 1
  • 1
halex
  • 16,253
  • 5
  • 58
  • 67