34

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?

0

1 Answer 1

56

“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.

6
  • 1
    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. Commented Sep 20, 2017 at 11:28
  • 7
    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). Commented Sep 20, 2017 at 11:29
  • 4
    Yes, exactly; I don’t think your question is unclear. However many people will just stop at “LSB” and reply “Linux Standard Base”. Commented Sep 20, 2017 at 11:32
  • 1
    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. Commented Sep 20, 2017 at 17:38
  • 1
    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. Commented Nov 7, 2019 at 10:37

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.