linker: don't perform unnecessary mprotects
The linker only needs to mark the text segment as writable iff the file has text relocations. Unnecessarily calling mprotect when it isn't necessary is slow, and some security enhanced kernels don't like it. Pages which are simultaneously writable and executable are considered a no-no. The vast majority of executables / shared libraries on Android do NOT have text relocations. Change-Id: Ic38ce30a99b7e33ecf21efd9c108547a58eafa35
This commit is contained in:
@@ -176,6 +176,7 @@ struct soinfo
|
||||
/* When you read a virtual address from the ELF file, add this
|
||||
* value to get the corresponding address in the process' address space */
|
||||
Elf32_Addr load_bias;
|
||||
int has_text_relocations;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user