mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-28 15:18:37 +08:00
alpha: Warn DT_TEXTREL with -M
This fixes: FAIL: DT_TEXTREL map file warning * elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with sec. (elf64_alpha_check_relocs): Set sec instead of reltext. Warn DT_TEXTREL with -M. (elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2020-04-21 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* elf64-alpha.c (alpha_elf_reloc_entry): Replace reltext with
|
||||||
|
sec.
|
||||||
|
(elf64_alpha_check_relocs): Set sec instead of reltext. Warn
|
||||||
|
DT_TEXTREL with -M.
|
||||||
|
(elf64_alpha_calc_dynrel_sizes): Warn DT_TEXTREL with -M.
|
||||||
|
|
||||||
2020-04-21 Nick Clifton <nickc@redhat.com>
|
2020-04-21 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* po/sr.po: Updated Serbian translation.
|
* po/sr.po: Updated Serbian translation.
|
||||||
|
@ -144,14 +144,14 @@ struct alpha_elf_reloc_entry
|
|||||||
/* Which .reloc section? */
|
/* Which .reloc section? */
|
||||||
asection *srel;
|
asection *srel;
|
||||||
|
|
||||||
/* What kind of relocation? */
|
/* Which section this relocation is against? */
|
||||||
unsigned int rtype;
|
asection *sec;
|
||||||
|
|
||||||
/* Is this against read-only section? */
|
|
||||||
unsigned int reltext : 1;
|
|
||||||
|
|
||||||
/* How many did we find? */
|
/* How many did we find? */
|
||||||
unsigned long count;
|
unsigned long count;
|
||||||
|
|
||||||
|
/* What kind of relocation? */
|
||||||
|
unsigned int rtype;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct alpha_elf_link_hash_entry
|
struct alpha_elf_link_hash_entry
|
||||||
@ -1998,9 +1998,9 @@ elf64_alpha_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
rent->srel = sreloc;
|
rent->srel = sreloc;
|
||||||
|
rent->sec = sec;
|
||||||
rent->rtype = r_type;
|
rent->rtype = r_type;
|
||||||
rent->count = 1;
|
rent->count = 1;
|
||||||
rent->reltext = (sec->flags & SEC_READONLY) != 0;
|
|
||||||
|
|
||||||
rent->next = h->reloc_entries;
|
rent->next = h->reloc_entries;
|
||||||
h->reloc_entries = rent;
|
h->reloc_entries = rent;
|
||||||
@ -2014,7 +2014,13 @@ elf64_alpha_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
|||||||
loaded into memory, we need a RELATIVE reloc. */
|
loaded into memory, we need a RELATIVE reloc. */
|
||||||
sreloc->size += sizeof (Elf64_External_Rela);
|
sreloc->size += sizeof (Elf64_External_Rela);
|
||||||
if (sec->flags & SEC_READONLY)
|
if (sec->flags & SEC_READONLY)
|
||||||
|
{
|
||||||
info->flags |= DF_TEXTREL;
|
info->flags |= DF_TEXTREL;
|
||||||
|
info->callbacks->minfo
|
||||||
|
(_("%pB: dynamic relocation against `%pT' in "
|
||||||
|
"read-only section `%pA'\n"),
|
||||||
|
sec->owner, h->root.root.root.string, sec);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2699,10 +2705,17 @@ elf64_alpha_calc_dynrel_sizes (struct alpha_elf_link_hash_entry *h,
|
|||||||
bfd_link_pie (info));
|
bfd_link_pie (info));
|
||||||
if (entries)
|
if (entries)
|
||||||
{
|
{
|
||||||
|
asection *sec = relent->sec;
|
||||||
relent->srel->size +=
|
relent->srel->size +=
|
||||||
entries * sizeof (Elf64_External_Rela) * relent->count;
|
entries * sizeof (Elf64_External_Rela) * relent->count;
|
||||||
if (relent->reltext)
|
if ((sec->flags & SEC_READONLY) != 0)
|
||||||
|
{
|
||||||
info->flags |= DT_TEXTREL;
|
info->flags |= DT_TEXTREL;
|
||||||
|
info->callbacks->minfo
|
||||||
|
(_("%pB: dynamic relocation against `%pT' in "
|
||||||
|
"read-only section `%pA'\n"),
|
||||||
|
sec->owner, h->root.root.root.string, sec);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user