<div dir="ltr">Hi, <div><br></div><div>would like to use LLVM as backend for a compiler. One of the features I would like to implement is segment based addressing for position independent data. For some it may sound strange, for others the opposite. </div><div><br></div><div>No need to write complex story. Imagine you have a custom alocator that manages an area of 1GB of memory. Your application uses a custom allocator to allocate memory inside this area, and at the end of your code you save one to one that memory to disk. Next time you load that one 1GB where you can (addresses that are available) and by using segment based addressing all pointers inside would be valid independently where you loaded the 1GB.</div><div><br></div><div>Now on x64 I have GS/FS registers. Pitty enough their addresses can be changed only by the OS (not in user space). Not sure what "tools" are available on ARM, hopefully there is something.</div><div><br></div><div> New my question is, what is the best  way to tell LLVM to generate [FS:xxx] and/or [GS:xxxx] class of instructions?</div><div><br></div><div>thanks</div></div>