0

Is it possible to use a command line utility in Linux to determine what is linked into my executable?

A way to prove I am not linking, statically or dynamically, to another piece of specific code.

user_ABCD
  • 347
  • 2
  • 15
  • Have you looked at ldd? I think this is what you want, but not sure I understand the question. – TWhelan Sep 26 '16 at 18:14
  • Yes that is kind of what I am looking for, but it only does .so files/dynamic linking, right? – user_ABCD Sep 26 '16 at 18:20
  • http://stackoverflow.com/questions/1124571/get-list-of-static-libraries-used-in-an-executable has a suggestion (use nm), but that's not super useful. If you want to really prove it you could try to compile/link/run in a 'clean' environment without the 'specific code' in question. – TWhelan Sep 26 '16 at 18:26

1 Answers1

2

As stated in the comments - for dynamic linking, you have ldd.

But if you want to see the statically linked libraries, it gets difficult and depends on your setup: if you own the source code the accepted answer:

is your friend.

If not, you will at least have to know which libraries are suspected to be statically linked at.

If you have a huge code base and need to provide legal evidence you can use a software like black duck which checks even if a developer has copied source code with not matching licenses.

data cosmos
  • 313
  • 3
  • 14