[fpc-pascal] Mixing PIC non-PIC code/variables when linking a shared library

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Nov 17 08:51:57 CET 2014


On 17 Nov 2014, at 05:04, Dmitry Boyarintsev wrote:

> Linker fails to generate an .SO file complaining about a bad code  
> generated
> for:
> TC_RICHMEMO_RTFLOADSTREAM
> Where RTFLoadStream is declared as:
> var
>  RTFLoadStream : function (AMemo: TCustomRichMemo; Source: TStream):
> Boolean = nil;
> The variable doesn't seem to be exported by the library in any way.
> Are global variables treated in some special manner when generating  
> shared
> library?

All global data, exported or not, need special code to be accessed in  
a position-independent way on most targets (including x86-64).


Jonas



More information about the fpc-pascal mailing list