(__elf_machine_runtime_setup): DT_PLTGOT has already been relocated. (__elf_machine_fixup_plt): Likewise. Minor cleanups.

This commit is contained in:
Ulrich Drepper 1999-03-04 23:26:43 +00:00
parent 809d570d5d
commit f1d3452762
1 changed files with 16 additions and 26 deletions

View File

@ -163,8 +163,7 @@ __elf_machine_runtime_setup (struct link_map *map, int lazy, int profile)
/* Fill in the PLT. Its initial contents are directed to a
function earlier in the PLT which arranges for the dynamic
linker to be called back. */
Elf32_Word *plt = (Elf32_Word *) ((char *) map->l_addr
+ map->l_info[DT_PLTGOT]->d_un.d_val);
Elf32_Word *plt = (Elf32_Word *) map->l_info[DT_PLTGOT]->d_un.d_val;
Elf32_Word num_plt_entries = (map->l_info[DT_PLTRELSZ]->d_un.d_val
/ sizeof (Elf32_Rela));
Elf32_Word rel_offset_words = PLT_DATA_START_WORDS (num_plt_entries);
@ -277,8 +276,7 @@ __elf_machine_fixup_plt(struct link_map *map, const Elf32_Rela *reloc,
Elf32_Word *plt;
Elf32_Word index;
plt = (Elf32_Word *)((char *)map->l_addr
+ map->l_info[DT_PLTGOT]->d_un.d_val);
plt = (Elf32_Word *) map->l_info[DT_PLTGOT]->d_un.d_val;
index = (reloc_addr - plt - PLT_INITIAL_ENTRY_WORDS)/2;
if (index >= PLT_DOUBLE_SIZE)
{
@ -351,20 +349,16 @@ __process_machine_rela (struct link_map *map,
case R_PPC_ADDR24:
if (finaladdr > 0x01fffffc && finaladdr < 0xfe000000)
{
_dl_signal_error (0, map->l_name,
"R_PPC_ADDR24 relocation out of range");
}
*reloc_addr = (*reloc_addr & 0xfc000003) | (finaladdr & 0x3fffffc);
break;
case R_PPC_ADDR16:
case R_PPC_UADDR16:
if (finaladdr > 0x7fff && finaladdr < 0x8000)
{
_dl_signal_error (0, map->l_name,
"R_PPC_ADDR16 relocation out of range");
}
*(Elf32_Half*) reloc_addr = finaladdr;
break;
@ -384,10 +378,8 @@ __process_machine_rela (struct link_map *map,
case R_PPC_ADDR14_BRTAKEN:
case R_PPC_ADDR14_BRNTAKEN:
if (finaladdr > 0x7fff && finaladdr < 0x8000)
{
_dl_signal_error (0, map->l_name,
"R_PPC_ADDR14 relocation out of range");
}
*reloc_addr = (*reloc_addr & 0xffff0003) | (finaladdr & 0xfffc);
if (rinfo != R_PPC_ADDR14)
*reloc_addr = ((*reloc_addr & 0xffdfffff)
@ -399,10 +391,8 @@ __process_machine_rela (struct link_map *map,
{
Elf32_Sword delta = finaladdr - (Elf32_Word) (char *) reloc_addr;
if (delta << 6 >> 6 != delta)
{
_dl_signal_error (0, map->l_name,
"R_PPC_REL24 relocation out of range");
}
*reloc_addr = (*reloc_addr & 0xfc000003) | (delta & 0x3fffffc);
}
break;