[fpc-devel] Internal linker bug?

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Thu Jun 25 14:21:55 CEST 2015

patspiper wrote:
> Hi,
> Linking a pascal project (with {$L mylib.obj}) with a specific .obj 
> (COFF32) file using the internal linker (Windows) yields an executable 
> that produces an exception when run. On the other hand, the external 
> linker produces a sane executable.
> The executable is supposed to contain calls from a unit to public 
> functions in the .obj file, but these calls are to incorrect locations 
> while the surrounding code is correct, hence the exception.
> eg:
> External linker (correct): call function1
> Internal linker  (wrong) :  call <fpc_widestr_to_ansistr+40>
> A dump of the .obj file shows that all public functions have an offset 
> (value) in the symbol table, but no relocation entry, whereas 
> Static/Nonpublic and external symbols have a relocation entry even if 
> the symbol table entry offset (value) is 0.
> Is this a bug in the internal linker especially that the external linker 
> does exhibit this behaviour?
> Note: I am not too involved in .obj formats, so pls bear with me if the 
> above is inaccurate.

For the benefit of anybody who's not followed the thread, summary at 
including a link to the conversion tool (originally suggested by José 

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the fpc-devel mailing list