[fpc-devel]An idea how to fix lost exports in smart-linked Win32 DLLs

Peter Vreman peter at freepascal.org
Wed Jun 6 10:26:04 CEST 2001

> Hello,
> I see that also now FPC loses export info in win32 dlls by smartlinking. I think, this
problem could be easily solved.
> I self can try to fix it but I need some information. The mean of my idea:
> currently all .edatas are localized in static library as separate object modules. When
linker builds the chain of references
> it loses these modules. But we can link these .edatas not as a part of library but as
separate object files (.ow).
> They also could be merged into one object file (but not into library!).
> I made a preliminary test: I found in temporary .olw folder created by compiler for
building the static smart-link library the .ow
> files with export infos and simplely added them into linker script (link.res), directly
into the same GROUP() which contained
> smart-link libraries (I think, using IMPORT() with startup file would be also correct).
This test was successfull: I got correctly
> built DLL.
> If this way seems to be good solution, please report me where I could hook building of
these sw/ow files to include them into
> linker response file (and, desirablely, exclude from library).

That is very difficult, because normally the internal assembler is used that will create
the objectfiles directly in memory to write a signle library when finished.

I guess the an easier fix is to include a reference at the end of each exported procedure
to the export data for that procedure.

How does GCC solve this?

More information about the fpc-devel mailing list