mirror of
https://github.com/corda/corda.git
synced 2025-06-16 22:28:15 +00:00
generate read-only code image in bootimage build
This avoids the requirement of putting the code image in a section/segment which is both writable and executable, which is good for security and avoids trouble with systems like iOS which disallow such things. The implementation relies on relative addressing such that the offset of the desired address is fixed as a compile-time constant relative to the start of the memory area of interest (e.g. the code image, heap image, or thunk table). At runtime, the base pointer to the memory area is retrieved from the thread structure and added to the offset to compute the final address. Using the thread pointer allows us to generate read-only, position-independent code while avoiding the use of IP-relative addressing, which is not available on all architectures.
This commit is contained in:
@ -3083,8 +3083,8 @@ class MyProcessor: public Processor {
|
||||
abort(s);
|
||||
}
|
||||
|
||||
virtual void boot(vm::Thread*, BootImage* image) {
|
||||
expect(s, image == 0);
|
||||
virtual void boot(vm::Thread*, BootImage* image, uint8_t* code) {
|
||||
expect(s, image == 0 and code == 0);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user