Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Question of terminology and classification.

Is DLL an "executable file"?

http://en.wikipedia.org/wiki/Executable

share|improve this question
2  
Both EXE files and DLL files are in the "Portable Executable" (PE) format. The formal difference is down to one bit in the Characteristics field in the header. If bit 0x2000 is set, it's a DLL. But usually a DLL will also have a list of available functions. –  MSalters May 16 '13 at 22:55
add comment

4 Answers

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.

share|improve this answer
4  
FYI - Since DLLs do contain executable code, they get scanned by virus scanners. –  Keltari May 16 '13 at 13:26
    
@Keltari Good point - which is also why you should avoid downloading DLLs from shady places on the web. –  AcId May 16 '13 at 13:29
add comment

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.

share|improve this answer
1  
"According to the Wikipedia article a DLL is an executable file" - actually, it doesn't say that. You are making the common logic mistake of confusing necessary and sufficient conditions. That wikipedia quote states that having executable code is a necessary condition for something to be an executable file, not that it is a sufficient condition. –  BlueRaja May 16 '13 at 20:59
    
@BlueRaja And which sufficient condition did you see in the Wikipedia article? What do you think the Wikipedia article says about DLL files? –  Werner Henze May 17 '13 at 9:27
1  
The phrase 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) –  BlueRaja May 17 '13 at 16:53
add comment

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.

share|improve this answer
    
You can put the very same things inside an .EXE as well. Both use the "Portable Executable" (PE) format. –  MSalters May 16 '13 at 22:50
add comment

DLL files contain executable code, but it's not all-sufficient.

Usually, DLL file contains library functions, helpers.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.