I have heard that "bpl is a special kind of dll", but I didn't expect that this sentence has such great significance. I recently saw someone writing export statements in a Unit belonging to a certain dpk, and I was very surprised. But looking at the help of delphi, all related to export are libraries. I read "delphi Source Code Analysis" today and then I learned the meaning of the above sentence. Therefore, there are the following inferences:
For DLL projects, exports can be written in either project files or Unit, no difference.
bpl is a kind of dll.
The exports above are normal.
In fact, according to the statement in "delphi Source Code Analysis", bpl only adds some features on the basis of dll, such as checking for duplicate Unit. The operating system considers bpl and dll to be the same type of files. And the book gives the TDump result for the simplest bpl:
package NullPackage;
Requires
rtl;
end.
E:/ls>tdump -m -ea:v NullPackage.bpl
Exports from NullPackage.bpl
7 exported name(s), 7 export address(s). Ordinal base is 1.
Sorted by RVA:
RVA Ord. Hint Name
--------------------------------------------------------------------------------------------------------------------------------
0000124C 1 0006 @GetPackageInfoTable
0000124C 2 0003 @NullPackage@@GetPackageInfoTable$QQrv
00001254 3 0002 @NullPackage@@PackageLoad$qqrv
00001254 7 0005 Initialize
00001260 4 0001 @NullPackage@@PackageUnload$qqrv
00001260 6 0004 Finalize
0000126C 5 0000 @NullPackage@initialization$qqrv
Have you seen several functions pointing to the same address? This is probably what exports means.
Off topic: Google is not easy to use today, so I had to use baidu, but it took a long time to make no results. I got Google in the afternoon and searched and found what I needed immediately. It seems that baidu still can't do it.