Make the linker relocatable.

Previously, the linker always loaded itself into the same
location in memory, which inhibited the effectiveness of Android's
ASLR implementation. Modify the linker code so it can be relocatable
and link itself at runtime.

Change-Id: Ia80273d7a00ff648b4da545f4b69debee6343968
This commit is contained in:
Nick Kralevich
2011-11-11 15:53:17 -08:00
parent 0aa8289c6f
commit 468319ce4f
3 changed files with 121 additions and 44 deletions

View File

@@ -83,6 +83,7 @@ typedef struct soinfo soinfo;
#define FLAG_LINKED 0x00000001
#define FLAG_ERROR 0x00000002
#define FLAG_EXE 0x00000004 // The main executable
#define FLAG_LINKER 0x00000010 // The linker itself
#define SOINFO_NAME_LEN 128