linker: get rid of the buddy allocator

Currently, the Android linker is placing shared libraries into
a well-known spot in memory.  This is interfering with the kernel's
ASLR support.

This change stops forcing non-prelinked libraries into a particular
address space.

Also, get rid of FLAG_PRELINKED.  As best I can tell, this flag
is never used.

Change-Id: I527af12fb54f821c2b5ca7693dbf63d022f8f4ae
This commit is contained in:
Nick Kralevich
2011-07-14 12:45:40 -07:00
parent 30e30acf10
commit 7059b1f02e
5 changed files with 15 additions and 277 deletions

View File

@@ -83,7 +83,6 @@ typedef struct soinfo soinfo;
#define FLAG_LINKED 0x00000001
#define FLAG_ERROR 0x00000002
#define FLAG_EXE 0x00000004 // The main executable
#define FLAG_PRELINKED 0x00000008 // This is a pre-linked lib
#define SOINFO_NAME_LEN 128
@@ -95,8 +94,6 @@ struct soinfo
unsigned entry;
unsigned base;
unsigned size;
// buddy-allocator index, negative for prelinked libraries
int ba_index;
unsigned *dynamic;
@@ -154,17 +151,6 @@ struct soinfo
extern soinfo libdl_info;
/* these must all be powers of two */
#ifdef ARCH_SH
#define LIBBASE 0x60000000
#define LIBLAST 0x70000000
#define LIBINC 0x00100000
#else
#define LIBBASE 0x80000000
#define LIBLAST 0x90000000
#define LIBINC 0x00100000
#endif
#ifdef ANDROID_ARM_LINKER
#define R_ARM_COPY 20