What does "LSB" mean when referring to executable files in the output of /bin/file?

21,294

“LSB” here stands for “least-significant byte” (first), as opposed to “MSB”, “most-significant byte”. It means that the binary is little-endian.

file determines this from the sixth byte of the ELF header.

Share:
21,294

Related videos on Youtube

yoyo_fun
Author by

yoyo_fun

Updated on September 18, 2022

Comments

  • yoyo_fun
    yoyo_fun over 1 year

    I have found the term "LSB executable" or "LSB shared object" in the output of the file command in Linux. For example:

    $ file /bin/ls
    /bin/ls: 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]=4637713da6cd9aa30d1528471c930f88a39045ff, stripped
    

    What does "LSB" mean in this context?

  • yoyo_fun
    yoyo_fun over 6 years
    The other answer stated something completely different... Linux Standard Base.... Why is there confusion regarding this subject? I think you are probably right. It sounds like a more reasonable explanation.
  • Stephen Kitt
    Stephen Kitt over 6 years
    There is confusion because “LSB” is an acronym covering different meanings. It can mean “Linux Standard Base” in other contexts; however in file’s output it means “least-significant byte” (as evidenced by the source code I linked to).
  • yoyo_fun
    yoyo_fun over 6 years
    Many acronyms mean many different things. However my question was not: "What does LSB mean?" , but a more specific one regarding strictly executable files in ELF format.
  • Stephen Kitt
    Stephen Kitt over 6 years
    Yes, exactly; I don’t think your question is unclear. However many people will just stop at “LSB” and reply “Linux Standard Base”.
  • plugwash
    plugwash over 6 years
    I expect the confusion stems from a few things. 1. Writing "LSB" on it's own to indicate little endian is pretty unusual. 2. The Linux standards base standardised quite a bit about modern linux systems. 3. Most Linux users have probabblly never used a big-endian Linux system.
  • EML
    EML over 4 years
    I've spent years thinking that the output meant the other LSB. The 'file' maintainers really need to change their output to something more obvious, like LE/BE.