mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 11:00:01 +08:00
* elf32-ppc.c (ppc_elf_relax_section): Correct conditions under
which find_plt_ent is called. Delete redundant code.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2009-08-04 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* elf32-ppc.c (ppc_elf_relax_section): Correct conditions under
|
||||||
|
which find_plt_ent is called. Delete redundant code.
|
||||||
|
|
||||||
2009-08-03 H.J. Lu <hongjiu.lu@intel.com>
|
2009-08-03 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
PR binutils/10363
|
PR binutils/10363
|
||||||
|
@ -5934,6 +5934,7 @@ ppc_elf_relax_section (bfd *abfd,
|
|||||||
bfd_byte *hit_addr;
|
bfd_byte *hit_addr;
|
||||||
unsigned long t0;
|
unsigned long t0;
|
||||||
struct elf_link_hash_entry *h;
|
struct elf_link_hash_entry *h;
|
||||||
|
struct plt_entry **plist;
|
||||||
unsigned char sym_type;
|
unsigned char sym_type;
|
||||||
|
|
||||||
switch (r_type)
|
switch (r_type)
|
||||||
@ -5997,12 +5998,8 @@ ppc_elf_relax_section (bfd *abfd,
|
|||||||
|| h->root.type == bfd_link_hash_warning)
|
|| h->root.type == bfd_link_hash_warning)
|
||||||
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||||
|
|
||||||
tsec = NULL;
|
if (h->root.type == bfd_link_hash_defined
|
||||||
toff = 0;
|
|| h->root.type == bfd_link_hash_defweak)
|
||||||
if (tsec != NULL)
|
|
||||||
;
|
|
||||||
else if (h->root.type == bfd_link_hash_defined
|
|
||||||
|| h->root.type == bfd_link_hash_defweak)
|
|
||||||
{
|
{
|
||||||
tsec = h->root.u.def.section;
|
tsec = h->root.u.def.section;
|
||||||
toff = h->root.u.def.value;
|
toff = h->root.u.def.value;
|
||||||
@ -6019,42 +6016,48 @@ ppc_elf_relax_section (bfd *abfd,
|
|||||||
sym_type = h->type;
|
sym_type = h->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_branch_reloc (r_type))
|
/* The condition here under which we call find_plt_ent must
|
||||||
|
match that in relocate_section. If we call find_plt_ent here
|
||||||
|
but not in relocate_section, or vice versa, then the branch
|
||||||
|
destination used here may be incorrect. */
|
||||||
|
plist = NULL;
|
||||||
|
if (h != NULL)
|
||||||
{
|
{
|
||||||
struct plt_entry **plist = NULL;
|
/* We know is_branch_reloc (r_type) is true. */
|
||||||
|
if (h->type == STT_GNU_IFUNC
|
||||||
if (h != NULL)
|
|| r_type == R_PPC_PLTREL24)
|
||||||
plist = &h->plt.plist;
|
plist = &h->plt.plist;
|
||||||
else if (sym_type == STT_GNU_IFUNC)
|
}
|
||||||
{
|
else if (sym_type == STT_GNU_IFUNC
|
||||||
bfd_vma *local_got_offsets = elf_local_got_offsets (abfd);
|
&& elf_local_got_offsets (abfd) != NULL)
|
||||||
struct plt_entry **local_plt = (struct plt_entry **)
|
{
|
||||||
(local_got_offsets + symtab_hdr->sh_info);
|
bfd_vma *local_got_offsets = elf_local_got_offsets (abfd);
|
||||||
plist = local_plt + ELF32_R_SYM (irel->r_info);
|
struct plt_entry **local_plt = (struct plt_entry **)
|
||||||
}
|
(local_got_offsets + symtab_hdr->sh_info);
|
||||||
if (plist != NULL)
|
plist = local_plt + ELF32_R_SYM (irel->r_info);
|
||||||
{
|
}
|
||||||
bfd_vma addend = 0;
|
if (plist != NULL)
|
||||||
struct plt_entry *ent;
|
{
|
||||||
|
bfd_vma addend = 0;
|
||||||
|
struct plt_entry *ent;
|
||||||
|
|
||||||
if (r_type == R_PPC_PLTREL24 && link_info->shared)
|
if (r_type == R_PPC_PLTREL24 && link_info->shared)
|
||||||
addend = irel->r_addend;
|
addend = irel->r_addend;
|
||||||
ent = find_plt_ent (plist, got2, addend);
|
ent = find_plt_ent (plist, got2, addend);
|
||||||
if (ent != NULL)
|
if (ent != NULL)
|
||||||
|
{
|
||||||
|
if (htab->plt_type == PLT_NEW
|
||||||
|
|| h == NULL
|
||||||
|
|| !htab->elf.dynamic_sections_created
|
||||||
|
|| h->dynindx == -1)
|
||||||
{
|
{
|
||||||
if (htab->plt_type == PLT_NEW
|
tsec = htab->glink;
|
||||||
|| h == NULL
|
toff = ent->glink_offset;
|
||||||
|| !htab->elf.dynamic_sections_created
|
}
|
||||||
|| h->dynindx == -1)
|
else
|
||||||
{
|
{
|
||||||
tsec = htab->glink;
|
tsec = htab->plt;
|
||||||
toff = ent->glink_offset;
|
toff = ent->plt.offset;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tsec = htab->plt;
|
|
||||||
toff = ent->plt.offset;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user