Closed elfmaster closed 1 year ago
Now fixed with the following patch at the end of calculate_text_size
in the event that the patch contains no .text data, we still create an empty text image of 4096 bytes and set the linker->flags value of SHIVA_MODULE_F_DUMMY_TEXT
to indicate that it doesn't contain anything.
+ if (linker->text_size == 0) {
+ linker->flags |= SHIVA_MODULE_F_DUMMY_TEXT;
+ linker->text_size = 4096;
+ }
Closing.
Shiva fails to load a module if it has a 0 byte text segment. This means that the following patch will fail to load.
Unless you include a body of code with it, even if the code isn't used.
Fix this so that we can submit data-only patches, as we are intended to be able to.