diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-02-19 10:57:29 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-02-19 10:57:29 -0800 |
commit | 6f04a0f4c72acff80dad04828cb69ef67fa609d1 (patch) | |
tree | 915db7d93cb742f72b5d3819e69f48cb29c40a15 /linker | |
parent | 2489551343aa89fc539f369f7689c941b78c08d1 (diff) | |
download | bionic-6f04a0f4c72acff80dad04828cb69ef67fa609d1.zip bionic-6f04a0f4c72acff80dad04828cb69ef67fa609d1.tar.gz bionic-6f04a0f4c72acff80dad04828cb69ef67fa609d1.tar.bz2 |
auto import from //branches/cupcake/...@132276
Diffstat (limited to 'linker')
-rw-r--r-- | linker/linker.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/linker/linker.c b/linker/linker.c index 572f1d6..7b19835 100644 --- a/linker/linker.c +++ b/linker/linker.c @@ -1133,13 +1133,25 @@ static int reloc_library(soinfo *si, Elf32_Rel *rel, unsigned count) switch(type){ #if defined(ANDROID_ARM_LINKER) case R_ARM_JUMP_SLOT: + COUNT_RELOC(RELOC_ABSOLUTE); + MARK(rel->r_offset); + TRACE_TYPE(RELO, "%5d RELO JMP_SLOT %08x <- %08x %s\n", pid, + reloc, sym_addr, sym_name); + *((unsigned*)reloc) = sym_addr; + break; case R_ARM_GLOB_DAT: + COUNT_RELOC(RELOC_ABSOLUTE); + MARK(rel->r_offset); + TRACE_TYPE(RELO, "%5d RELO GLOB_DAT %08x <- %08x %s\n", pid, + reloc, sym_addr, sym_name); + *((unsigned*)reloc) = sym_addr; + break; case R_ARM_ABS32: COUNT_RELOC(RELOC_ABSOLUTE); MARK(rel->r_offset); TRACE_TYPE(RELO, "%5d RELO ABS %08x <- %08x %s\n", pid, reloc, sym_addr, sym_name); - *((unsigned*)reloc) = sym_addr; + *((unsigned*)reloc) += sym_addr; break; #elif defined(ANDROID_X86_LINKER) case R_386_JUMP_SLOT: @@ -1591,13 +1603,13 @@ static int link_image(soinfo *si, unsigned wr_offset) } #endif - /* If this is a SETUID programme, dup /dev/null to openned stdin, + /* If this is a SET?ID program, dup /dev/null to opened stdin, stdout and stderr to close a security hole described in: ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-02:23.stdio.asc */ - if (getuid() != geteuid()) + if (getuid() != geteuid() || getgid() != getegid()) nullify_closed_stdio (); call_constructors(si); notify_gdb_of_load(si); |