aboutsummaryrefslogtreecommitdiff
path: root/gas/symbols.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-05-06 21:23:45 +0930
committerAlan Modra <amodra@gmail.com>2019-05-07 15:35:53 +0930
commit0f1309c8f7530b31ecc73c55e86572ff72256947 (patch)
treea53de99ac45372940b596c28d81312bd37a183b3 /gas/symbols.c
parent26bfd82367d6ffeb1a61495ac445542e757df5b2 (diff)
downloadgdb-0f1309c8f7530b31ecc73c55e86572ff72256947.zip
gdb-0f1309c8f7530b31ecc73c55e86572ff72256947.tar.gz
gdb-0f1309c8f7530b31ecc73c55e86572ff72256947.tar.bz2
Tidy use_complex_relocs_for
Since I was looking at this I decided to fix the formatting, and used an old C switch statements trick to factor out common code. * symbols.c (use_complex_relocs_for): Formatting. Factor out X_add_symbol tests.
Diffstat (limited to 'gas/symbols.c')
-rw-r--r--gas/symbols.c35
1 files changed, 13 insertions, 22 deletions
diff --git a/gas/symbols.c b/gas/symbols.c
index 10d7b1c..918028f 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -1097,19 +1097,6 @@ use_complex_relocs_for (symbolS * symp)
case O_constant:
return 0;
- case O_symbol:
- case O_symbol_rva:
- case O_uminus:
- case O_bit_not:
- case O_logical_not:
- if ( (S_IS_COMMON (symp->sy_value.X_add_symbol)
- || S_IS_LOCAL (symp->sy_value.X_add_symbol))
- &&
- (S_IS_DEFINED (symp->sy_value.X_add_symbol)
- && S_GET_SEGMENT (symp->sy_value.X_add_symbol) != expr_section))
- return 0;
- break;
-
case O_multiply:
case O_divide:
case O_modulus:
@@ -1129,18 +1116,22 @@ use_complex_relocs_for (symbolS * symp)
case O_gt:
case O_logical_and:
case O_logical_or:
-
- if ( (S_IS_COMMON (symp->sy_value.X_add_symbol)
- || S_IS_LOCAL (symp->sy_value.X_add_symbol))
- &&
- (S_IS_COMMON (symp->sy_value.X_op_symbol)
+ if ((S_IS_COMMON (symp->sy_value.X_op_symbol)
|| S_IS_LOCAL (symp->sy_value.X_op_symbol))
-
- && S_IS_DEFINED (symp->sy_value.X_add_symbol)
&& S_IS_DEFINED (symp->sy_value.X_op_symbol)
- && S_GET_SEGMENT (symp->sy_value.X_add_symbol) != expr_section
&& S_GET_SEGMENT (symp->sy_value.X_op_symbol) != expr_section)
- return 0;
+ {
+ case O_symbol:
+ case O_symbol_rva:
+ case O_uminus:
+ case O_bit_not:
+ case O_logical_not:
+ if ((S_IS_COMMON (symp->sy_value.X_add_symbol)
+ || S_IS_LOCAL (symp->sy_value.X_add_symbol))
+ && S_IS_DEFINED (symp->sy_value.X_add_symbol)
+ && S_GET_SEGMENT (symp->sy_value.X_add_symbol) != expr_section)
+ return 0;
+ }
break;
default: