diff options
author | Ian Lance Taylor <ian@airs.com> | 1996-04-11 16:41:48 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1996-04-11 16:41:48 +0000 |
commit | 65feb78d1303bcb5a613085f4ab42627629f3de0 (patch) | |
tree | 4ef1e73a315d680d33a7ec3186b915661e90ebef /gas | |
parent | aa59d90e5565576fa712c7db2d17d7a1ca644d1e (diff) | |
download | gdb-65feb78d1303bcb5a613085f4ab42627629f3de0.zip gdb-65feb78d1303bcb5a613085f4ab42627629f3de0.tar.gz gdb-65feb78d1303bcb5a613085f4ab42627629f3de0.tar.bz2 |
* config/tc-m68k.c (md_estimate_size_before_relax): Correct check
for byte jump to next instruction to skip empty frags.
PR 7044.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-m68k.c | 27 |
2 files changed, 25 insertions, 7 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index dc5ec3a..caf2699 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +Thu Apr 11 12:39:02 1996 Ian Lance Taylor <ian@cygnus.com> + + * config/tc-m68k.c (md_estimate_size_before_relax): Correct check + for byte jump to next instruction to skip empty frags. + Wed Apr 10 16:48:12 1996 Ian Lance Taylor <ian@cygnus.com> * config/tc-alpha.c (alpha_ip): If we are going to call emit_add64 diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index d9694e0..1021395 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -28,7 +28,7 @@ /* This array holds the chars that always start a comment. If the pre-processor is disabled, these aren't very useful */ -#if (defined (OBJ_ELF) && ! defined (TE_PSOS)) || defined (TE_DELTA) +#if (defined (OBJ_ELF) && ! defined (TE_PSOS) && ! defined (TE_LINUX)) || defined (TE_DELTA) const char comment_chars[] = "|#"; #else const char comment_chars[] = "|"; @@ -4159,13 +4159,26 @@ md_estimate_size_before_relax (fragP, segment) { case TAB (BCC68000, BYTE): case TAB (ABRANCH, BYTE): - /* We can't do a short jump to the next instruction, - so we force word mode. */ - if (fragP->fr_symbol && S_GET_VALUE (fragP->fr_symbol) == 0 && - fragP->fr_symbol->sy_frag == fragP->fr_next) + /* We can't do a short jump to the next instruction, so we force + word mode. At this point S_GET_VALUE should return the + offset of the symbol within its frag. If the symbol is at + the start of a frag, and it is the next frag with any data in + it (usually this just the next frag, but assembler listings + may introduce empty frags), we must use word mode. */ + if (fragP->fr_symbol && S_GET_VALUE (fragP->fr_symbol) == 0) { - fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); - fragP->fr_var += 2; + fragS *l; + + for (l = fragP->fr_next; + l != fragP->fr_symbol->sy_frag; + l = l->fr_next) + if (l->fr_fix + l->fr_var != 0) + break; + if (l == fragP->fr_symbol->sy_frag) + { + fragP->fr_subtype = TAB (TABTYPE (fragP->fr_subtype), SHORT); + fragP->fr_var += 2; + } } break; default: |