Disable warning message about a program header with no associated sections when that...
[deliverable/binutils-gdb.git] / bfd / elf64-ppc.c
index ad5438462fd15030cd157301c93ddc8387b0d5eb..5ecd1a3ca12af9adca66590794fa23355b95b085 100644 (file)
@@ -2045,6 +2045,21 @@ static reloc_howto_type ppc64_elf_howto_raw[] = {
         0x1fffc1,              /* dst_mask */
         TRUE),                 /* pcrel_offset */
 
+  /* A split-field reloc for addpcis, non-relative (gas internal use only).  */
+  HOWTO (R_PPC64_16DX_HA,      /* type */
+        16,                    /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        16,                    /* bitsize */
+        FALSE,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_signed, /* complain_on_overflow */
+        ppc64_elf_ha_reloc,    /* special_function */
+        "R_PPC64_16DX_HA",     /* name */
+        FALSE,                 /* partial_inplace */
+        0,                     /* src_mask */
+        0x1fffc1,              /* dst_mask */
+        FALSE),                /* pcrel_offset */
+
   /* Like R_PPC64_ADDR16_HI, but no overflow.  */
   HOWTO (R_PPC64_ADDR16_HIGH,  /* type */
         16,                    /* rightshift */
@@ -2450,6 +2465,8 @@ ppc64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
       break;
     case BFD_RELOC_HI16_S_PCREL:               r = R_PPC64_REL16_HA;
       break;
+    case BFD_RELOC_PPC_16DX_HA:                        r = R_PPC64_16DX_HA;
+      break;
     case BFD_RELOC_PPC_REL16DX_HA:             r = R_PPC64_REL16DX_HA;
       break;
     case BFD_RELOC_PPC64_ENTRY:                        r = R_PPC64_ENTRY;
@@ -5554,7 +5571,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
                 table entry for a non-ifunc local symbol.  */
              info->callbacks->einfo
                /* xgettext:c-format */
-               (_("%P: %H: %s reloc against local symbol\n"),
+               (_("%H: %s reloc against local symbol\n"),
                 abfd, sec, rel->r_offset,
                 ppc64_elf_howto_table[r_type]->name);
              bfd_set_error (bfd_error_bad_value);
@@ -5602,7 +5619,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
              if (!ppc64_elf_howto_table[R_PPC64_ADDR32])
                ppc_howto_init ();
              /* xgettext:c-format */
-             info->callbacks->einfo (_("%P: %H: %s reloc unsupported "
+             info->callbacks->einfo (_("%H: %s reloc unsupported "
                                        "in shared libraries and PIEs.\n"),
                                      abfd, sec, rel->r_offset,
                                      ppc64_elf_howto_table[r_type]->name);
@@ -9234,7 +9251,7 @@ ppc64_elf_edit_toc (struct bfd_link_info *info)
                          sprintf (str, "%#08x", insn);
                          info->callbacks->einfo
                            /* xgettext:c-format */
-                           (_("%P: %H: toc optimization is not supported for"
+                           (_("%H: toc optimization is not supported for"
                               " %s instruction.\n"),
                             ibfd, sec, rel->r_offset & ~3, str);
                        }
@@ -9463,7 +9480,7 @@ ppc64_elf_edit_toc (struct bfd_link_info *info)
                            ppc_howto_init ();
                          info->callbacks->einfo
                            /* xgettext:c-format */
-                           (_("%P: %H: %s references "
+                           (_("%H: %s references "
                               "optimized away TOC entry\n"),
                             ibfd, sec, rel->r_offset,
                             ppc64_elf_howto_table[r_type]->name);
@@ -13572,9 +13589,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
            info->callbacks->einfo
              (!IS_PPC64_TLS_RELOC (r_type)
               /* xgettext:c-format */
-              ? _("%P: %H: %s used with TLS symbol `%T'\n")
+              ? _("%H: %s used with TLS symbol `%T'\n")
               /* xgettext:c-format */
-              : _("%P: %H: %s used with non-TLS symbol `%T'\n"),
+              : _("%H: %s used with non-TLS symbol `%T'\n"),
               input_bfd, input_section, rel->r_offset,
               ppc64_elf_howto_table[r_type]->name,
               sym_name);
@@ -14204,13 +14221,13 @@ ppc64_elf_relocate_section (bfd *output_bfd,
                      || stub_entry->stub_type == ppc_stub_plt_call_r2save)
                    info->callbacks->einfo
                      /* xgettext:c-format */
-                     (_("%P: %H: call to `%T' lacks nop, can't restore toc; "
+                     (_("%H: call to `%T' lacks nop, can't restore toc; "
                         "recompile with -fPIC\n"),
                       input_bfd, input_section, rel->r_offset, sym_name);
                  else
                    info->callbacks->einfo
                      /* xgettext:c-format */
-                     (_("%P: %H: call to `%T' lacks nop, can't restore toc; "
+                     (_("%H: call to `%T' lacks nop, can't restore toc; "
                         "(-mcmodel=small toc adjust stub)\n"),
                       input_bfd, input_section, rel->r_offset, sym_name);
 
@@ -14887,7 +14904,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
                        {
                          info->callbacks->einfo
                            /* xgettext:c-format */
-                           (_("%P: %H: %s for indirect "
+                           (_("%H: %s for indirect "
                               "function `%T' unsupported\n"),
                             input_bfd, input_section, rel->r_offset,
                             ppc64_elf_howto_table[r_type]->name,
@@ -15174,7 +15191,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
              relocation ^= relocation & mask;
              info->callbacks->einfo
                /* xgettext:c-format */
-               (_("%P: %H: error: %s not a multiple of %u\n"),
+               (_("%H: error: %s not a multiple of %u\n"),
                 input_bfd, input_section, rel->r_offset,
                 howto->name,
                 mask + 1);
@@ -15196,7 +15213,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
        {
          info->callbacks->einfo
            /* xgettext:c-format */
-           (_("%P: %H: unresolvable %s against `%T'\n"),
+           (_("%H: unresolvable %s against `%T'\n"),
             input_bfd, input_section, rel->r_offset,
             howto->name,
             h->elf.root.root.string);
@@ -15293,7 +15310,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
            {
              info->callbacks->einfo
                /* xgettext:c-format */
-               (_("%P: %H: %s against `%T': error %d\n"),
+               (_("%H: %s against `%T': error %d\n"),
                 input_bfd, input_section, rel->r_offset,
                 reloc_name, sym_name, (int) r);
              ret = FALSE;
@@ -15477,7 +15494,7 @@ ppc64_elf_finish_dynamic_symbol (bfd *output_bfd,
                       + h->root.u.def.section->output_offset);
       rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_COPY);
       rela.r_addend = 0;
-      if ((h->root.u.def.section->flags & SEC_READONLY) != 0)
+      if (h->root.u.def.section == htab->elf.sdynrelro)
        srel = htab->elf.sreldynrelro;
       else
        srel = htab->elf.srelbss;
@@ -15603,7 +15620,8 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
        }
     }
 
-  if (htab->elf.sgot != NULL && htab->elf.sgot->size != 0)
+  if (htab->elf.sgot != NULL && htab->elf.sgot->size != 0
+      && htab->elf.sgot->output_section != bfd_abs_section_ptr)
     {
       /* Fill in the first entry in the global offset table.
         We use it to hold the link-time TOCbase.  */
@@ -15615,7 +15633,8 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd,
       elf_section_data (htab->elf.sgot->output_section)->this_hdr.sh_entsize = 8;
     }
 
-  if (htab->elf.splt != NULL && htab->elf.splt->size != 0)
+  if (htab->elf.splt != NULL && htab->elf.splt->size != 0
+      && htab->elf.splt->output_section != bfd_abs_section_ptr)
     {
       /* Set .plt entry size.  */
       elf_section_data (htab->elf.splt->output_section)->this_hdr.sh_entsize
This page took 0.028363 seconds and 4 git commands to generate.