diff options
author | Alan Modra <amodra@gmail.com> | 2020-03-02 10:16:39 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-03-02 11:36:19 +1030 |
commit | bf57746745ac0c0d2922de5af5f0d8527d7a585a (patch) | |
tree | 7445cbcebf6e475e42b8343ce056543fa7f67473 /bfd/elf32-v850.c | |
parent | 8c803a2dd7d3d742a3d0071914f557ef465afe71 (diff) | |
download | gdb-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-v850.c')
-rw-r--r-- | bfd/elf32-v850.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index afebb2a..bf37a93 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -3151,6 +3151,8 @@ v850_elf_section_from_shdr (bfd *abfd, const char *name, int shindex) { + flagword flags; + /* There ought to be a place to keep ELF backend specific flags, but at the moment there isn't one. We just keep track of the sections by their name, instead. */ @@ -3158,18 +3160,21 @@ v850_elf_section_from_shdr (bfd *abfd, if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex)) return FALSE; + flags = 0; switch (hdr->sh_type) { case SHT_V850_SCOMMON: case SHT_V850_TCOMMON: case SHT_V850_ZCOMMON: - if (!bfd_set_section_flags (hdr->bfd_section, - (bfd_section_flags (hdr->bfd_section) - | SEC_IS_COMMON))) - return FALSE; + flags = SEC_IS_COMMON; } - return TRUE; + if ((hdr->sh_flags & SHF_V850_GPREL) != 0) + flags |= SEC_SMALL_DATA; + + return (flags == 0 + || bfd_set_section_flags (hdr->bfd_section, + hdr->bfd_section->flags | flags)); } /* Set the correct type for a V850 ELF section. We do this |