How can I get information about a binary file that won't execute?

Solution 1:

It sounds like relocatable has to do with an object file that is not an executable.

Executables should look like this

ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=a8ff57737fe60fba639d91d603253f4cdc6eb9f7, stripped

Object files look like this

# file /usr/lib/x86_64-linux-gnu/crtn.o
/usr/lib/x86_64-linux-gnu/crtn.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped

If needed, you can also get more information this way

# objdump -x myfile

Or disassemble

# objdump -d myfile

List symbols from a object file (not stripped)

# nm /usr/lib/x86_64-linux-gnu/gcrt1.o
                 U atexit
0000000000000000 b called.4237
0000000000000000 D __data_start
0000000000000000 W data_start
                 U etext
0000000000000030 T __gmon_start__
0000000000000000 R _IO_stdin_used
                 U __libc_csu_fini
                 U __libc_csu_init
                 U __libc_start_main
                 U main
                 U _mcleanup
                 U __monstartup
0000000000000000 T _start

Trying to list symbols from executable (stripped)

# nm /bin/bash
nm: /bin/bash: no symbols