aboutsummaryrefslogtreecommitdiff
path: root/bfd/reloc.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2016-10-31 16:14:35 +0000
committerMaciej W. Rozycki <macro@imgtec.com>2016-11-01 22:57:56 +0000
commitaf955fe696088e69b436947b4a6f134567d31793 (patch)
treef6ecf80f2dee0467ce2f24fa7c7c7ec457e7b278 /bfd/reloc.c
parente23eba971dd409b999dd83d8df0f842680c1c642 (diff)
downloadgdb-af955fe696088e69b436947b4a6f134567d31793.zip
gdb-af955fe696088e69b436947b4a6f134567d31793.tar.gz
gdb-af955fe696088e69b436947b4a6f134567d31793.tar.bz2
BFD: Fix double BFD_FAIL calls in `bfd_default_reloc_type_lookup'
Break out of the outer switch statement once the inner switch for the BFD_RELOC_CTOR relocation has been processed, preventing double BFD_FAIL calls from being made, once from the inner switch and then again from the default case of the outer switch. Noticed with a `-Wimplicit-fallthrough' build error reported by a recent GCC version: In file included from .../bfd/reloc.c:52:0: .../bfd/reloc.c: In function 'bfd_default_reloc_type_lookup': .../bfd/libbfd.h:779:8: error: this statement may fall through [-Werror=implicit-fallthrough=] do { bfd_assert(__FILE__,__LINE__); } while (0) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .../bfd/reloc.c:7780:4: note: in expansion of macro 'BFD_FAIL' BFD_FAIL (); ^~~~~~~~ .../bfd/reloc.c:7782:5: note: here default: ^~~~~~~ cc1: all warnings being treated as errors make[4]: *** [reloc.lo] Error 1 bfd/ * reloc.c (bfd_default_reloc_type_lookup) <BFD_RELOC_CTOR>: Do not fall through to the default case.
Diffstat (limited to 'bfd/reloc.c')
-rw-r--r--bfd/reloc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 7c67eeb..56cd79b 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -7859,6 +7859,7 @@ bfd_default_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code)
default:
BFD_FAIL ();
}
+ break;
default:
BFD_FAIL ();
}