does a dll much differ to a lib?

Started by
27 comments, last by Paradigm Shifter 10 years, 1 month ago

lib has some object code and import and export table

and dll is the same, though dll is able to be linked in

runtime and lib do not

could maybe someone said what inner things in dll make

the difference and if this is heavy difference or not to much

would it to be hard to link to libs at runtime and what

changes in lib would be needed?

Advertisement

Read this

http://blog.aaronballman.com/2011/10/how-dll-imports-work/

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

Read this

http://stackoverflow.com/questions/140061/when-to-use-dynamic-vs-static-libraries

"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty
Read those excellent articles.

Both static linking and dynamic linking provide a way for your program to access functions from a library. The two have different use cases.

In some ways they are very similar; they are both libraries. In some ways they are very different, both have clearly stated objectives that are solve completely different problems.

Neither one will provide the magic zero-cost performance optimizations you seem to be hunting for lately.

I redded it (and do not find this articles excellent)

Those are not quite on topic, im asking for structural/

binary differences beetween dll and lib

In first article there is an info that in exe you have

IAT (function pointers table that is filled by loader

in load time) this is some answer on my previous

disasembly question but not the answer on structural/binary difference of dll over the lib files

(there is probably something more in dll than in lib butr what?)

Im not searching for zero-cost solutions here etc -

I am just recently more interested in disasembly

(esp in the topics related to linking [and loading] phase

stuff on win32) [i think it is important to understand but

articles i was encountering are not to much comunicative

for me, maybe becouse weak english i got a bit more trouble

to read and understand some things there]

You can think of it this way:
A DLL is a library that is fully linked already. A LIB library is just a collection of object files that have not been run through a linker.
lib files are basically collections of obj files. dll files use Portable Executable format which is modified from COFF format. obj files use COFF format. Wikipedia says "While extended versions of COFF continue to be used for some Unix-like platforms, primarily in embedded systems, perhaps the most widespread use of the COFF format today is in Microsoft's Portable Executable (PE) format. Developed for Windows NT, the PE format (sometimes written as PE/COFF) uses a COFF header for object files, and as a component of the PE header for executable files."

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

lib files are basically collections of obj files. dll files use Portable Executable format which is modified from COFF format. obj files use COFF format. Wikipedia says "While extended versions of COFF continue to be used for some Unix-like platforms, primarily in embedded systems, perhaps the most widespread use of the COFF format today is in Microsoft's Portable Executable (PE) format. Developed for Windows NT, the PE format (sometimes written as PE/COFF) uses a COFF header for object files, and as a component of the PE header for executable files."

so both lib and dll are coffs... (?).. both has import and export tables od symbols... (?) what is the difference..

You make it sound like the COFF format is simple. Out of curiosity I downloaded the specification from MS and it's like 100 pages long. It's likely that most of your answers will be there. Better get reading.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

You make it sound like the COFF format is simple. Out of curiosity I downloaded the specification from MS and it's like 100 pages long. It's likely that most of your answers will be there. Better get reading.

not useful answer (at all), also may be even misleading as you suggest that i should read coff specyfication to get answer - where there are much simpler ways as asking on the forum or at least searching through the tutorials

This topic is closed to new replies.

Advertisement