Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 1
    You should certainly never describe an executable, something which can be directly run from the command line, as a library, which cannot. Commented May 9 at 12:38
  • @PhilipKendall, can't a DLL be executable? I know that on Windows, the sole fundamental difference is a one-bit difference in a PE between a non-DLL executable and DLL is whether each's Characteristics field is set. Although DLLs expose tend to expose functions that an executable would not, I believe that both a PE and ELF can be executable in their own right, regardless. Commented May 9 at 16:11
  • 1
    Also, some libraries provide CLI to facilitate ccross-language use. Commented May 9 at 19:24
  • 1
    @PhilipKendall: You can make an ELF shared object (.so) that's usable as a library and also has its own _start entry point so is also executable. The fact that ELF supported that used to just be a silly computer trick, but was used as the basis for PIE executables to enable ASLR of static storage (.text/.rodata/.data/.bss). These days file knows to call it a PIE executable, but for years it would just say "shared object". It's still not normal for the same file to actually be used as a .so and an executable; the use-case would probably be for a library to have self-tests compiled in. Commented May 10 at 11:59