What does `dll exporting / importing` mean?

I am very confused by this terminology. I absolutely dislike the word export in the context of dll. The only reason is that I do not understand what it is. I do not know where to look.

It is used in many cases.

  • Export from DLL
  • export table from shared library
  • functions exported by dll.

Can someone explain. What does it mean? As in any other context, how does its meaning change? What is an export table? Is it like a .text / .bss / .data section in a PE / ELF file?

Why have I never heard of dll import ? If such a thing exists. When it is used. If it is not too much, a simple example will also be great.

Please clarify, and I kindly ask everyone to use simple terminology. I'm already confused.

+4
source share
1 answer

A function is exported from a dll when it is exposed to other programs. The DLL export table is a list of functions that are expanded and the addresses at which they are available. Typically, a dll contains some functions that are exported for public consumption, and other functions that are not exported — they cannot be called by other dlls or programs using conventional methods, but they can be called internally dlls.

You don't often talk about "dll import" because dll import is not a single process. When you reference a dll, every function exported by that DLL becomes available to your DLL, but in order to reference a dll, you usually need a .h file that gives you declarations and a .lib file that provides stub pointers to exported functions. These two things together make up the import dll. However, using the LoadLibrary and GetProcAddress functions, you can use dll functions without the POSIX equivalent of dlopen and dlsym ).

+4
source

Source: https://habr.com/ru/post/1299769/


All Articles