Question of terminology and classification.
Is DLL an "executable file"?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityQuestion of terminology and classification.
Is DLL an "executable file"?
A DLL file is not by it self executable, though it may contain executable code. A DLL (Dynamic-Link Library) contains code, data, resources etc. usable by other programs. You need an EXE file for the operating system to execute code within DLL files, like "RUNDLL.EXE" or "RUNDLL32.exe" in windows.
According to the Wikipedia article a DLL is an executable file.
In computing, an executable file causes a computer "to perform indicated tasks according to encoded instructions," as opposed to a data file that must be parsed by a program to be meaningful.
Taking this definition a DLL is an executable because it contains encoded instructions to perform a task.
The exact interpretation depends upon the use; while the term often refers only to machine code files, in the context of protection against computer viruses all files which cause potentially hazardous instruction execution, including scripts, are conveniently lumped together.
This is also true for DLLs.
But some might argue that a DLL cannot run by itself, it always needs some program which loads the DLL and calls a function exported by the DLL, so in a strict sense you might also say that only exe-files (if on Windows) are executable files. As Wikipedia says...
The exact interpretation depends upon the use
I would try to use terms or phrases that make it more clear and avoid speaking of executable files if it is not clear in the given context if DLLs are included or not. Even at my work (software developer) I'ld not be sure that everyone always would agree that "executable files" also means DLLs.
an executable file causes a computer "to perform indicated tasks according to encoded instructions"
describes a sufficient condition, not a necessary one. So, it says "is an executable file => contains machine code," which is not the same thing as the statement you're confusing it for, "contains machine code => is an executable file." I'm not sure why you're bringing up the article on DLL's, as you did not reference that one at all (you quoted the article on executable files)
May 17, 2013 at 16:53
No they aren't, even if they use a similar file format, DLLs are a kind of storage place where you can put anything useful to your executable. The executable will link to the DLL and load object code, icons, and many other things.
DLL files contain executable code, but it's not all-sufficient.
Usually, DLL file contains library functions, helpers.
Wikipedia articles are not authoritive. The Wikipedia requires other authorities. A good authority for the definition of executable relative to DLLs would be the Microsoft documentation, such as Dynamic-Link Libraries (Dynamic-Link Libraries) - Win32 apps | Microsoft Docs.
Originally in the time before dynamic linking there was only static linking. Compilers such as C and C++ compilers would generate an object file for each source file read in. They still do. Then the object files are linked together into an executable file. But the executable is created from one or more object files. For convenience it is possible to put object files into a library that can be statically linked by the link editor. A dynamic link library is an extension of static libraries where the library file is used by the link editor but the executable code exists in a separate file for use during execution. Therefore a dynamic link library is designed to contain executable code as much as the main executable file that calls all the DLLs it uses, either directly or indirectly.
Characteristics
field in the header. If bit0x2000
is set, it's a DLL. But usually a DLL will also have a list of available functions.