diff options
author | David 'Digit' Turner <digit@google.com> | 2009-12-02 10:54:53 -0800 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2009-12-02 10:54:53 -0800 |
commit | fe62de1ad036a1417df44b7b1a7c65cc79dc7091 (patch) | |
tree | 0c55fda658ee39f7f64ead6ec98a690379a8fe42 /linker | |
parent | cd5df2d92c3adeac41e27aab5ba0f999c753c4c4 (diff) | |
download | bionic-fe62de1ad036a1417df44b7b1a7c65cc79dc7091.zip bionic-fe62de1ad036a1417df44b7b1a7c65cc79dc7091.tar.gz bionic-fe62de1ad036a1417df44b7b1a7c65cc79dc7091.tar.bz2 |
Add support for R_ARM_REL32 to the dynamic linker.
Merged from eclair-mr2
Diffstat (limited to 'linker')
-rw-r--r-- | linker/linker.c | 7 | ||||
-rw-r--r-- | linker/linker.h | 13 |
2 files changed, 14 insertions, 6 deletions
diff --git a/linker/linker.c b/linker/linker.c index 5090b11..80b5d00 100644 --- a/linker/linker.c +++ b/linker/linker.c @@ -1294,6 +1294,13 @@ static int reloc_library(soinfo *si, Elf32_Rel *rel, unsigned count) reloc, sym_addr, sym_name); *((unsigned*)reloc) += sym_addr; break; + case R_ARM_REL32: + COUNT_RELOC(RELOC_RELATIVE); + MARK(rel->r_offset); + TRACE_TYPE(RELO, "%5d RELO REL32 %08x <- %08x - %08x %s\n", pid, + reloc, sym_addr, rel->r_offset, sym_name); + *((unsigned*)reloc) += sym_addr - rel->r_offset; + break; #elif defined(ANDROID_X86_LINKER) case R_386_JUMP_SLOT: COUNT_RELOC(RELOC_ABSOLUTE); diff --git a/linker/linker.h b/linker/linker.h index d289c81..551cf93 100644 --- a/linker/linker.h +++ b/linker/linker.h @@ -159,6 +159,13 @@ extern soinfo libdl_info; #define R_ARM_JUMP_SLOT 22 #define R_ARM_RELATIVE 23 +/* According to the AAPCS specification, we only + * need the above relocations. However, in practice, + * the following ones turn up from time to time. + */ +#define R_ARM_ABS32 2 +#define R_ARM_REL32 3 + #elif defined(ANDROID_X86_LINKER) #define R_386_32 1 @@ -194,12 +201,6 @@ extern soinfo libdl_info; #define DT_PREINIT_ARRAYSZ 33 #endif -/* in theory we only need the above relative relocations, - but in practice the following one turns up from time - to time. fushigi na. -*/ -#define R_ARM_ABS32 2 - soinfo *find_library(const char *name); unsigned unload_library(soinfo *si); Elf32_Sym *lookup_in_library(soinfo *si, const char *name); |