+2020-08-15 Alan Modra <amodra@gmail.com>
+
+ * elf32-frv.c (elf32_frv_add_symbol_hook): Set SEC_SMALL_DATA on
+ small common section.
+ * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
+ * elf32-microblaze.c (microblaze_elf_add_symbol_hook): Likewise.
+ * elf32-nds32.c (nds32_elf_add_symbol_hook): Likewise.
+ * elf32-nios2.c (nios2_elf_add_symbol_hook): Likewise.
+ * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
+ * elf32-score.c (s3_bfd_score_elf_add_symbol_hook): Likewise.
+ * elf32-score7.c (s7_bfd_score_elf_add_symbol_hook): Likewise.
+ * elf32-tic6x.c (elf32_tic6x_add_symbol_hook): Likewise.
+ * elf32-v850.c (v850_elf_check_relocs): Likewise.
+ (v850_elf_add_symbol_hook): Likewise.
+ * elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
+ * elf64-ia64-vms.c (elf64_ia64_add_symbol_hook): Likewise.
+ * elfnn-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
+ * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
+
2020-08-15 Alan Modra <amodra@gmail.com>
PR 26389
scomm = bfd_make_section_with_flags (abfd, ".scommon",
(SEC_ALLOC
| SEC_IS_COMMON
+ | SEC_SMALL_DATA
| SEC_LINKER_CREATED));
if (scomm == NULL)
return FALSE;
{
case SHN_M32R_SCOMMON:
*secp = bfd_make_section_old_way (abfd, ".scommon");
- (*secp)->flags |= SEC_IS_COMMON;
+ (*secp)->flags |= SEC_IS_COMMON | SEC_SMALL_DATA;
*valp = sym->st_size;
break;
}
put into .sbss. */
*secp = bfd_make_section_old_way (abfd, ".sbss");
if (*secp == NULL
- || !bfd_set_section_flags (*secp, SEC_IS_COMMON))
+ || !bfd_set_section_flags (*secp, SEC_IS_COMMON | SEC_SMALL_DATA))
return FALSE;
*valp = sym->st_size;
|| ELF_ST_TYPE (sym->st_info) == STT_TLS)
break;
- /* st_value is the alignemnt constraint.
+ /* st_value is the alignment constraint.
That might be its actual size if it is an array or structure. */
switch (sym->st_value)
{
return TRUE;
}
- (*secp)->flags |= SEC_IS_COMMON;
+ (*secp)->flags |= SEC_IS_COMMON | SEC_SMALL_DATA;
*valp = sym->st_size;
break;
}
htab = elf32_nios2_hash_table (info);
if (htab->sbss == NULL)
{
- flagword flags = SEC_IS_COMMON | SEC_LINKER_CREATED;
+ flagword flags = SEC_IS_COMMON | SEC_SMALL_DATA | SEC_LINKER_CREATED;
if (htab->root.dynobj == NULL)
htab->root.dynobj = abfd;
htab = ppc_elf_hash_table (info);
if (htab->sbss == NULL)
{
- flagword flags = SEC_IS_COMMON | SEC_LINKER_CREATED;
+ flagword flags = SEC_IS_COMMON | SEC_SMALL_DATA | SEC_LINKER_CREATED;
if (!htab->elf.dynobj)
htab->elf.dynobj = abfd;
/* Fall through. */
case SHN_SCORE_SCOMMON:
*secp = bfd_make_section_old_way (abfd, ".scommon");
- (*secp)->flags |= SEC_IS_COMMON;
+ (*secp)->flags |= SEC_IS_COMMON | SEC_SMALL_DATA;
*valp = sym->st_size;
break;
}
/* Fall through. */
case SHN_SCORE_SCOMMON:
*secp = bfd_make_section_old_way (abfd, ".scommon");
- (*secp)->flags |= SEC_IS_COMMON;
+ (*secp)->flags |= SEC_IS_COMMON | SEC_SMALL_DATA;
*valp = sym->st_size;
break;
}
{
case SHN_TIC6X_SCOMMON:
*secp = bfd_make_section_old_way (abfd, ".scommon");
- (*secp)->flags |= SEC_IS_COMMON;
+ (*secp)->flags |= SEC_IS_COMMON | SEC_SMALL_DATA;
*valp = sym->st_size;
bfd_set_section_alignment (*secp, bfd_log2 (sym->st_value));
break;
asection * section;
section = h->root.u.c.p->section = bfd_make_section_old_way (abfd, common);
- section->flags |= SEC_IS_COMMON;
+ section->flags |= SEC_IS_COMMON | SEC_SMALL_DATA;
}
#ifdef DEBUG
{
case SHN_V850_SCOMMON:
*secp = bfd_make_section_old_way (abfd, ".scommon");
- (*secp)->flags |= SEC_IS_COMMON;
+ (*secp)->flags |= SEC_IS_COMMON | SEC_SMALL_DATA;
*valp = sym->st_size;
break;
case SHN_V850_TCOMMON:
*secp = bfd_make_section_old_way (abfd, ".tcommon");
- (*secp)->flags |= SEC_IS_COMMON;
+ (*secp)->flags |= SEC_IS_COMMON | SEC_SMALL_DATA;
*valp = sym->st_size;
break;
case SHN_V850_ZCOMMON:
*secp = bfd_make_section_old_way (abfd, ".zcommon");
- (*secp)->flags |= SEC_IS_COMMON;
+ (*secp)->flags |= SEC_IS_COMMON | SEC_SMALL_DATA;
*valp = sym->st_size;
break;
}
scomm = bfd_make_section_with_flags (abfd, ".scommon",
(SEC_ALLOC
| SEC_IS_COMMON
+ | SEC_SMALL_DATA
| SEC_LINKER_CREATED));
if (scomm == NULL)
return FALSE;
scomm = bfd_make_section_with_flags (abfd, ".scommon",
(SEC_ALLOC
| SEC_IS_COMMON
+ | SEC_SMALL_DATA
| SEC_LINKER_CREATED));
if (scomm == NULL)
return FALSE;
scomm = bfd_make_section_with_flags (abfd, ".scommon",
(SEC_ALLOC
| SEC_IS_COMMON
+ | SEC_SMALL_DATA
| SEC_LINKER_CREATED));
if (scomm == NULL)
return FALSE;
/* Fall through. */
case SHN_MIPS_SCOMMON:
*secp = bfd_make_section_old_way (abfd, ".scommon");
- (*secp)->flags |= SEC_IS_COMMON;
+ (*secp)->flags |= SEC_IS_COMMON | SEC_SMALL_DATA;
*valp = sym->st_size;
break;