summaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2018-02-24 15:50:14 +0000
committerThomas Preud'homme <robotux@celest.fr>2018-02-24 16:05:41 +0000
commit71cce632fb6ba4af4640ffc41d39e940298665e2 (patch)
tree3b55b76a02fc4008077d45191f8646deca112b23 /tccelf.c
parent09f0871781d6462279d3ea97db05b0cc4d77d4d2 (diff)
Prevent dead code on !x86 in prepare_dynamic_rel
In prepare_dynamic_rel() on non x86 targets the count++ statements appear before any case label and are therefore dead code. This triggers build failure when building with -Werror. This patch adds an extra guard around all the x86 case labels and their associated action, leaving just the default case label for non x86 targets which builds fine. Origin: vendor Forwarded: no Last-Updated: 2018-02-24
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tccelf.c b/tccelf.c
index 70d47e1..be540d5 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -873,6 +873,7 @@ static int prepare_dynamic_rel(TCCState *s1, Section *sr)
sym_index = ELFW(R_SYM)(rel->r_info);
type = ELFW(R_TYPE)(rel->r_info);
switch(type) {
+#if defined(TCC_TARGET_I386) || defined(TCC_TARGET_X86_64)
#if defined(TCC_TARGET_I386)
case R_386_32:
if (!get_sym_attr(s1, sym_index, 0)->dyn_index
@@ -896,6 +897,7 @@ static int prepare_dynamic_rel(TCCState *s1, Section *sr)
if (get_sym_attr(s1, sym_index, 0)->dyn_index)
count++;
break;
+#endif
default:
break;
}