summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-09-17 12:19:35 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-09-17 12:19:35 +0000
commit06da3d67a69f4688c7b58b14872fbf3c60349287 (patch)
treef06f5eb0e53c30bdd022eca7660e219ef6795a89
parentd88a7c90cc5b4abc9bc54f966f6be0e9eba3d465 (diff)
Bugfix: Add r_addend to final address. The r_addend is mostly zero
but can be nonzero for JMP relocs as well. All Rela arches need to do this, test and send a patch :) Remove unneeded test in R_PPC_COPY.
-rw-r--r--ldso/ldso/powerpc/elfinterp.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/ldso/ldso/powerpc/elfinterp.c b/ldso/ldso/powerpc/elfinterp.c
index 34a75cdea..0705fd596 100644
--- a/ldso/ldso/powerpc/elfinterp.c
+++ b/ldso/ldso/powerpc/elfinterp.c
@@ -215,7 +215,7 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
_dl_dprintf(2, "%s: can't resolve symbol '%s'\n", _dl_progname, symname);
_dl_exit(1);
};
-
+ finaladdr += this_reloc->r_addend;
#if defined (__SUPPORT_LD_DEBUG__)
if(_dl_debug_reloc && _dl_debug_detail)
_dl_dprintf(_dl_debug_file, "%x\n", finaladdr);
@@ -319,15 +319,13 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
break;
}
case R_PPC_COPY:
- if (symbol_addr) {
#if defined (__SUPPORT_LD_DEBUG__)
- if(_dl_debug_move)
- _dl_dprintf(_dl_debug_file,"\n%s move %x bytes from %x to %x",
- symname, symtab[symtab_index].st_size,
- symbol_addr, reloc_addr);
+ if(_dl_debug_move)
+ _dl_dprintf(_dl_debug_file,"\n%s move %x bytes from %x to %x",
+ symname, symtab[symtab_index].st_size,
+ symbol_addr, reloc_addr);
#endif
- _dl_memcpy((char *) reloc_addr, (char *) finaladdr, symtab[symtab_index].st_size);
- }
+ _dl_memcpy((char *) reloc_addr, (char *) finaladdr, symtab[symtab_index].st_size);
goto out_nocode; /* No code code modified */
case R_PPC_ADDR16_HA:
finaladdr += 0x8000; /* fall through. */