* elf32-ppc.c (ppc_elf_check_relocs): For old gcc -fPIC code
force old plt layout.
This commit is contained in:
parent
41a865baa2
commit
9edfd1af33
2 changed files with 27 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-05-24 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* elf32-ppc.c (ppc_elf_check_relocs): For old gcc -fPIC code
|
||||||
|
force old plt layout.
|
||||||
|
|
||||||
2005-05-22 Richard Henderson <rth@redhat.com>
|
2005-05-22 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
* elf64-alpha.c (elf64_alpha_relax_section): Ignore non-allocated
|
* elf64-alpha.c (elf64_alpha_relax_section): Ignore non-allocated
|
||||||
|
|
|
@ -3160,14 +3160,32 @@ ppc_elf_check_relocs (bfd *abfd,
|
||||||
info->flags |= DF_STATIC_TLS;
|
info->flags |= DF_STATIC_TLS;
|
||||||
goto dodyn;
|
goto dodyn;
|
||||||
|
|
||||||
/* When creating a shared object, we must copy these
|
case R_PPC_REL32:
|
||||||
relocs into the output file. We create a reloc
|
if (h == NULL
|
||||||
section in dynobj and make room for the reloc. */
|
&& got2 != NULL
|
||||||
|
&& (sec->flags & SEC_CODE) != 0
|
||||||
|
&& (info->shared || info->pie)
|
||||||
|
&& !htab->old_plt)
|
||||||
|
{
|
||||||
|
/* Old -fPIC gcc code has .long LCTOC1-LCFx just before
|
||||||
|
the start of a function, which assembles to a REL32
|
||||||
|
reference to .got2. If we detect one of these, then
|
||||||
|
force the old PLT layout because the linker cannot
|
||||||
|
reliably deduce the GOT pointer value needed for
|
||||||
|
PLT call stubs. */
|
||||||
|
asection *s;
|
||||||
|
|
||||||
|
s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec,
|
||||||
|
r_symndx);
|
||||||
|
if (s == got2)
|
||||||
|
htab->old_plt = 1;
|
||||||
|
}
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
case R_PPC_REL24:
|
case R_PPC_REL24:
|
||||||
case R_PPC_REL14:
|
case R_PPC_REL14:
|
||||||
case R_PPC_REL14_BRTAKEN:
|
case R_PPC_REL14_BRTAKEN:
|
||||||
case R_PPC_REL14_BRNTAKEN:
|
case R_PPC_REL14_BRNTAKEN:
|
||||||
case R_PPC_REL32:
|
|
||||||
if (h == NULL)
|
if (h == NULL)
|
||||||
break;
|
break;
|
||||||
if (h == htab->elf.hgot)
|
if (h == htab->elf.hgot)
|
||||||
|
|
Loading…
Reference in a new issue