aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-03-01 06:10:58 +0000
committerIan Lance Taylor <ian@airs.com>1997-03-01 06:10:58 +0000
commita941619c0b0c871c0bf64844d4bc058ddc158e3f (patch)
treeb1b6133f4c6f5c56a5742c3abdc525a0da662755 /gas/config
parent847e232af6adf4d21eb51ee396f914de1395da7e (diff)
downloadfsf-binutils-gdb-a941619c0b0c871c0bf64844d4bc058ddc158e3f.zip
fsf-binutils-gdb-a941619c0b0c871c0bf64844d4bc058ddc158e3f.tar.gz
fsf-binutils-gdb-a941619c0b0c871c0bf64844d4bc058ddc158e3f.tar.bz2
* config/tc-mips.c (mips16_extended_frag): Don't assume that we
can rely on the frag address to determine whether a frag is earlier or later.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-mips.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 31b5d1f..5290f3b 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -9787,12 +9787,16 @@ mips16_extended_frag (fragp, sec, stretch)
{
fragS *f;
- /* Adjust stretch for any alignment frag. FIXME: This
- doesn't handle the fr_subtype field, which specifies a
- maximum number of bytes to skip when doing an alignment. */
- for (f = fragp; f != fragp->fr_symbol->sy_frag; f = f->fr_next)
+ /* Adjust stretch for any alignment frag. Note that if have
+ been expanding the earlier code, the symbol may be
+ defined in what appears to be an earlier frag. FIXME:
+ This doesn't handle the fr_subtype field, which specifies
+ a maximum number of bytes to skip when doing an
+ alignment. */
+ for (f = fragp;
+ f != NULL && f != fragp->fr_symbol->sy_frag;
+ f = f->fr_next)
{
- assert (f != NULL);
if (f->fr_type == rs_align || f->fr_type == rs_align_code)
{
if (stretch < 0)
@@ -9804,7 +9808,8 @@ mips16_extended_frag (fragp, sec, stretch)
break;
}
}
- val += stretch;
+ if (f != NULL)
+ val += stretch;
}
addr = fragp->fr_address + fragp->fr_fix;