diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-11-12 20:09:29 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-11-12 20:09:29 +0000 |
commit | 2302879d9bcbe7eb4a88f8e158fe38e7318bc725 (patch) | |
tree | 737d8042dbeecad4dddce071f7cfbf53ca677092 | |
parent | 6eb9daddc5fb70c08f85a5393b40c5272f61208c (diff) |
A powerpc patch from Ronald Wahl:
Ok, now i got it after a day of work.
I have had a look into glibc and found the following:
sysdeps/powerpc/dl-machine.c:
...
case R_PPC_JMP_SLOT:
/* It used to be that elf_machine_fixup_plt was used here,
but that doesn't work when ld.so relocates itself
for the second time. On the bright side, there's
no need to worry about thread-safety here. */
{
Elf32_Sword delta = finaladdr - (Elf32_Word) reloc_addr;
...
The comment made me suspicious. The same position in uClibc looks like this:
ldso/ldso/powerpc/elfinterp.c:
...
case R_PPC_JMP_SLOT:
{
unsigned long targ_addr = (unsigned long)_dl_linux_resolve;
int delta = targ_addr - (unsigned long)reloc_addr;
...
When I change it to the following it works:
...
case R_PPC_JMP_SLOT:
{
unsigned long targ_addr = *reloc_addr;
int delta = targ_addr - (unsigned long)reloc_addr;
...
I hope it will not break anything. Can anyone review this change and
commit it into CVS?
thanks,
ron
-rw-r--r-- | ldso/ldso/powerpc/elfinterp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ldso/ldso/powerpc/elfinterp.c b/ldso/ldso/powerpc/elfinterp.c index adf95d63c..4919a2f01 100644 --- a/ldso/ldso/powerpc/elfinterp.c +++ b/ldso/ldso/powerpc/elfinterp.c @@ -403,7 +403,7 @@ int _dl_parse_relocation_information(struct elf_resolve *tpnt, break; case R_PPC_JMP_SLOT: { - unsigned long targ_addr = (unsigned long)_dl_linux_resolve; + unsigned long targ_addr = (unsigned long)*reloc_addr; int delta = targ_addr - (unsigned long)reloc_addr; if(delta<<6>>6 == delta){ *reloc_addr = OPCODE_B(delta); |