mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 11:39:26 +08:00
PR ld/11375
* elf64-ppc.c (ppc64_elf_relocate_section): Always look up a possible stub on branches.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2010-03-26 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
PR ld/11375
|
||||||
|
* elf64-ppc.c (ppc64_elf_relocate_section): Always look up a
|
||||||
|
possible stub on branches.
|
||||||
|
|
||||||
2010-03-25 Joseph Myers <joseph@codesourcery.com>
|
2010-03-25 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
* Makefile.am (ALL_MACHINES): Add cpu-tic6x.lo.
|
* Makefile.am (ALL_MACHINES): Add cpu-tic6x.lo.
|
||||||
|
@ -11914,23 +11914,13 @@ ppc64_elf_relocate_section (bfd *output_bfd,
|
|||||||
linkage stubs needs to be followed by a nop, as the nop
|
linkage stubs needs to be followed by a nop, as the nop
|
||||||
will be replaced with an instruction to restore the TOC
|
will be replaced with an instruction to restore the TOC
|
||||||
base pointer. */
|
base pointer. */
|
||||||
stub_entry = NULL;
|
|
||||||
fdh = h;
|
fdh = h;
|
||||||
if (h != NULL
|
if (h != NULL
|
||||||
&& h->oh != NULL
|
&& h->oh != NULL
|
||||||
&& h->oh->is_func_descriptor)
|
&& h->oh->is_func_descriptor)
|
||||||
fdh = ppc_follow_link (h->oh);
|
fdh = ppc_follow_link (h->oh);
|
||||||
if (((fdh != NULL
|
stub_entry = ppc_get_stub_entry (input_section, sec, fdh, rel, htab);
|
||||||
&& fdh->elf.plt.plist != NULL)
|
if (stub_entry != NULL
|
||||||
|| (sec != NULL
|
|
||||||
&& sec->output_section != NULL
|
|
||||||
&& sec->id <= htab->top_id
|
|
||||||
&& (htab->stub_group[sec->id].toc_off
|
|
||||||
!= htab->stub_group[input_section->id].toc_off))
|
|
||||||
|| (h == NULL
|
|
||||||
&& ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC))
|
|
||||||
&& (stub_entry = ppc_get_stub_entry (input_section, sec, fdh,
|
|
||||||
rel, htab)) != NULL
|
|
||||||
&& (stub_entry->stub_type == ppc_stub_plt_call
|
&& (stub_entry->stub_type == ppc_stub_plt_call
|
||||||
|| stub_entry->stub_type == ppc_stub_plt_branch_r2off
|
|| stub_entry->stub_type == ppc_stub_plt_branch_r2off
|
||||||
|| stub_entry->stub_type == ppc_stub_long_branch_r2off))
|
|| stub_entry->stub_type == ppc_stub_long_branch_r2off))
|
||||||
@ -12015,7 +12005,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
|
|||||||
unresolved_reloc = FALSE;
|
unresolved_reloc = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stub_entry == NULL
|
if ((stub_entry == NULL
|
||||||
|
|| stub_entry->stub_type == ppc_stub_long_branch
|
||||||
|
|| stub_entry->stub_type == ppc_stub_plt_branch)
|
||||||
&& get_opd_info (sec) != NULL)
|
&& get_opd_info (sec) != NULL)
|
||||||
{
|
{
|
||||||
/* The branch destination is the value of the opd entry. */
|
/* The branch destination is the value of the opd entry. */
|
||||||
@ -12036,13 +12028,15 @@ ppc64_elf_relocate_section (bfd *output_bfd,
|
|||||||
+ input_section->output_offset
|
+ input_section->output_offset
|
||||||
+ input_section->output_section->vma);
|
+ input_section->output_section->vma);
|
||||||
|
|
||||||
if (stub_entry == NULL
|
if (stub_entry != NULL
|
||||||
&& (relocation + addend - from + max_br_offset
|
&& (stub_entry->stub_type == ppc_stub_long_branch
|
||||||
>= 2 * max_br_offset)
|
|| stub_entry->stub_type == ppc_stub_plt_branch)
|
||||||
&& r_type != R_PPC64_ADDR14_BRTAKEN
|
&& (r_type == R_PPC64_ADDR14_BRTAKEN
|
||||||
&& r_type != R_PPC64_ADDR14_BRNTAKEN)
|
|| r_type == R_PPC64_ADDR14_BRNTAKEN
|
||||||
stub_entry = ppc_get_stub_entry (input_section, sec, fdh, rel,
|
|| (relocation + addend - from + max_br_offset
|
||||||
htab);
|
< 2 * max_br_offset)))
|
||||||
|
/* Don't use the stub if this branch is in range. */
|
||||||
|
stub_entry = NULL;
|
||||||
|
|
||||||
if (stub_entry != NULL)
|
if (stub_entry != NULL)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user