diff options
author | Nick Clifton <nickc@redhat.com> | 2001-07-06 08:21:35 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2001-07-06 08:21:35 +0000 |
commit | 3dc0b4c6b15bb64bd2ac5b07ad67588fb4ac4014 (patch) | |
tree | 8c3abb2621b63301e988cc080238bef8072c24c8 /gas/config/tc-m68k.c | |
parent | e9caa9c4a286f76129132ac23953e99fc7eca9f2 (diff) | |
download | binutils-redhat-3dc0b4c6b15bb64bd2ac5b07ad67588fb4ac4014.tar.gz |
Catch and ignore empty, ineffectual alignment frags when deciding if a
branch can be short.
Diffstat (limited to 'gas/config/tc-m68k.c')
-rw-r--r-- | gas/config/tc-m68k.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index e14c8cb821..a15d9f516a 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -4694,13 +4694,25 @@ md_estimate_size_before_relax (fragP, segment) fragS *l; stop = symbol_get_frag (fragP->fr_symbol); + for (l = fragP->fr_next; l != stop; l = l->fr_next) - if (l->fr_fix + l->fr_var != 0) - break; - if (l == stop) { - fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); + /* Catch empty alignment frags whoes fr_offset field + is an alignment requirement of 2 bytes. The check + below will misinterpret this as evidence that real + code exists between the symbol and the instruction + and so will not convert the short jump into a word + jump. */ + if (l->fr_fix == 0 + && l->fr_var == 1 + && (l->fr_type == rs_align || l->fr_type == rs_align_code)) + continue; + + if (l->fr_fix + l->fr_var != 0) + break; } + if (l == stop) + fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); } break; default: |