cc87d1d56b0e1cef0131d9193c702d528417b61a |
|
17-Sep-2013 |
David 'Digit' Turner <digit@android.com> |
crazy_linker: refactor shared RELRO API. This patch changes the way shared RELRO section are implemented to make them less confusing with regards of ashmem region ownership, and support "relocated RELROs". Now: - The client explicitely creates the shared RELRO region with crazy_library_create_shared_relro(), this allocates an Ashmem region, but does not map it in the address space. The client becomes the owner of the Ashmem file descriptor and is now responsible for closing it. - The client maps a shared RELRO region with crazy_library_use_shared_relro(), as before, this doesn't transfer ownership of the Ashmem region file descriptor to the library. Note that this function does _not_ close the file descriptor, unlike the previous crazy_library_use_relro_sharing(). - crazy_library_create_shared_relro() also supports "relocated RELRO", i.e. when one wants to create a RELRO section that will be populated with data corresponding to a _different_ load address than what the library is currently using in the current process. A new unit test (test_relocated_shared_relro) has been added to test this feature. + Some internal refactoring, to prepare for future work (e.g. the ability to lookup symbols directly into system libraries). Change-Id: I597b99889115d1d504ec2d172a9d259edbeee823
|