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.
Related videos on Youtube
Author by
yoyo_fun
Updated on September 18, 2022Comments
-
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 over 6 yearsThe 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 over 6 yearsThere 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 over 6 yearsMany 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 over 6 yearsYes, exactly; I don’t think your question is unclear. However many people will just stop at “LSB” and reply “Linux Standard Base”.
-
plugwash over 6 yearsI 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 over 4 yearsI'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.