mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 13:56:22 +08:00
PR24697, R_PPC_EMB_SDA21 cannot be used when making a shared object
This removes a restriction on various R_PPC_EMB relocations that has been present for ppc32 since 1996-04-26 git commit e25a798839. As far as I know, only those relocs that would require addressing via r2 for .sdata2/.sbss2 access are disallowed in shared libraries. PR 24697 * elf32-ppc.c (ppc_elf_check_relocs): Call bad_shared_reloc when !bfd_link_executable for R_PPC_EMB_SDA2I16 and R_PPC_EMB_SDA2REL. Don't call bad_shared_reloc for any other reloc.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2019-08-29 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
PR 24697
|
||||||
|
* elf32-ppc.c (ppc_elf_check_relocs): Call bad_shared_reloc
|
||||||
|
when !bfd_link_executable for R_PPC_EMB_SDA2I16 and
|
||||||
|
R_PPC_EMB_SDA2REL. Don't call bad_shared_reloc for any other
|
||||||
|
reloc.
|
||||||
|
|
||||||
2019-08-29 Alan Modra <amodra@gmail.com>
|
2019-08-29 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* elf64-ppc.c (xlate_pcrel_opt): Add poff parameter. Allow offset
|
* elf64-ppc.c (xlate_pcrel_opt): Add poff parameter. Allow offset
|
||||||
|
@ -3096,11 +3096,6 @@ ppc_elf_check_relocs (bfd *abfd,
|
|||||||
|
|
||||||
/* Indirect .sdata relocation. */
|
/* Indirect .sdata relocation. */
|
||||||
case R_PPC_EMB_SDAI16:
|
case R_PPC_EMB_SDAI16:
|
||||||
if (bfd_link_pic (info))
|
|
||||||
{
|
|
||||||
bad_shared_reloc (abfd, r_type);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
htab->sdata[0].sym->ref_regular = 1;
|
htab->sdata[0].sym->ref_regular = 1;
|
||||||
if (!elf_allocate_pointer_linker_section (abfd, &htab->sdata[0],
|
if (!elf_allocate_pointer_linker_section (abfd, &htab->sdata[0],
|
||||||
h, rel))
|
h, rel))
|
||||||
@ -3114,7 +3109,7 @@ ppc_elf_check_relocs (bfd *abfd,
|
|||||||
|
|
||||||
/* Indirect .sdata2 relocation. */
|
/* Indirect .sdata2 relocation. */
|
||||||
case R_PPC_EMB_SDA2I16:
|
case R_PPC_EMB_SDA2I16:
|
||||||
if (bfd_link_pic (info))
|
if (!bfd_link_executable (info))
|
||||||
{
|
{
|
||||||
bad_shared_reloc (abfd, r_type);
|
bad_shared_reloc (abfd, r_type);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -3160,7 +3155,7 @@ ppc_elf_check_relocs (bfd *abfd,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case R_PPC_EMB_SDA2REL:
|
case R_PPC_EMB_SDA2REL:
|
||||||
if (bfd_link_pic (info))
|
if (!bfd_link_executable (info))
|
||||||
{
|
{
|
||||||
bad_shared_reloc (abfd, r_type);
|
bad_shared_reloc (abfd, r_type);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -3177,11 +3172,6 @@ ppc_elf_check_relocs (bfd *abfd,
|
|||||||
case R_PPC_VLE_SDA21:
|
case R_PPC_VLE_SDA21:
|
||||||
case R_PPC_EMB_SDA21:
|
case R_PPC_EMB_SDA21:
|
||||||
case R_PPC_EMB_RELSDA:
|
case R_PPC_EMB_RELSDA:
|
||||||
if (bfd_link_pic (info))
|
|
||||||
{
|
|
||||||
bad_shared_reloc (abfd, r_type);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (h != NULL)
|
if (h != NULL)
|
||||||
{
|
{
|
||||||
ppc_elf_hash_entry (h)->has_sda_refs = TRUE;
|
ppc_elf_hash_entry (h)->has_sda_refs = TRUE;
|
||||||
@ -3194,11 +3184,6 @@ ppc_elf_check_relocs (bfd *abfd,
|
|||||||
case R_PPC_EMB_NADDR16_LO:
|
case R_PPC_EMB_NADDR16_LO:
|
||||||
case R_PPC_EMB_NADDR16_HI:
|
case R_PPC_EMB_NADDR16_HI:
|
||||||
case R_PPC_EMB_NADDR16_HA:
|
case R_PPC_EMB_NADDR16_HA:
|
||||||
if (bfd_link_pic (info))
|
|
||||||
{
|
|
||||||
bad_shared_reloc (abfd, r_type);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (h != NULL)
|
if (h != NULL)
|
||||||
h->non_got_ref = TRUE;
|
h->non_got_ref = TRUE;
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user