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.
This commit is contained in:
H.J. Lu 2020-06-10 18:15:13 -07:00
parent 6cff1eab4d
commit 447f6d8627
2 changed files with 9 additions and 4 deletions

View 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

View 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;
}
}