Don't allow text relocations on 64-bit.

I've also updated our <sys/exec_elf.h> to match upstream.

Change-Id: I52f9fce3167541811208d273ff23ceaa112f7135
This commit is contained in:
Elliott Hughes
2013-10-28 14:19:05 -07:00
parent 3ec5d8954b
commit e4d792adb8
4 changed files with 65 additions and 27 deletions

View File

@@ -183,7 +183,9 @@ struct soinfo {
// value to get the corresponding address in the process' address space.
Elf_Addr load_bias;
#if !defined(__LP64__)
bool has_text_relocations;
#endif
bool has_DT_SYMBOLIC;
void CallConstructors();
@@ -195,15 +197,16 @@ struct soinfo {
void CallFunction(const char* function_name, linker_function_t function);
};
extern soinfo libdl_info;
// The possible DT_FLAGS bits are in
// http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#dynamic_section
// but not in the upstream NetBSD <sys/exec_elf.h> header file ours is based on.
#define DF_ORIGIN 0x1
#define DF_SYMBOLIC 0x2
#define DF_TEXTREL 0x4
#define DF_BIND_NOW 0x8
#define DF_STATIC_TLS 0x10
// These aren't defined in <sys/exec_elf.h>.
#ifndef DT_PREINIT_ARRAY
#define DT_PREINIT_ARRAY 32
#endif
#ifndef DT_PREINIT_ARRAYSZ
#define DT_PREINIT_ARRAYSZ 33
#endif
extern soinfo libdl_info;
void do_android_update_LD_LIBRARY_PATH(const char* ld_library_path);
soinfo* do_dlopen(const char* name, int flags);