+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>
* elf64-ppc.c (xlate_pcrel_opt): Add poff parameter. Allow offset
/* Indirect .sdata relocation. */
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;
if (!elf_allocate_pointer_linker_section (abfd, &htab->sdata[0],
h, rel))
/* Indirect .sdata2 relocation. */
case R_PPC_EMB_SDA2I16:
- if (bfd_link_pic (info))
+ if (!bfd_link_executable (info))
{
bad_shared_reloc (abfd, r_type);
return FALSE;
break;
case R_PPC_EMB_SDA2REL:
- if (bfd_link_pic (info))
+ if (!bfd_link_executable (info))
{
bad_shared_reloc (abfd, r_type);
return FALSE;
case R_PPC_VLE_SDA21:
case R_PPC_EMB_SDA21:
case R_PPC_EMB_RELSDA:
- if (bfd_link_pic (info))
- {
- bad_shared_reloc (abfd, r_type);
- return FALSE;
- }
if (h != NULL)
{
ppc_elf_hash_entry (h)->has_sda_refs = TRUE;
case R_PPC_EMB_NADDR16_LO:
case R_PPC_EMB_NADDR16_HI:
case R_PPC_EMB_NADDR16_HA:
- if (bfd_link_pic (info))
- {
- bad_shared_reloc (abfd, r_type);
- return FALSE;
- }
if (h != NULL)
h->non_got_ref = TRUE;
break;