From: Alan Modra Date: Tue, 8 May 2001 13:13:56 +0000 (+0000) Subject: More fallout from 2001-03-30 changes. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5c65dbc1ca90fc1851e812dfcfbc186ca4a8915f;p=binutils-gdb.git More fallout from 2001-03-30 changes. * config/tc-m68k.c (md_estimate_size_before_relax): Set fr_var from md_relax_table, and combine some switch cases. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index a5b3c3d6659..d2c44413d34 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2001-05-08 Alan Modra + + * config/tc-m68k.c (md_estimate_size_before_relax): Set fr_var + from md_relax_table, and combine some switch cases. + 2001-05-06 Alexandre Oliva * config/tc-mn10300.c (md_assemble): Subtract operand->shift diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index 6fa019cc278..a755285ec4b 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -4587,27 +4587,6 @@ md_estimate_size_before_relax (fragP, segment) { case TAB (BRANCHBWL, SZ_UNDEF): case TAB (BRABSJUNC, SZ_UNDEF): - { - if (S_GET_SEGMENT (fragP->fr_symbol) == segment - && relaxable_symbol (fragP->fr_symbol)) - { - fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), BYTE); - } - else if (flag_short_refs) - { - /* Symbol is undefined and we want short ref. */ - fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); - fragP->fr_var += 2; - } - else - { - /* Symbol is still undefined. Make it LONG. */ - fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), LONG); - fragP->fr_var += 4; - } - break; - } - case TAB (BRABSJCOND, SZ_UNDEF): { if (S_GET_SEGMENT (fragP->fr_symbol) == segment @@ -4619,13 +4598,11 @@ md_estimate_size_before_relax (fragP, segment) { /* Symbol is undefined and we want short ref. */ fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); - fragP->fr_var += 2; } else { /* Symbol is still undefined. Make it LONG. */ fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), LONG); - fragP->fr_var += 6; } break; } @@ -4641,59 +4618,24 @@ md_estimate_size_before_relax (fragP, segment) { /* Symbol is undefined and we don't have long branches. */ fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); - fragP->fr_var += 2; } break; } case TAB (FBRANCH, SZ_UNDEF): - { - if ((S_GET_SEGMENT (fragP->fr_symbol) == segment - && relaxable_symbol (fragP->fr_symbol)) - || flag_short_refs) - { - fragP->fr_subtype = TAB (FBRANCH, SHORT); - fragP->fr_var += 2; - } - else - { - fragP->fr_subtype = TAB (FBRANCH, LONG); - fragP->fr_var += 4; - } - break; - } - case TAB (DBCCLBR, SZ_UNDEF): case TAB (DBCCABSJ, SZ_UNDEF): + case TAB (PCREL1632, SZ_UNDEF): { if ((S_GET_SEGMENT (fragP->fr_symbol) == segment && relaxable_symbol (fragP->fr_symbol)) || flag_short_refs) { fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); - fragP->fr_var += 2; } else { fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), LONG); - fragP->fr_var += 10; - } - break; - } - - case TAB (PCREL1632, SZ_UNDEF): - { - if (((S_GET_SEGMENT (fragP->fr_symbol)) == segment - && relaxable_symbol (fragP->fr_symbol)) - || flag_short_refs) - { - fragP->fr_subtype = TAB (PCREL1632, SHORT); - fragP->fr_var += 2; - } - else - { - fragP->fr_subtype = TAB (PCREL1632, LONG); - fragP->fr_var += 6; } break; } @@ -4707,7 +4649,6 @@ md_estimate_size_before_relax (fragP, segment) else { fragP->fr_subtype = TAB (PCINDEX, LONG); - fragP->fr_var += 4; } break; @@ -4717,12 +4658,10 @@ md_estimate_size_before_relax (fragP, segment) && relaxable_symbol (fragP->fr_symbol))) { fragP->fr_subtype = TAB (ABSTOPCREL, SHORT); - fragP->fr_var += 2; } else { fragP->fr_subtype = TAB (ABSTOPCREL, LONG); - fragP->fr_var += 4; } break; } @@ -4757,13 +4696,13 @@ md_estimate_size_before_relax (fragP, segment) if (l == stop) { fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); - fragP->fr_var += 2; } } break; default: break; } + fragP->fr_var = md_relax_table[fragP->fr_subtype].rlx_length; return fragP->fr_var + fragP->fr_fix - old_fix; }