Welcome to Unix & Linux SE!
An ELF file has a binary header or two, and a number of named sections. Wikipedia has a description of the structure of an ELF file, if you're interested.
objcopy -O binary -j .interp /bin/ls /dev/stdout command just outputs the contents of the
.interp section of file
/bin/ls exactly as-is (
-O binary) to "file"
/dev/stdout should be a symbolic link to the current process's file descriptor #1, i.e. its standard output stream. It's basically just a way to tell a program that expects to write its output to a named file to use the standard output instead. Some programs can do that if you specify the output filename as just
-, but apparently
objcopy does not follow that convention.
If you're seeing "some sort of log information" when opening
/dev/stdout, it might mean this symbolic link has been accidentally replaced by some program or script that has been run as root. It should look like this:
$ ls -l /dev/stdout
lrwxrwxrwx 1 root root 15 Nov 17 23:25 /dev/stdout -> /proc/self/fd/1
On a 64-bit x86 system, your
objcopy command should output something like
/lib64/ld-linux-x86-64.so.2. Since the output does not include a line-feed character at the end, it might appear on the same line as the next command prompt, making it harder to spot:
[my command prompt]$ objcopy -O binary -j .interp /bin/ls /dev/stdout
/lib64/ld-linux-x86-64.so.2[my command prompt]$
On a 32-bit x86 binary, the output would be something like
The output is the filename of the program interpreter aka the dynamic linker/loader that should be used with the examined binary. You can get more information about it using the
man ld.so or
man ld-linux commands on your system.