From: H.J. Lu Date: Thu, 11 Jun 2020 01:15:13 +0000 (-0700) Subject: ia64: Set DF_TEXTREL instead of reltext X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=447f6d86275aa5790109c2dfd85f3a11919fff8f;p=binutils-gdb.git ia64: Set DF_TEXTREL instead of reltext 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 928d4bddaf4..688ffad01f6 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2020-06-10 H.J. Lu + + * 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 PR ld/26094 diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c index d179bc45686..ba46270f866 100644 --- a/bfd/elfnn-ia64.c +++ b/bfd/elfnn-ia64.c @@ -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; } }