This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Fix for PR 15993
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Binutils Development <binutils at sourceware dot org>
- Date: Tue, 08 Oct 2013 04:09:09 -0300
- Subject: [PATCH] Fix for PR 15993
- Authentication-results: sourceware.org; auth=none
Hi,
This PR was initially filed for GDB, but it is a BFD bug. It is simple
enough to be considere obvious, but I decided to send the patch anyway.
In the dump_symtab function of elf32-m32c.c, every "case" is missing a
"break;". I've added them, and also reindented the code to make it
conformant with the GNU Coding Standards.
Built with --enable-targets=all on Fedora 17. I don't have a M32C to
test, unfortunately.
OK to apply?
--
Sergio
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ad29108..eed92b4 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2013-10-08 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ PR binutils/15993
+ * elf32-m32c.c (dump_symtab): Add missing "break;" statement on each
+ "case". Reindent "switch" statements.
+
2013-10-04 Jan-Benedict Glaw <jbglaw@lug-owl.de>
* configure: Regenerate.
diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c
index 5205b7b..8e77c5e 100644
--- a/bfd/elf32-m32c.c
+++ b/bfd/elf32-m32c.c
@@ -921,32 +921,78 @@ dump_symtab (bfd * abfd, void *internal_syms, void *external_syms)
{
switch (ELF_ST_TYPE (isym->st_info))
{
- case STT_FUNC: st_info_str = "STT_FUNC";
- case STT_SECTION: st_info_str = "STT_SECTION";
- case STT_FILE: st_info_str = "STT_FILE";
- case STT_OBJECT: st_info_str = "STT_OBJECT";
- case STT_TLS: st_info_str = "STT_TLS";
- default: st_info_str = "";
+ case STT_FUNC:
+ st_info_str = "STT_FUNC";
+ break;
+
+ case STT_SECTION:
+ st_info_str = "STT_SECTION";
+ break;
+
+ case STT_FILE:
+ st_info_str = "STT_FILE";
+ break;
+
+ case STT_OBJECT:
+ st_info_str = "STT_OBJECT";
+ break;
+
+ case STT_TLS:
+ st_info_str = "STT_TLS";
+ break;
+
+ default:
+ st_info_str = "";
}
+
switch (ELF_ST_BIND (isym->st_info))
{
- case STB_LOCAL: st_info_stb_str = "STB_LOCAL";
- case STB_GLOBAL: st_info_stb_str = "STB_GLOBAL";
- default: st_info_stb_str = "";
+ case STB_LOCAL:
+ st_info_stb_str = "STB_LOCAL";
+ break;
+
+ case STB_GLOBAL:
+ st_info_stb_str = "STB_GLOBAL";
+ break;
+
+ default:
+ st_info_stb_str = "";
}
+
switch (ELF_ST_VISIBILITY (isym->st_other))
{
- case STV_DEFAULT: st_other_str = "STV_DEFAULT";
- case STV_INTERNAL: st_other_str = "STV_INTERNAL";
- case STV_PROTECTED: st_other_str = "STV_PROTECTED";
- default: st_other_str = "";
+ case STV_DEFAULT:
+ st_other_str = "STV_DEFAULT";
+ break;
+
+ case STV_INTERNAL:
+ st_other_str = "STV_INTERNAL";
+ break;
+
+ case STV_PROTECTED:
+ st_other_str = "STV_PROTECTED";
+ break;
+
+ default:
+ st_other_str = "";
}
+
switch (isym->st_shndx)
{
- case SHN_ABS: st_shndx_str = "SHN_ABS";
- case SHN_COMMON: st_shndx_str = "SHN_COMMON";
- case SHN_UNDEF: st_shndx_str = "SHN_UNDEF";
- default: st_shndx_str = "";
+ case SHN_ABS:
+ st_shndx_str = "SHN_ABS";
+ break;
+
+ case SHN_COMMON:
+ st_shndx_str = "SHN_COMMON";
+ break;
+
+ case SHN_UNDEF:
+ st_shndx_str = "SHN_UNDEF";
+ break;
+
+ default:
+ st_shndx_str = "";
}
printf ("isym = %p st_value = %lx st_size = %lx st_name = (%lu) %s "