Fri Mar 1 13:10:33 CET 2013
How to design binary data structures?
The main trouble is serialization of in-memory linked data structures.
However, there is a solution to this problem in wide use already:
application binaries. The program that prepares those binaries is a
linker, often split in 2 phases: compile time and run time linking.
This can be re-used by letting a linker generate a binary with a "base
address" of 0. The only measure this requires at load time is the
translation of all pointers to base-relative addressing.
It's probably even possible to include a relocation table in the
binary, so this doesn't need to be done manually.
EDIT: For my current case it seems simplest to perform the relocation
manually at load time. The data structure traversal for linking could
be re-used to perform additional consistency checks.