I have a DLL I built using Builder C++, it uses the FS segment to share memory between processes.
First, I fully share PascalDragon's feeling about the compiler using FS to access data. That is a completely unnecessary invitation to complicate the code and open the door to some subtle and very nasty problems, not to mention that is very inefficient.
#pragama datas_seg ("Shared")
int test;
#pragama data_seg();
I have a reader and writer exported functions, the actual DLL in use has a lot more than that obviously but that is what I do and in ASM land it uses the FS segment to store data in. I find it quite surprising that C++ Builder uses a segment register that is essentially, though not formally, reserved for Windows.
I don't think of pragmas as compiler switches but leaving that aside, creating shared data sections in a dll invites problems because a user dll has no way to ensure it is always loaded at the same address and the successful sharing of a data segment created that way depends on that (speculation: maybe that's the reason it's using FS instead of DS.) That mechanism is definitely safer when used in an exe because, even if the exe is not loaded at its preferred address, all subsequent instances of the exe will be loaded at the same address.
I strongly recommend that instead of using a shared data section, simply use a memory mapping. That way it doesn't matter at what address the dll is loaded, everything will work because each process will have its own correct address for the mapping. That applies to the C code and, once that's done, the port to FPC should be fairly straightforward. Also, if you do it that way, you may not even need a dll.
TTBOMK, there is no facility in FPC to define new sections and control which section the data definitions go into.
HTH.