tags:

views:

90

answers:

2

I'm having a hard time understanding the output of ldd - Especially the processor identifiers. The string in question is this one:

Shortest.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, from ']', not stripped

I have several questions about it:

  • What does "ELF" mean? I know that's what Linux binaries are called like (Windows Binaries are called PE Binaries, "Portable Executable" Binaries), but isn't ELF an abbreviation for something?
  • What does LSB mean? I can't even guess it...
  • I see the string "Intel" there, now I seriously wonder about the portability of Linux binaries, as ldd seems to expect every binary to be compiled on a intel processor... but what if it wasn't compiled on a Intel processor? Or when I attempt to run the binary on a computer that doesn't run ontop of a Intel processor?
  • Why the ']'? My guess is it should be some sort of Linker identify, but ']' doesn't look much like a Identifier...

Thanks in advance

+3  A: 

ELF is executable and Linkable Format - it specifies the format of the library - see Executable and Linkable Format. LSB specifies the endianness of the data. The Intel 386 means it will run on all chips compatible with the 386, which includes Pentiums, and AMD's chips, but not (say) Power PC or IBM/370 architectures.

As for the ']', this library wouldn't have anything to do with the test utility, would it? The one that allows you to say:

if test -x foobar

or

if [ -x foobar ]

in shell scripts.

anon
ldd itself is an shellscript, so yes, it's probably /bin/[ (or a shellbuiltin) - nevertheless, great answer, thanks!
nebukadnezzar
+3  A: 
  • ELF
  • LSB
  • Intel: Linux binaries are not meant to be portable accros CPUs and achitectures. This one is meant to be used on a CUP able to run Intel 80386 birary code.
  • ']': ??
Didier Trosset
Thanks for the Links. Although I wonder why Linux Binaries would have been designed *not* to be portable. doesn't compute, IMHO.
nebukadnezzar
Linux binaries are not portable. Windows binaries are not portable. Solaris binaries are not portable. AIX binaries are not portable ... To be portable, a binary format has to run on an interpreter (that is itself not portable), not on real CPU hardware.
Didier Trosset