aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-nds32.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-03-02 10:16:39 +1030
committerAlan Modra <amodra@gmail.com>2020-03-02 11:36:19 +1030
commitbf57746745ac0c0d2922de5af5f0d8527d7a585a (patch)
tree7445cbcebf6e475e42b8343ce056543fa7f67473 /bfd/elf32-nds32.c
parent8c803a2dd7d3d742a3d0071914f557ef465afe71 (diff)
downloadgdb-bf57746745ac0c0d2922de5af5f0d8527d7a585a.zip
gdb-bf57746745ac0c0d2922de5af5f0d8527d7a585a.tar.gz
gdb-bf57746745ac0c0d2922de5af5f0d8527d7a585a.tar.bz2
ELF SEC_SMALL_DATA
For those ELF targets that have .sdata or .sbss sections, or similar sections, arrange to mark the sections with the SEC_SMALL_DATA flag. This fixes regressions in nm symbol type caused by removing .sdata and .sbss from coff_section_type with commit 49d9fd42ac. * elf32-m32r.c (m32r_elf_section_flags): New function. (elf_backend_section_flags): Define. * elf32-nds32.c (nds32_elf_section_flags): New function. (elf_backend_section_flags): Define. * elf32-ppc.c (ppc_elf_section_from_shdr): Set SEC_SMALL_DATA for .sbss and .sdata sections. * elf32-v850.c (v850_elf_section_from_shdr): Set SEC_SMALL_DATA for SHF_V850_GPREL sections. * elf64-alpha.c (elf64_alpha_section_from_shdr): Delete outdated FIXME. * elf64-hppa.c (elf64_hppa_section_from_shdr): Set SEC_SMALL_DATA for SHF_PARISC_SHORT sections. * elf64-ppc.c (ppc64_elf_section_flags): New function. (elf_backend_section_flags): Define. * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Set SEC_SMALL_DATA for SHF_MIPS_GPREL sections. Delete FIXME.
Diffstat (limited to 'bfd/elf32-nds32.c')
-rw-r--r--bfd/elf32-nds32.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c
index 6d3c1c3..fc4d002 100644
--- a/bfd/elf32-nds32.c
+++ b/bfd/elf32-nds32.c
@@ -12594,6 +12594,18 @@ static struct bfd_elf_special_section const nds32_elf_special_sections[] =
};
static bfd_boolean
+nds32_elf_section_flags (const Elf_Internal_Shdr *hdr)
+{
+ const char *name = hdr->bfd_section->name;
+
+ if (strncmp (name, ".sbss", 5) == 0
+ || strncmp (name, ".sdata", 6) == 0)
+ hdr->bfd_section->flags |= SEC_SMALL_DATA;
+
+ return TRUE;
+}
+
+static bfd_boolean
nds32_elf_output_arch_syms (bfd *output_bfd ATTRIBUTE_UNUSED,
struct bfd_link_info *info,
void *finfo ATTRIBUTE_UNUSED,
@@ -14093,6 +14105,7 @@ nds32_elf_unify_tls_model (bfd *inbfd, asection *insec, bfd_byte *incontents,
#define elf_backend_object_p nds32_elf_object_p
#define elf_backend_final_write_processing nds32_elf_final_write_processing
#define elf_backend_special_sections nds32_elf_special_sections
+#define elf_backend_section_flags nds32_elf_section_flags
#define bfd_elf32_bfd_get_relocated_section_contents \
nds32_elf_get_relocated_section_contents
#define bfd_elf32_bfd_is_target_special_symbol nds32_elf_is_target_special_symbol