]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ia64: Set DF_TEXTREL instead of reltext
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 11 Jun 2020 01:15:13 +0000 (18:15 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 11 Jun 2020 01:20:36 +0000 (18:20 -0700)
Update ia64 ELF backend to set DF_TEXTREL for dynamic relocs against
readonly sections like other backends.

* elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
(allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
(elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
of reltext.

bfd/ChangeLog
bfd/elfnn-ia64.c

index 928d4bddaf45e5e67b29cdd25d2733f53bb85594..688ffad01f6f86513c9b00ebe044176358fca200 100644 (file)
@@ -1,3 +1,10 @@
+2020-06-10  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elfnn-ia64.c (elfNN_ia64_link_hash_table): Remove reltext.
+       (allocate_dynrel_entries): Set DF_TEXTREL instead of reltext.
+       (elfNN_ia64_size_dynamic_sections): Check DF_TEXTREL instead
+       of reltext.
+
 2020-06-10  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/26094
index d179bc45686b708d4a6420ac8a0ad8455a2c01ad..ba46270f8669e1bfcbaff0cedd1e3ac60a4b9843 100644 (file)
@@ -143,7 +143,6 @@ struct elfNN_ia64_link_hash_table
   asection *rel_pltoff_sec;    /* Dynamic relocation section for same.  */
 
   bfd_size_type minplt_entries;        /* Number of minplt entries.  */
-  unsigned reltext : 1;                /* Are there relocs against readonly sections?  */
   unsigned self_dtpmod_done : 1;/* Has self DTPMOD entry been finished?  */
   bfd_vma self_dtpmod_offset;  /* .got offset to self DTPMOD entry.  */
   /* There are maybe R_IA64_GPREL22 relocations, including those
@@ -2951,7 +2950,7 @@ allocate_dynrel_entries (struct elfNN_ia64_dyn_sym_info *dyn_i,
          abort ();
        }
       if (rent->reltext)
-       ia64_info->reltext = 1;
+       x->info->flags |= DF_TEXTREL;
       rent->srel->size += sizeof (ElfNN_External_Rela) * count;
     }
 
@@ -3224,11 +3223,10 @@ elfNN_ia64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
          || !add_dynamic_entry (DT_RELAENT, sizeof (ElfNN_External_Rela)))
        return FALSE;
 
-      if (ia64_info->reltext)
+      if ((info->flags & DF_TEXTREL) != 0)
        {
          if (!add_dynamic_entry (DT_TEXTREL, 0))
            return FALSE;
-         info->flags |= DF_TEXTREL;
        }
     }